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 @@
  • 请注意查看邮箱中的“订阅邮件”、“垃圾邮件”,可能Trustie的邮件被误杀了
  • 请点击重新发送激活邮件按钮
  • 如果重发注册验证邮箱邮件仍然没有收到,请更换邮箱地址,重新发送激活邮件
  • -
  • 如果您始终无法收到激活邮件,请直接给我们留言:
  • -
    +
  • 如果您始终无法收到激活邮件,请直接给我们留言
  • +
    @@ -36,6 +36,9 @@ url: "<%= change_user_email_user_path(@user) %>" }); }); + $("#leave_message").click(function(){ + $("#message_box").toggle(); + }) }); diff --git a/app/views/contests/show.html.erb b/app/views/contests/show.html.erb index 408088396..9a7ca49ac 100644 --- a/app/views/contests/show.html.erb +++ b/app/views/contests/show.html.erb @@ -19,7 +19,7 @@

    尚未发布竞赛说明,敬请期待~

    <% else %>
    -
    +
    <%= @contest.description.html_safe %>
    diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index 08d48509a..920f42131 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -52,7 +52,7 @@
    <% if test.status.to_i == -2 %>
    - <%= test.results.first %> + <%= test.results.first.to_s.force_encoding("UTF-8") %>
    <% else %>
    diff --git a/app/views/syllabuses/_delete_syllabus.html.erb b/app/views/syllabuses/_delete_syllabus.html.erb index cdcfbb1b6..8a0fc5129 100644 --- a/app/views/syllabuses/_delete_syllabus.html.erb +++ b/app/views/syllabuses/_delete_syllabus.html.erb @@ -6,15 +6,17 @@
    - <% if @syllabus.courses.not_deleted.empty? %> + <% if @status == 1 %> 确认删除该课程吗? + <% elsif @status == 2 %> + 该课程下存在归档班级,不能删除。 <% else %> 该课程下已经存在班级,不能删除。 <% end %>
    - <% if @syllabus.courses.not_deleted.empty? %> + <% if @status == 1 %> 取消 <%=link_to '确认', syllabus_path(@syllabus), :class => 'sy_btn_blue fl', :method => 'delete'%> <% else %> diff --git a/app/views/users/_user_message_applide_action.html.erb b/app/views/users/_user_message_applide_action.html.erb index 21afe7122..1b2730ad5 100644 --- a/app/views/users/_user_message_applide_action.html.erb +++ b/app/views/users/_user_message_applide_action.html.erb @@ -8,13 +8,13 @@ 已处理 <% elsif ma.status == 4 %> <% operator_message = AppliedMessage.where("applied_id=? and user_id=? and status = 4", ma.applied_id, ma.user_id).first %> - <% operator = User.find(operator_message.applied_user_id).show_name %> + <% operator = User.find(operator_message.applied_user_id).try(:show_name) %> <%= operator %>已拒绝 -<% elsif ma.status == 5 %> +<% elsif ma.status == 5 && !AppliedMessage.where("applied_id=? and user_id=? and status = 4", ma.applied_id, ma.applied_user_id).first.nil? %> <% operator_message = AppliedMessage.where("applied_id=? and user_id=? and status = 4", ma.applied_id, ma.applied_user_id).first %> - <% operator = User.find(operator_message.applied_user_id).show_name %> + <% operator = User.find(operator_message.applied_user_id).try(:show_name) %> <%= operator %>已拒绝 diff --git a/app/views/users/new_user_commit_homework.html.erb b/app/views/users/new_user_commit_homework.html.erb index 399eb4aae..3ac20f468 100644 --- a/app/views/users/new_user_commit_homework.html.erb +++ b/app/views/users/new_user_commit_homework.html.erb @@ -147,7 +147,7 @@
    <% if test.status.to_i == -2 %> -
    <%= test.results.first %>
    +
    <%= test.results.first.to_s.force_encoding("UTF-8") %>
    <% else %>
      diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index c5f8cf99f..0ade4b65e 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -6079,7 +6079,7 @@ _plugin('core', function(K) { // if (imglist.length > 0){ // df(self); // } - self.insertHtml(html, true); + self.insertHtml(html, true); // 火狐浏览器复制图片会出现2个 df(self); } K(doc.body).bind('paste', function(e){