Changeset 1164

Show
Ignore:
Timestamp:
06/10/08 15:48:27 (7 months ago)
Author:
tonkla
Message:

recover comment reference

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/controllers/comment_controller.rb

    r1033 r1164  
    2121                                  :conditions => ['user_id = ?', @owner.id],  
    2222                                  :order => 'created_at DESC') 
     23    @make_link = false 
     24 
    2325    respond_to do |format| 
    2426      format.html { render :partial => 'comment_list', :layout => true } 
  • trunk/app/views/comment/_comment.html.erb

    r1163 r1164  
    55      <%= link_to post.blog.title, blog_blog_url(:address => post.blog.address) %> 
    66      &raquo; 
    7       <%= link_to post.title, blog_post_view_url(:address => post.blog.address, :id => post.id) + "#" + comment.id.to_s %> 
     7      <%= link_to post.title, blog_post_view_url(:address => post.blog.address, :id => post.id) %> 
    88    <% elsif !(upload = comment.upload_parent).nil? -%> 
    99      <%= user_picture(upload.user, 10) %> 
    1010      <%= link_to upload.user.preferred_name, profile_user_url(:username => upload.user.username) %> 
    1111      &raquo; 
    12       <%= link_to upload.filename, file_view_url(:username => upload.user.username, :id => upload.id) + "#" + comment.id.to_s %> 
     12      <%= link_to upload.filename, file_view_url(:username => upload.user.username, :id => upload.id) %> 
    1313    <% elsif !(question = comment.question_parent).nil? -%> 
    1414      <%= user_picture(question.questioner, 10) %> 
     
    2222      <%= link_to question.user.preferred_name, profile_user_url(:username => question.user.username) %> 
    2323      :: 
    24       <%= link_to question.subject, ask_view_url(:username => question.user.username, :id => question.id) + "#" + comment.id.to_s %> 
     24      <%= link_to question.subject, ask_view_url(:username => question.user.username, :id => question.id) %> 
    2525    <% end -%> 
    2626  </div> 
    27   <%= render :partial => "comment/comment_item", :locals => {:comment => comment, :show_delete => false, :highlight => false} %> 
     27  <%= render :partial => "comment/comment_item",  
     28             :locals => {:comment => comment, :show_delete => false, :highlight => false, :make_link => @make_link} %> 
    2829</div> 
  • trunk/app/views/comment/_comment_item.html.erb

    r1163 r1164  
    2626    <br /> 
    2727 
    28     <%= "#%s" % comment.id %> 
     28    <% if defined?(make_link) && make_link == false %> 
     29      <%= "#%s" % comment.id %> 
     30    <% else %> 
     31      <%= link_to comment.id, "##{comment.id}" %> 
     32    <% end %> 
    2933 
    3034    <% if defined?(show_delete) && show_delete -%> 
  • trunk/app/views/comment/_comment_list.html.erb

    r1131 r1164  
    77    <% else -%> 
    88      <% @comments.each do |comment| -%> 
    9         <%= render :partial => "comment/comment", :object => comment %> 
     9        <%= render :partial => "comment/comment", :locals => { :comment => comment, :make_link => @make_link } %> 
    1010      <% end -%> 
    1111        <%= render :partial => "shared/pagination_links", :object => @comments %>