From b6e13340e56a09dfd4060760df1b744379466645 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 25 Jan 2016 15:33:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E7=95=99=E8=A8=80=E7=9A=84?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/words_controller.rb | 4 ++- .../users/_user_journalsformessage.html.erb | 27 +++++++++++++++++-- app/views/words/create_reply.js.erb | 6 +---- app/views/words/destroy.js.erb | 12 ++++++--- 4 files changed, 38 insertions(+), 11 deletions(-) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index d24427a9d..699a5e8ca 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -73,7 +73,6 @@ class WordsController < ApplicationController # render 'test/index' # } format.js { - @reply_type = params[:reply_type] @user_activity_id = params[:user_activity_id] @activity = JournalsForMessage.find(parent_id) @is_activity = params[:is_activity] @@ -95,6 +94,9 @@ class WordsController < ApplicationController @user = User.find(@journal_destroyed.jour_id) @jours_count = @user.journals_for_messages.where('m_parent_id IS NULL').count @is_user = true + @user_activity_id = params[:user_activity_id] if params[:user_activity_id] + @is_activity = params[:is_activity].to_i if params[:is_activity] + @activity = @journal_destroyed.parent if @journal_destroyed.parent elsif @journal_destroyed.jour_type == 'HomeworkCommon' @homework = HomeworkCommon.find @journal_destroyed.jour_id if params[:user_activity_id] diff --git a/app/views/users/_user_journalsformessage.html.erb b/app/views/users/_user_journalsformessage.html.erb index e30fd1824..d7247621a 100644 --- a/app/views/users/_user_journalsformessage.html.erb +++ b/app/views/users/_user_journalsformessage.html.erb @@ -39,6 +39,22 @@ 更新时间:<%= format_time(PrincipalActivity.where("principal_act_type='#{activity.class}' and principal_act_id =#{activity.id}").first.updated_at) %>
+ <% if activity.user == User.current || User.current.admin?%> +
+ +
+ <% end%>
@@ -71,7 +87,7 @@