diff --git a/app/assets/javascripts/admins/competitions/index.js b/app/assets/javascripts/admins/competitions/index.js new file mode 100644 index 000000000..ae4593d33 --- /dev/null +++ b/app/assets/javascripts/admins/competitions/index.js @@ -0,0 +1,11 @@ +$(document).on('turbolinks:load', function() { + if ($('body.admins-competitions-index-page').length > 0) { + $('.modal.admin-upload-file-modal').on('upload:success', function(e, data){ + var $imageElement = $('.competition-image-' + data.source_id); + $imageElement.attr('src', data.url); + $imageElement.show(); + $imageElement.next().html('重新上传'); + }) + } +}); + diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 60cf2d6c5..168d05299 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -1058,8 +1058,8 @@ class HomeworkCommonsController < ApplicationController tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if @course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day) else + tip_exception("缺少分班截止时间参数") if params[:group_end_times].blank? group_end_times = params[:group_end_times].reject(&:blank?).map{|time| time.to_time} - tip_exception("缺少截止时间参数") if group_end_times.blank? tip_exception("截止时间和分班参数的个数不一致") if group_end_times.length != group_ids.length group_end_times.each do |time| tip_exception("分班截止时间不能早于当前时间") if time <= Time.now diff --git a/app/views/admins/competition_settings/show.html.erb b/app/views/admins/competition_settings/show.html.erb index e69de29bb..8249f2737 100644 --- a/app/views/admins/competition_settings/show.html.erb +++ b/app/views/admins/competition_settings/show.html.erb @@ -0,0 +1,9 @@ +<% + define_admin_breadcrumbs do + add_admin_breadcrumb('竞赛列表', admins_competitions_path) + add_admin_breadcrumb(@competition.name) + end +%> + + + diff --git a/config/admins/sidebar.yml b/config/admins/sidebar.yml index 71e77e218..b722f2505 100644 --- a/config/admins/sidebar.yml +++ b/config/admins/sidebar.yml @@ -1,3 +1,4 @@ admins-mirror_scripts: 'admins-mirror_repositories' admins-laboratory_settings: 'admins-laboratories' -admins-carousels: 'admins-laboratories' \ No newline at end of file +admins-carousels: 'admins-laboratories' +admins-competition_settings: 'admins-competitions' \ No newline at end of file