Description:
wip
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r869:abb95edf0526 - - 5 files changed: 30 inserted, 31 deleted
@@ -75,7 +75,7 | |||||
|
75 | end |
|
75 | end |
|
76 | @problem.description = @description |
|
76 | @problem.description = @description |
|
77 | elsif @description |
|
77 | elsif @description |
|
78 |
- if !@description.update |
|
78 | + if !@description.update(description_params) |
|
79 | flash[:notice] = 'Error saving description' |
|
79 | flash[:notice] = 'Error saving description' |
|
80 | render :action => 'edit' and return |
|
80 | render :action => 'edit' and return |
|
81 | end |
|
81 | end |
@@ -84,7 +84,7 | |||||
|
84 | flash[:notice] = 'Error: Uploaded file is not PDF' |
|
84 | flash[:notice] = 'Error: Uploaded file is not PDF' |
|
85 | render :action => 'edit' and return |
|
85 | render :action => 'edit' and return |
|
86 | end |
|
86 | end |
|
87 |
- if @problem.update |
|
87 | + if @problem.update(problem_params) |
|
88 | flash[:notice] = 'Problem was successfully updated.' |
|
88 | flash[:notice] = 'Problem was successfully updated.' |
|
89 | unless params[:file] == nil or params[:file] == '' |
|
89 | unless params[:file] == nil or params[:file] == '' |
|
90 | flash[:notice] = 'Problem was successfully updated and a new PDF file is uploaded.' |
|
90 | flash[:notice] = 'Problem was successfully updated and a new PDF file is uploaded.' |
@@ -117,7 +117,7 | |||||
|
117 |
|
117 | ||
|
118 | def toggle |
|
118 | def toggle |
|
119 | @problem = Problem.find(params[:id]) |
|
119 | @problem = Problem.find(params[:id]) |
|
120 |
- @problem.update |
|
120 | + @problem.update(available: !(@problem.available) ) |
|
121 | respond_to do |format| |
|
121 | respond_to do |format| |
|
122 | format.js { } |
|
122 | format.js { } |
|
123 | end |
|
123 | end |
@@ -125,7 +125,7 | |||||
|
125 |
|
125 | ||
|
126 | def toggle_test |
|
126 | def toggle_test |
|
127 | @problem = Problem.find(params[:id]) |
|
127 | @problem = Problem.find(params[:id]) |
|
128 |
- @problem.update |
|
128 | + @problem.update(test_allowed: !(@problem.test_allowed?) ) |
|
129 | respond_to do |format| |
|
129 | respond_to do |format| |
|
130 | format.js { } |
|
130 | format.js { } |
|
131 | end |
|
131 | end |
@@ -133,7 +133,7 | |||||
|
133 |
|
133 | ||
|
134 | def toggle_view_testcase |
|
134 | def toggle_view_testcase |
|
135 | @problem = Problem.find(params[:id]) |
|
135 | @problem = Problem.find(params[:id]) |
|
136 |
- @problem.update |
|
136 | + @problem.update(view_testcase: !(@problem.view_testcase?) ) |
|
137 | respond_to do |format| |
|
137 | respond_to do |format| |
|
138 | format.js { } |
|
138 | format.js { } |
|
139 | end |
|
139 | end |
@@ -10,7 +10,7 | |||||
|
10 | %ul.navbar-nav.me-auto.mb-2.mb-lg-0 |
|
10 | %ul.navbar-nav.me-auto.mb-2.mb-lg-0 |
|
11 | / submission |
|
11 | / submission |
|
12 | - if (@current_user!=nil) and (GraderConfiguration.show_tasks_to?(@current_user)) |
|
12 | - if (@current_user!=nil) and (GraderConfiguration.show_tasks_to?(@current_user)) |
|
13 | - %li.nav-item.dropdown |
|
13 | + %li.nav-item.dropdown.mx-2 |
|
14 | %a.nav-link.dropdown-toggle{href: '#', 'data-bs': {toggle:'dropdown'}, aria: {expanded:"false"}, role: "button"} |
|
14 | %a.nav-link.dropdown-toggle{href: '#', 'data-bs': {toggle:'dropdown'}, aria: {expanded:"false"}, role: "button"} |
|
15 | = "#{I18n.t 'menu.submissions'}" |
|
15 | = "#{I18n.t 'menu.submissions'}" |
|
16 | %ul.dropdown-menu |
|
16 | %ul.dropdown-menu |
@@ -18,23 +18,23 | |||||
|
18 | %li= link_to 'Self Test', test_index_path, class:'dropdown-item' |
|
18 | %li= link_to 'Self Test', test_index_path, class:'dropdown-item' |
|
19 | / hall of fame |
|
19 | / hall of fame |
|
20 | - if GraderConfiguration['right.user_hall_of_fame'] |
|
20 | - if GraderConfiguration['right.user_hall_of_fame'] |
|
21 |
- = |
|
21 | + %li= link_to "#{I18n.t 'menu.hall_of_fame'}", problem_hof_report_path, class: 'nav-link mx-2' |
|
22 | / display MODE button (with countdown in contest mode) |
|
22 | / display MODE button (with countdown in contest mode) |
|
23 | - if GraderConfiguration.analysis_mode? |
|
23 | - if GraderConfiguration.analysis_mode? |
|
24 |
- %div |
|
24 | + %div.btn.btn-success#countdown= "ANALYSIS MODE" |
|
25 | - elsif GraderConfiguration.time_limit_mode? |
|
25 | - elsif GraderConfiguration.time_limit_mode? |
|
26 | - if @current_user.contest_finished? |
|
26 | - if @current_user.contest_finished? |
|
27 |
- %div |
|
27 | + %div.btn.btn-danger#countdown= "Contest is over" |
|
28 | - elsif !@current_user.contest_started? |
|
28 | - elsif !@current_user.contest_started? |
|
29 |
- %div |
|
29 | + %div.btn.btn-primary#countdown= (t 'title_bar.contest_not_started') |
|
30 | - else |
|
30 | - else |
|
31 |
- %div |
|
31 | + %div.btn.btn-primary#countdown asdf |
|
32 | :javascript |
|
32 | :javascript |
|
33 | $("#countdown").countdown({until: "+#{@current_user.contest_time_left.to_i}s", layout: 'Time left: {hnn}:{mnn}:{snn}'}); |
|
33 | $("#countdown").countdown({until: "+#{@current_user.contest_time_left.to_i}s", layout: 'Time left: {hnn}:{mnn}:{snn}'}); |
|
34 | / admin section |
|
34 | / admin section |
|
35 | - if (@current_user!=nil) and (session[:admin]) |
|
35 | - if (@current_user!=nil) and (session[:admin]) |
|
36 | / management |
|
36 | / management |
|
37 | - %li.nav-item.dropdown |
|
37 | + %li.nav-item.dropdown.mx-2 |
|
38 | %a.nav-link.dropdown-toggle{href: '#', 'data-bs': {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"} |
|
38 | %a.nav-link.dropdown-toggle{href: '#', 'data-bs': {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"} |
|
39 | Manage |
|
39 | Manage |
|
40 | %ul.dropdown-menu |
|
40 | %ul.dropdown-menu |
@@ -54,7 +54,7 | |||||
|
54 | %li= link_to 'Contests', contest_management_index_path, class: 'dropdown-item' |
|
54 | %li= link_to 'Contests', contest_management_index_path, class: 'dropdown-item' |
|
55 | -# |
|
55 | -# |
|
56 | / report |
|
56 | / report |
|
57 | - %li.nav-item.dropdown |
|
57 | + %li.nav-item.dropdown.mx-2 |
|
58 | %a.nav-link.dropdown-toggle{href: '#', 'data-bs': {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"} |
|
58 | %a.nav-link.dropdown-toggle{href: '#', 'data-bs': {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"} |
|
59 | Report |
|
59 | Report |
|
60 | %ul.dropdown-menu |
|
60 | %ul.dropdown-menu |
@@ -1,4 +1,4 | |||||
|
1 |
- = form_ |
|
1 | + = form_with url: submit_main_path, multipart: true, class: 'form' do |form| |
|
2 | - if @submission and @submission.errors.any? |
|
2 | - if @submission and @submission.errors.any? |
|
3 | #error_explanation |
|
3 | #error_explanation |
|
4 | .alert.alert-danger |
|
4 | .alert.alert-danger |
@@ -6,15 +6,14 | |||||
|
6 | %ul |
|
6 | %ul |
|
7 | - @submission.errors.full_messages.each do |msg| |
|
7 | - @submission.errors.full_messages.each do |msg| |
|
8 | %li= msg |
|
8 | %li= msg |
|
9 | - .form-group |
|
9 | + .row.mb-2 |
|
10 | - = label_tag :submission, 'Problem:' |
|
10 | + .col-sm-2 |
|
11 | - = select 'submission', 'problem_id', [[(t 'main.specified_in_header'),'-1']] + @problems.collect {|p| ["[#{p.name}] #{p.full_name}", p.id]}, {:selected => '-1'}, { class: 'select2 form-control', style: "width: 100%" } |
|
11 | + = form.label :submission, 'Problem:', class: 'form-label' |
|
12 | - .form-group |
|
12 | + .col-sm-10 |
|
13 | - = label_tag :file, 'File:' |
|
13 | + = select 'submission', 'problem_id', [[(t 'main.specified_in_header'),'-1']] + @problems.collect {|p| ["[#{p.name}] #{p.full_name}", p.id]}, {:selected => '-1'}, { class: 'select2 form-control', style: "width: 100%" } |
|
14 | - .input-group |
|
14 | + .row.mb-2 |
|
15 | - %span.input-group-btn |
|
15 | + .col-sm-2 |
|
16 | - %span.btn.btn-default.btn-file |
|
16 | + = form.label :file, 'File:', class: 'form-label' |
|
17 | - Browse |
|
17 | + .col-sm-10 |
|
18 | - = file_field_tag 'file' |
|
18 | + = form.file_field :file, class: 'form-control' |
|
19 | - = text_field_tag '' , nil, {readonly: true, class: 'form-control'} |
|
19 | + = form.submit 'Submit', class: 'btn btn-primary' |
|
20 | - = submit_tag 'Submit', class: 'btn btn-default' |
|
@@ -13,11 +13,11 | |||||
|
13 | .row |
|
13 | .row |
|
14 | .col-md-7 |
|
14 | .col-md-7 |
|
15 | - if GraderConfiguration.show_submitbox_to?(@user) |
|
15 | - if GraderConfiguration.show_submitbox_to?(@user) |
|
16 |
- . |
|
16 | + .card.border-primary |
|
17 | - .panel-heading |
|
17 | + .card-header.text-bg-primary |
|
18 | Submission |
|
18 | Submission |
|
19 |
- . |
|
19 | + .card-body |
|
20 |
- = render |
|
20 | + = render 'submission_box' |
|
21 | - if GraderConfiguration.show_tasks_to?(@user) |
|
21 | - if GraderConfiguration.show_tasks_to?(@user) |
|
22 | - if not GraderConfiguration.multicontests? |
|
22 | - if not GraderConfiguration.multicontests? |
|
23 | %table.table.table-striped.table-condensed |
|
23 | %table.table.table-striped.table-condensed |
You need to be logged in to leave comments.
Login now