From eb255d84b17cb587b49cd909d44801889c05e8d3 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 29 Aug 2016 16:25:30 +0800 Subject: [PATCH] =?UTF-8?q?issue=E8=AF=A6=E6=83=85=E9=A1=B5=E9=87=8C?= =?UTF-8?q?=E7=9A=84=E7=82=B9=E8=B5=9E=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_issue_reply_banner.html.erb | 5 +++++ app/views/issues/_jounal_refresh.js.erb | 2 +- app/views/issues/show.html.erb | 8 ++------ 3 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 app/views/issues/_issue_reply_banner.html.erb diff --git a/app/views/issues/_issue_reply_banner.html.erb b/app/views/issues/_issue_reply_banner.html.erb new file mode 100644 index 000000000..d68b2e38b --- /dev/null +++ b/app/views/issues/_issue_reply_banner.html.erb @@ -0,0 +1,5 @@ +<% count = @issue.journals.count %> +回复<%= count>0 ? "(#{count})" : "" %> + + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>@issue, :user_activity_id=>@issue.id,:type=>"activity"}%> + \ No newline at end of file diff --git a/app/views/issues/_jounal_refresh.js.erb b/app/views/issues/_jounal_refresh.js.erb index 0945ba04d..df3d605f4 100644 --- a/app/views/issues/_jounal_refresh.js.erb +++ b/app/views/issues/_jounal_refresh.js.erb @@ -17,5 +17,5 @@ issue_desc_editor = KindEditor.create('#issue_description', "uploadJson":"/kindeditor/upload", "fileManagerJson":"/kindeditor/filemanager"}); // $("#issue_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>"); -$(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)'); +$(".homepagePostReplyBannerCount").html('<%= escape_javascript(render :partial => 'issues/issue_reply_banner') %>'); sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%= @issue.class.name %>"); \ No newline at end of file diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 540e9d4ca..40728d451 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -36,12 +36,8 @@
- <% count = @issue.journals.count %> -
回复 - <%= count>0 ? "(#{count})" : "" %> - - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>@issue, :user_activity_id=>@issue.id,:type=>"activity"}%> - +
+ <%=render :partial => 'issue_reply_banner' %>