diff --git a/app/controllers/problems_controller.rb b/app/controllers/problems_controller.rb --- a/app/controllers/problems_controller.rb +++ b/app/controllers/problems_controller.rb @@ -187,7 +187,7 @@ end def do_manage - if params.has_key? 'change_date_added' + if params.has_key? 'change_date_added' and params[:date_added].strip.empty? == false change_date_added elsif params.has_key? 'add_to_contest' add_to_contest diff --git a/app/controllers/report_controller.rb b/app/controllers/report_controller.rb --- a/app/controllers/report_controller.rb +++ b/app/controllers/report_controller.rb @@ -43,7 +43,7 @@ end #users - @users = if params[:user] == "all" then + @users = if params[:users] == "all" then User.includes(:contests).includes(:contest_stat) else User.includes(:contests).includes(:contest_stat).where(enabled: true) diff --git a/app/models/submission.rb b/app/models/submission.rb --- a/app/models/submission.rb +++ b/app/models/submission.rb @@ -8,7 +8,7 @@ before_validation :assign_language validates_presence_of :source - validates_length_of :source, :maximum => 100_000, :allow_blank => true, :message => 'too long' + validates_length_of :source, :maximum => 100_000, :allow_blank => true, :message => 'code too long, the limit is 100,000 bytes' validates_length_of :source, :minimum => 1, :allow_blank => true, :message => 'too short' validate :must_have_valid_problem validate :must_specify_language diff --git a/app/views/problems/manage.html.haml b/app/views/problems/manage.html.haml --- a/app/views/problems/manage.html.haml +++ b/app/views/problems/manage.html.haml @@ -110,6 +110,7 @@ $('.input-group.date').datetimepicker({ format: 'DD/MMM/YYYY', showTodayButton: true, + locale: 'en', widgetPositioning: {horizontal: 'auto', vertical: 'bottom'}, }); diff --git a/app/views/sites/edit.html.haml b/app/views/sites/edit.html.haml --- a/app/views/sites/edit.html.haml +++ b/app/views/sites/edit.html.haml @@ -31,6 +31,7 @@ :javascript $('.input-group.date').datetimepicker({ format: 'DD/MMM/YYYY HH:mm', + locale: 'en', showTodayButton: true, }); diff --git a/db/migrate/20180612102327_change_submission_source_size.rb b/db/migrate/20180612102327_change_submission_source_size.rb new file mode 100644 --- /dev/null +++ b/db/migrate/20180612102327_change_submission_source_size.rb @@ -0,0 +1,5 @@ +class ChangeSubmissionSourceSize < ActiveRecord::Migration + def change + change_column :submissions, :source, :text, :limit => 1.megabyte + end +end diff --git a/db/schema.rb b/db/schema.rb --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20170914150742) do +ActiveRecord::Schema.define(version: 20180612102327) do create_table "announcements", force: :cascade do |t| t.string "author", limit: 255 @@ -209,7 +209,7 @@ t.integer "user_id", limit: 4 t.integer "problem_id", limit: 4 t.integer "language_id", limit: 4 - t.text "source", limit: 65535 + t.text "source", limit: 16777215 t.binary "binary", limit: 65535 t.datetime "submitted_at" t.datetime "compiled_at"