+ <% count = 0 %>
回复(
- <% if activity.parent_id.nil? %>
- <% count=activity.replies_count%>
- <%=count %>
+ <% if activity.parent %>
+ <% count=activity.parent.children.count%>
<% else %>
- <% count=activity.parent.replies_count%>
- <%=count %>
+ <% count=activity.children.count%>
<% end %>
+ <%=count %>
)
<%#=format_date(activity.updated_on)%>
<%if count>2 %>
@@ -81,7 +70,7 @@
<% activity= activity.parent_id.nil? ? activity : activity.parent %>
<% replies_all_i = 0 %>
- <% unless activity.children.empty? %>
+ <% if count > 0 %>
<% activity.children.reorder("created_on desc").each do |reply| %>
@@ -98,15 +87,6 @@
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_date(reply.created_on) %>
- <%#= link_to(
- l(:button_delete),
- {:controller => 'messages', :action => 'destroy', :id => reply.id, :board_id => reply.board_id, :is_board => 'false'},
- :method => :post,
- :data => {:confirm => l(:text_are_you_sure)},
- :title => l(:button_delete),
- :class => 'replyGrey fr ml10'
- ) if reply.course_destroyable_by?(User.current) %>
-
<%= reply.content.html_safe %>