From c08c327f7333bf9d9a2fc3335c24f990a124883b Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 6 Nov 2015 11:26:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=81=AB=E7=8B=90=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=E4=B8=8B=E8=AF=BE=E7=A8=8B=E4=BD=9C=E4=B8=9A=E7=9A=84=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E6=97=A0=E6=B3=95=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/words_controller.rb | 1 + app/views/users/_course_homework.html.erb | 1 + app/views/words/leave_homework_message.js.erb | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 6ad1a66b4..8590b836a 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -272,6 +272,7 @@ class WordsController < ApplicationController format.js{ @user_activity_id = params[:user_activity_id] @is_in_course = params[:is_in_course] + @course_activity = params[:course_activity] @homework_common_id = params[:homework_common_id] } end diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index f442e34e4..f77dd13bf 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -167,6 +167,7 @@
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => activity.id},:method => "post", :remote => true) do |f|%> <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %> + <%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %>
diff --git a/app/views/words/leave_homework_message.js.erb b/app/views/words/leave_homework_message.js.erb index 91525c889..08fed725c 100644 --- a/app/views/words/leave_homework_message.js.erb +++ b/app/views/words/leave_homework_message.js.erb @@ -1,5 +1,5 @@ <% if @user_activity_id %> - $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework_common,:user_activity_id =>@user_activity_id}) %>"); + $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework_common,:user_activity_id =>@user_activity_id,:course_activity => @course_activity}) %>"); init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); <% elsif @homework_common_id && @is_in_course %> $("#homework_common_<%= @homework_common_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework_common,:is_in_course => @is_in_course}) %>");