课堂的邮件通知

dev_aliyun
cxt 5 years ago
parent 2fe3f5741b
commit f1c54bdee2

@ -2210,6 +2210,16 @@ end
end 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 def class_shixuns
@menu_type = 4 @menu_type = 4

@ -40,6 +40,8 @@
<a href="<%= hidden_course_managements_path(:course_id => course.id) %>" class="mr5 fr" data-remote="true" id="hidden_course_<%= course.id %>"><%= course.is_hidden ? "显示" : "隐藏" %></a> <a href="<%= hidden_course_managements_path(:course_id => course.id) %>" class="mr5 fr" data-remote="true" id="hidden_course_<%= course.id %>"><%= course.is_hidden ? "显示" : "隐藏" %></a>
<input type="checkbox" name="homepage_show" value="<%= course.id %>" <%= course.homepage_show ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="join_course_role_<%= course.id %>"> <input type="checkbox" name="homepage_show" value="<%= course.id %>" <%= course.homepage_show ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="join_course_role_<%= course.id %>">
<label style="top:0px;padding-left: 25px;float:right; margin-right: 10px" for="join_course_role_<%= course.id %>">首页显示</label> <label style="top:0px;padding-left: 25px;float:right; margin-right: 10px" for="join_course_role_<%= course.id %>">首页显示</label>
<input type="checkbox" name="email_notify" value="<%= course.id %>" <%= course.email_notify ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="email_notify_<%= course.id %>">
<label style="top:0px;padding-left: 25px;float:right; margin-right: 10px" for="email_notify_<%= course.id %>">邮件通知</label>
</td> </td>
</tr> </tr>
<% end %> <% end %>
@ -74,4 +76,13 @@
dateType: "script" 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"
});
})
</script> </script>

@ -625,6 +625,7 @@ RedmineApp::Application.routes.draw do ## oauth相关
get 'update_shixun_hidden' get 'update_shixun_hidden'
get 'update_subject_hidden' get 'update_subject_hidden'
post 'course_homepage_show' post 'course_homepage_show'
post 'course_board_email_notify'
post 'shixun_homepage_show' post 'shixun_homepage_show'
post 'update_shixun_task_pass' post 'update_shixun_task_pass'
post 'update_shixun_code_hidden' post 'update_shixun_code_hidden'

Loading…
Cancel
Save