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