diff --git a/app/controllers/admins/competition_stages_controller.rb b/app/controllers/admins/competition_stages_controller.rb index eb42efe84..4961192cd 100644 --- a/app/controllers/admins/competition_stages_controller.rb +++ b/app/controllers/admins/competition_stages_controller.rb @@ -67,13 +67,13 @@ class Admins::CompetitionStagesController < Admins::BaseController rescue Exception => e uid_logger_error(e.message) - render_error(e.message) + @message = "#{e.message}" end end - render_ok + @message = "计算成功" else - render_error("#{current_stage.name}还未结束") + @message = "#{current_stage.name}还未结束" end end diff --git a/app/views/admins/competition_settings/index.html.erb b/app/views/admins/competition_settings/index.html.erb index 1b5052018..9f9b15b6c 100644 --- a/app/views/admins/competition_settings/index.html.erb +++ b/app/views/admins/competition_settings/index.html.erb @@ -351,10 +351,10 @@ <%= agree_link '发送短信提醒', send_message_admins_competition_competition_stage_path(@competition, stage, element: ".send-message-#{stage.id}"), class: 'btn btn-outline-primary ml20', 'data-confirm': '确认执行发送短信操作?' %> <% end %> - <%# if stage.max_end_time && stage.max_end_time < Time.now && Time.now < Time.at(stage.max_end_time.to_i + 30*24*3600) %> + <% if stage.max_end_time && stage.max_end_time < Time.now && Time.now < Time.at(stage.max_end_time.to_i + 30*24*3600) %> <%= agree_link '计算成绩', calculate_stage_score_admins_competition_competition_stage_path(@competition, stage, element: ".calculate-score-#{stage.id}"), class: 'btn btn-outline-primary ml20', 'data-confirm': '确认执行计算成绩操作?' %> - <%# end %> + <% end %> <%= delete_link '删除', admins_competition_competition_stage_path(competition_id: @competition.id, id: stage.id), class: 'btn btn-default delete-stage ml20' %> 保存 diff --git a/app/views/admins/competition_stages/calculate_stage_score.js.erb b/app/views/admins/competition_stages/calculate_stage_score.js.erb new file mode 100644 index 000000000..cb7a93c09 --- /dev/null +++ b/app/views/admins/competition_stages/calculate_stage_score.js.erb @@ -0,0 +1 @@ +alert("<%= @message %>"); \ No newline at end of file