<% comments.reorder("created_on desc").each do |comment| %>
  • <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
    <% if comment.try(:user).try(:realname) == ' ' %> <%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> <% else %> <%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> <% end %> <%= time_from_now(comment.created_on) %>
    <% unless comment.m_parent_id.nil? %> <% parents_rely = [] %> <% parents_rely = get_reply_parents parents_rely, comment %> <% length = parents_rely.length %>
    <% if length <= 3 %> <%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %> <% else %>
    <%=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %>
    <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %>
    ↓ ↑ <%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment),:remote=>true %>
    <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
    <% end %>
    <% end %>
    <%= comment.notes.html_safe %>
    <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%= link_to( l(:button_reply), {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity}, :remote => true, :method => 'get', :title => l(:button_reply)) %> ︿ <% if User.current.admin? ||is_teacher || comment.user == User.current%> <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity}, :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %> <% end %>

  • <% end %>