From 8acc432f910c140e64ed32dc1327180aebf52f5b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 2 Sep 2015 13:46:33 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AE=A8=E8=AE=BA=E5=8C=BA?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_message.html.erb | 2 +- app/views/users/_project_message.html.erb | 34 +++++------------------ 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index 2248b40c3..f622ad20c 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -52,7 +52,7 @@
回复( <% if activity.parent %> <% count=activity.parent.children.count%> - <% else %> + <% else %> <% count=activity.children.count%> <% end %> <%= count %> diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index 7d563bdf7..ebf3d0ad2 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -33,30 +33,19 @@ <%= activity.parent.content.to_s.html_safe%> <% end %>
-
-
<% count=0 %> +
+ <% 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 %>