<% all_replies = Message.where("root_id = #{activity.id}").reorder("created_on desc") %> <% count = all_replies.count %> <% no_children_comments = get_no_children_comments all_replies %> <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :expand_more =>no_children_comments[:three_more]} %> <% if count > 0 %>
<%= render :partial => 'users/message_replies', :locals => {:comments => no_children_comments[:no_children_comments], :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id}%>
<% end %> <% if !activity.locked? && authorize_for_course('messages', 'reply') %>
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
<% if User.current.logged? %>
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id},:method => "post", :remote => true) do |f|%>

<% end%>
<% else %> <%= render :partial => "users/show_unlogged" %> <% end %>
<% end %>