From a732efa6c6809596ee518120f4e738df3961b3a1 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Thu, 7 Jul 2016 10:42:51 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=BB=84=E7=BB=87=E5=8A=A8=E6=80=81=E4=B8=AD?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=AE=BE=E4=B8=BA=E9=A6=96=E9=A1=B5=E7=9A=84?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=8A=A8=E6=80=81=202.=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5=E5=8A=A8=E6=80=81=E4=B8=AD=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E8=AE=BE=E4=B8=BA=E9=A6=96=E9=A1=B5=E7=9A=84=E5=8D=9A=E5=AE=A2?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=B9=B6=E5=B0=86=20=E6=9C=80=E4=B8=8A?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E5=8D=9A=E5=AE=A2=E6=98=BE=E7=A4=BA=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E5=86=85=E5=AE=B9=E5=8F=8A=E5=8F=AF=E5=9B=9E=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/blog_comments_controller.rb | 3 ++ app/views/blog_comments/reply.js.erb | 5 +- app/views/blogs/_homepage.html.erb | 49 +++++++++++++++++++ .../organizations/_org_activities.html.erb | 2 +- app/views/users/_user_activities.html.erb | 4 +- 5 files changed, 60 insertions(+), 3 deletions(-) diff --git a/app/controllers/blog_comments_controller.rb b/app/controllers/blog_comments_controller.rb index 0224a587d..4a8de5814 100644 --- a/app/controllers/blog_comments_controller.rb +++ b/app/controllers/blog_comments_controller.rb @@ -116,6 +116,9 @@ class BlogCommentsController < ApplicationController #回复 def reply + if params[:homepage] + @in_user_homepage = true + end if params[:in_user_center] @in_user_center = true end diff --git a/app/views/blog_comments/reply.js.erb b/app/views/blog_comments/reply.js.erb index 915ab892d..baf4418e9 100644 --- a/app/views/blog_comments/reply.js.erb +++ b/app/views/blog_comments/reply.js.erb @@ -1,4 +1,7 @@ -<% if @in_user_center%> +<% if @in_user_homepage %> + <% homepage = BlogComment.find(@user.blog.homepage_id) %> + $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id}) %>"); +<% elsif @in_user_center%> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>"); // init_activity_KindEditor_data(<%#= @user_activity_id%>,"","87%", 'UserActivity'); <% else%> diff --git a/app/views/blogs/_homepage.html.erb b/app/views/blogs/_homepage.html.erb index 5dbee59d6..140f547cb 100644 --- a/app/views/blogs/_homepage.html.erb +++ b/app/views/blogs/_homepage.html.erb @@ -48,4 +48,53 @@
+ <% count=activity.children.count %> +