diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index c10f8bc84..ac25fbe9d 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -34,7 +34,7 @@ class CommentsController < ApplicationController ids = params[:asset_id].split(',') update_kindeditor_assets_owner ids,@comment.id,OwnerTypeHelper::COMMENT end - # 与我相关动态的记录add start + # 锟斤拷锟斤拷锟斤拷囟锟教拷募锟铰糰dd start if( @comment.id && @news.course ) if(@news.author_id != User.current.id) notify = ActivityNotify.new() @@ -47,11 +47,18 @@ class CommentsController < ApplicationController notify.save() end end - # 与我相关动态的记录add end + # 锟斤拷锟斤拷锟斤拷囟锟教拷募锟铰糰dd end flash[:notice] = l(:label_comment_added) end - redirect_to news_url(@news) + if params[:user_activity_id] + @user_activity_id = params[:user_activity_id] + respond_to do |format| + format.js + end + else + redirect_to news_url(@news) + end end def destroy diff --git a/app/views/comments/create.js.erb b/app/views/comments/create.js.erb new file mode 100644 index 000000000..d55b714ad --- /dev/null +++ b/app/views/comments/create.js.erb @@ -0,0 +1,3 @@ +$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>"); + +init_KindEditor_data(<%= @user_activity_id%>); diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index 4295139e0..fb9561df6 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -1,4 +1,4 @@ -
+
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "鐢ㄦ埛澶村儚" %> @@ -18,9 +18,9 @@
鍙戝竷鏃堕棿锛<%= format_date(activity.created_on) %>
-
閫氱煡鎻忚堪锛<%= activity.description.html_safe %>
+
閫氱煡鎻忚堪锛<%= activity.description.html_safe %>
-