diff --git a/app/controllers/syllabuses_controller.rb b/app/controllers/syllabuses_controller.rb index 2be73ff27..a43ed5cb4 100644 --- a/app/controllers/syllabuses_controller.rb +++ b/app/controllers/syllabuses_controller.rb @@ -57,6 +57,13 @@ class SyllabusesController < ApplicationController end def delete_syllabus + if @syllabus.courses.empty? + @status = 1 + elsif @syllabus.courses.not_deleted.empty? + @status = 2 + else + @status = 3 + end respond_to do |format| format.js end diff --git a/app/views/account/_change_user_email.html.erb b/app/views/account/_change_user_email.html.erb index 20eae1374..519ffb8a5 100644 --- a/app/views/account/_change_user_email.html.erb +++ b/app/views/account/_change_user_email.html.erb @@ -59,13 +59,18 @@ if($mail_correct == false){ return }else{ + // 改变邮箱地址 $.get('<%= account_change_email_path(:user_id => @user.id) %>', { valid: "mail", value: document.getElementById("user_mail").value }, function (data){ - $("#user_email_show").html(data.email); - hideModal(); - return; + $("#user_email_show").html(data.email); + // 更改邮箱地址后,直接给用户发送邮件 + $.ajax({ + url: "<%= resendmail_path(:user => @user) %>" + }); + hideModal(); + return; }); } } diff --git a/app/views/account/email_valid.html.erb b/app/views/account/email_valid.html.erb index e850d96c2..f0a91069a 100644 --- a/app/views/account/email_valid.html.erb +++ b/app/views/account/email_valid.html.erb @@ -18,8 +18,8 @@
尚未发布竞赛说明,敬请期待~
<% else %><%= test.results.first %>
<%= test.results.first.to_s.force_encoding("UTF-8") %>