From 2466184d8a2f18eb53b26622d6aa76b07d665fb3 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 17 Mar 2016 17:34:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E4=BD=9C=E4=B8=9A=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=E8=BF=98=E8=A6=81=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=8F=91=E5=B8=83=E7=9A=84=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E4=B8=8D=E5=90=88=E7=90=86=EF=BC=8C=E5=BD=B1=E5=93=8D=E4=BD=93?= =?UTF-8?q?=E9=AA=8C=20=E7=BC=96=E8=BE=91=E4=BD=9C=E4=B8=9A=E6=97=B6layout?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=9D=A5=E6=BA=90=E8=80=8C=E4=B8=8D=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 10 ++++++++-- app/views/homework_common/edit.html.erb | 8 +++++++- app/views/users/_user_homework_form.html.erb | 7 ++++--- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 474fc31fd..091e2b86b 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -51,8 +51,14 @@ class HomeworkCommonController < ApplicationController @user = User.current @is_in_course = params[:is_in_course].to_i @course_activity = params[:course_activity].to_i - respond_to do |format| - format.html{render :layout => 'new_base_user'} + if @is_in_course == 1 || @course_activity == 1 + respond_to do |format| + format.html{render :layout => 'base_courses'} + end + else + respond_to do |format| + format.html{render :layout => 'new_base_user'} + end end end diff --git a/app/views/homework_common/edit.html.erb b/app/views/homework_common/edit.html.erb index f95739f26..0c120b7c2 100644 --- a/app/views/homework_common/edit.html.erb +++ b/app/views/homework_common/edit.html.erb @@ -1,4 +1,10 @@ -
+
编辑作业
diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index f23d01d3c..54fe4396b 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -194,9 +194,10 @@
-
- <%= select_tag :course_id, options_for_select(get_as_teacher_courses(User.current), homework.course_id), {:class => "InputBox w709",:value => "请选择发布作业的课程"} %> -
+ + <%= hidden_field_tag :course_id, params[:course_id], :value =>homework.course_id %>