Description:
wip
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r869:abb95edf0526 - - 5 files changed: 30 inserted, 31 deleted

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