diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index df14dd53..06a09f93 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -2210,6 +2210,16 @@ end end end + + # 讨论区邮件通知 + def course_board_email_notify + if params[:course_id] + course = Course.find params[:course_id] + course.update_attributes(:email_notify => !course.email_notify) + end + end + + # 课程实训 def class_shixuns @menu_type = 4 diff --git a/app/views/managements/_classroom_classment_list.html.erb b/app/views/managements/_classroom_classment_list.html.erb index 2b9c98cb..9321c495 100644 --- a/app/views/managements/_classroom_classment_list.html.erb +++ b/app/views/managements/_classroom_classment_list.html.erb @@ -40,6 +40,8 @@ <%= course.is_hidden ? "显示" : "隐藏" %> class="ml-3 mr5 magic-checkbox" id="join_course_role_<%= course.id %>"> + class="ml-3 mr5 magic-checkbox" id="email_notify_<%= course.id %>"> + <% end %> @@ -74,4 +76,13 @@ dateType: "script" }); }) + $("input[name='email_notify']").click(function(){ + var course_id = $(this).val(); + $.ajax({ + url:"<%= course_board_email_notify_managements_path %>", + data: {course_id: course_id}, + type: 'post', + dateType: "script" + }); + }) diff --git a/app/views/managements/course_board_email_notify.js.erb b/app/views/managements/course_board_email_notify.js.erb new file mode 100644 index 00000000..e69de29b diff --git a/config/routes.rb b/config/routes.rb index ef6d561c..49f180bb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -625,6 +625,7 @@ RedmineApp::Application.routes.draw do ## oauth相关 get 'update_shixun_hidden' get 'update_subject_hidden' post 'course_homepage_show' + post 'course_board_email_notify' post 'shixun_homepage_show' post 'update_shixun_task_pass' post 'update_shixun_code_hidden'