From ecfee445c3fe2698dc4e561babc70e12a3e6af86 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 16 Aug 2017 17:34:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=8D=E9=80=89=E6=A1=86=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=9C=A8=E7=BF=BB=E9=A1=B5=E5=90=8E=E5=8E=9F=E6=9D=A5=E9=A1=B5?= =?UTF-8?q?=E7=9A=84=E9=80=89=E6=8B=A9=E8=A2=AB=E4=B8=A2=E6=8E=89=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/subjects_controller.rb | 2 +- app/views/layouts/base_subject.html.erb | 6 ++--- .../subjects/_course_shixun_list.html.erb | 13 +++++++++- .../subjects/_my_course_shixun_list.html.erb | 24 +++++++++++-------- public/javascripts/edu/subject.js | 10 ++++++++ 5 files changed, 40 insertions(+), 15 deletions(-) create mode 100644 public/javascripts/edu/subject.js diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index de31d9338..0b746c675 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -95,7 +95,7 @@ class SubjectsController < ApplicationController end def append_to_stage - @shixuns = Shixun.where(:id => params[:shixun_id]) + @shixuns = Shixun.where(:id => params[:choose_ids].split(",")).reorder("id desc") end def publish diff --git a/app/views/layouts/base_subject.html.erb b/app/views/layouts/base_subject.html.erb index eca18d661..1b27ea123 100644 --- a/app/views/layouts/base_subject.html.erb +++ b/app/views/layouts/base_subject.html.erb @@ -10,6 +10,9 @@ <%= javascript_heads %> <%= heads_for_theme %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/edu-popup','css/edu-common', "css/edu-public", 'css/taskstyle', 'css/edu-subject', 'css/moduel', 'css/font-awesome', 'css/edu-tooltipster', 'css/magic-check' %> + + + <%= javascript_include_tag 'application', 'cookie',"avatars", 'header','prettify','attachments','edu/application','edu/subject' %> <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> @@ -43,8 +46,5 @@ <%= call_hook :view_layouts_base_body_bottom %> - - -<%= javascript_include_tag 'application', 'cookie',"avatars", 'header','prettify','attachments','edu/application' %> diff --git a/app/views/subjects/_course_shixun_list.html.erb b/app/views/subjects/_course_shixun_list.html.erb index bd7c2186d..579ee004b 100644 --- a/app/views/subjects/_course_shixun_list.html.erb +++ b/app/views/subjects/_course_shixun_list.html.erb @@ -39,4 +39,15 @@ 选择 取消 - \ No newline at end of file + + + \ No newline at end of file diff --git a/app/views/subjects/_my_course_shixun_list.html.erb b/app/views/subjects/_my_course_shixun_list.html.erb index 2c2494f56..6b4416489 100644 --- a/app/views/subjects/_my_course_shixun_list.html.erb +++ b/app/views/subjects/_my_course_shixun_list.html.erb @@ -6,6 +6,7 @@
<%= form_for('new_form', :url => append_to_stage_subjects_path(), :remote => true, :method => "post", :html => {:id => 'choose_course_shixun_form'}) do |f| %> +
<%= render :partial => "course_shixun_list" %>
@@ -15,14 +16,17 @@
\ No newline at end of file diff --git a/public/javascripts/edu/subject.js b/public/javascripts/edu/subject.js new file mode 100644 index 000000000..1eee5f9c9 --- /dev/null +++ b/public/javascripts/edu/subject.js @@ -0,0 +1,10 @@ +function submit_choose_course_shixun(){ + if($("#choose_shixun_ids").val() == ""){ + $("#lessong_nonechecked_tip").show(); + } else{ + $("#lessong_nonechecked_tip").hide(); + $("#choose_course_shixun_form").submit(); + $("#sx_none_notice").hide(); + hideModal(); + } +} \ No newline at end of file