problem_set
parent
9f5c54a063
commit
2e1fafff4d
@ -0,0 +1,23 @@
|
|||||||
|
$(document).on('turbolinks:load', function(){
|
||||||
|
if ($('body.admins-competition-settings-index-page').length > 0) {
|
||||||
|
|
||||||
|
var baseOptions = {
|
||||||
|
autoclose: true,
|
||||||
|
language: 'zh-CN',
|
||||||
|
format: 'yyyy-mm-dd',
|
||||||
|
startDate: '2017-04-01',
|
||||||
|
endDate: '-1d'
|
||||||
|
};
|
||||||
|
|
||||||
|
var defineDateRangeSelect = function(element){
|
||||||
|
var options = $.extend({inputs: $(element).find('.start-date, .end-date')}, baseOptions);
|
||||||
|
$(element).datepicker(options);
|
||||||
|
|
||||||
|
$(element).find('.start-date').datepicker().on('changeDate', function(e){
|
||||||
|
$(element).find('.end-date').datepicker('setStartDate', e.date);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
defineDateRangeSelect('.teaching-mode-date');
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,21 @@
|
|||||||
|
.admins-competition-settings-index-page {
|
||||||
|
.competition-mode-container {
|
||||||
|
.row {
|
||||||
|
height: 35px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.des-row {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-control {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
//.mode-input {
|
||||||
|
// input {
|
||||||
|
// width: 40%;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
class MigrateCompetitionModeDefault < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
change_column_default :competitions, :mode, from: 0, to: 1
|
||||||
|
Competition.all.update_all(mode: 1)
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
class AddAwardsCountToCompetition < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
add_column :competitions, :awards_count, :integer, default: 0
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in new issue