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 @@
+ <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
+
+ <% comments = activity.children.reorder("created_on desc").limit(3) %>
+ <% if count > 0 %>
+
+ <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
+
+ <% end %>
+
+ <% if activity.locked == false && User.current.logged?%>
+
+
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
+
+ <% if User.current.logged? %>
+
+ <%= form_for('new_form',:url => {:controller => 'blog_comments', :action => 'reply', :user_id=>activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id,:homepage=>1},:method => "post", :remote => true) do |f|%>
+
+
+
+
+
+
+
+
+
发送
+
+
+ <% end%>
+
+ <% else %>
+ <%= render :partial => "users/show_unlogged" %>
+ <% end %>
+
+
+
+
+ <% end %>
+
+
\ No newline at end of file
diff --git a/app/views/organizations/_org_activities.html.erb b/app/views/organizations/_org_activities.html.erb
index cc1404eb5..bddba3eee 100644
--- a/app/views/organizations/_org_activities.html.erb
+++ b/app/views/organizations/_org_activities.html.erb
@@ -46,7 +46,7 @@
<% end %>
- <% if act.org_act_type == 'OrgDocumentComment' %>
+ <% if act.org_act_type == 'OrgDocumentComment' && act.org_act.organization.home_id != act.org_act.id %>
<%= render :partial => 'show_org_document', :locals => {:document => act.org_act, :act => act, :flag => 2, :org_subfield_id => params[:org_subfield_id]} %>
<% end %>
<% end %>
diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb
index 5d06a7001..5c6f07bb1 100644
--- a/app/views/users/_user_activities.html.erb
+++ b/app/views/users/_user_activities.html.erb
@@ -93,7 +93,9 @@
<%# cache (act) do %>
<% case user_activity.act_type.to_s %>
<% when 'BlogComment' %>
- <%= render :partial => 'user_blog', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
+ <% if !(act.blog.homepage_id and act.id == act.blog.homepage_id) %>
+ <%= render :partial => 'user_blog', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
+ <% end %>
<% end %>
<%# end %>
<% end %>