From fe0414c83fa9256d5e1a2f6ff502f5fa8e2facbd Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 20 Jan 2016 10:53:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=96=87=E7=AB=A0=E5=92=8C?= =?UTF-8?q?=E5=8D=9A=E5=AE=A2=E7=9A=84=E7=82=B9=E8=B5=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/praise_tread_controller.rb | 2 ++ app/views/blog_comments/show.html.erb | 24 +++++++++++++++---- app/views/org_document_comments/show.html.erb | 24 +++++++++++++++---- .../organizations/_show_org_document.html.erb | 20 ++++++++++++++-- 4 files changed, 60 insertions(+), 10 deletions(-) diff --git a/app/controllers/praise_tread_controller.rb b/app/controllers/praise_tread_controller.rb index 1a01a2f07..96eeab884 100644 --- a/app/controllers/praise_tread_controller.rb +++ b/app/controllers/praise_tread_controller.rb @@ -119,6 +119,8 @@ class PraiseTreadController < ApplicationController @obj = Journal.find_by_id(id) when 'BlogComment' @obj = BlogComment.find_by_id(id) + when 'OrgDocumentComment' + @obj = OrgDocumentComment.find_by_id(id) when 'User' @obj = User.find_by_id(id) when 'Issue' diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index 02f1ad1ad..6f4397569 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -116,9 +116,18 @@ <% count=@article.children.count%> <% end %>
- <% unless count == 0 %> + <%# unless count == 0 %>
-
回复(<%=count %>)
+
回复 + <%= count>0 ? "(#{count})" : "" %> + + <% if @article.author == User.current %> + + <% else %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>@article, :user_activity_id=>@article.id,:type=>"activity"}%> + <% end %> + +