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

r872:17032a7943cf - - 13 files changed: 33 inserted, 75 deleted

@@ -87,10 +87,7
87 #gem 'will_paginate', '~> 3.0.7'
87 #gem 'will_paginate', '~> 3.0.7'
88
88
89 gem 'mail'
89 gem 'mail'
90 - gem 'rdiscount'
90 + gem 'rdiscount' #markdown
91 - gem 'dynamic_form'
92 - gem 'in_place_editing'
93 - #gem 'verification', :git => 'https://github.com/sikachu/verification.git'
94
91
95
92
96 #---------------- testiing -----------------------
93 #---------------- testiing -----------------------
@@ -118,7 +118,6
118 concurrent-ruby (1.1.10)
118 concurrent-ruby (1.1.10)
119 crass (1.0.6)
119 crass (1.0.6)
120 digest (3.1.0)
120 digest (3.1.0)
121 - dynamic_form (1.1.4)
122 erubi (1.11.0)
121 erubi (1.11.0)
123 erubis (2.7.0)
122 erubis (2.7.0)
124 execjs (2.8.1)
123 execjs (2.8.1)
@@ -307,7 +306,6
307 byebug
306 byebug
308 capybara
307 capybara
309 coffee-rails
308 coffee-rails
310 - dynamic_form
311 fuzzy-string-match
309 fuzzy-string-match
312 haml
310 haml
313 haml-rails
311 haml-rails
@@ -3,6 +3,14
3 top: 50px;
3 top: 50px;
4 }
4 }
5
5
6 +
7 + //for google material design
8 + .mi-bs {
9 + vertical-align: middle;
10 + position: relative;
11 + top: -3px;
12 + }
13 +
6 // --------------- bootstrap file upload ----------------------
14 // --------------- bootstrap file upload ----------------------
7 .btn-file {
15 .btn-file {
8 position: relative;
16 position: relative;
@@ -2,8 +2,6
2
2
3 before_action :admin_authorization
3 before_action :admin_authorization
4
4
5 - in_place_edit_for :announcement, :published
6 -
7 # GET /announcements
5 # GET /announcements
8 # GET /announcements.xml
6 # GET /announcements.xml
9 def index
7 def index
@@ -89,7 +87,7
89
87
90 def toggle_front
88 def toggle_front
91 @announcement = Announcement.find(params[:id])
89 @announcement = Announcement.find(params[:id])
92 - @announcement.update_attributes( frontpage: !@announcement.frontpage? )
90 + @announcement.update( frontpage: !@announcement.frontpage? )
93 respond_to do |format|
91 respond_to do |format|
94 format.js { render partial: 'toggle_button',
92 format.js { render partial: 'toggle_button',
95 locals: {button_id: "#announcement_toggle_front_#{@announcement.id}",button_on: @announcement.frontpage? } }
93 locals: {button_id: "#announcement_toggle_front_#{@announcement.id}",button_on: @announcement.frontpage? } }
@@ -5,10 +5,6
5 authorization_by_roles(['admin','ta'])
5 authorization_by_roles(['admin','ta'])
6 end
6 end
7
7
8 - in_place_edit_for :problem, :name
9 - in_place_edit_for :problem, :full_name
10 - in_place_edit_for :problem, :full_score
11 -
12 def index
8 def index
13 @problems = Problem.order(date_added: :desc)
9 @problems = Problem.order(date_added: :desc)
14 end
10 end
@@ -112,10 +112,10
112 end
112 end
113
113
114 def toggle_button(on,toggle_url,id, option={})
114 def toggle_button(on,toggle_url,id, option={})
115 - btn_size = option[:size] || 'btn-xs'
115 + btn_size = option[:size] || 'btn-sm'
116 btn_block = option[:block] || 'btn-block'
116 btn_block = option[:block] || 'btn-block'
117 link_to (on ? "Yes" : "No"), toggle_url,
117 link_to (on ? "Yes" : "No"), toggle_url,
118 - {class: "btn #{btn_block} #{btn_size} btn-#{on ? 'success' : 'default'} ajax-toggle",
118 + {class: "btn #{btn_block} #{btn_size} btn-#{on ? 'success' : 'outline-secondary'} ajax-toggle",
119 id: id,
119 id: id,
120 data: {remote: true, method: 'get'}}
120 data: {remote: true, method: 'get'}}
121 end
121 end
@@ -4,42 +4,3
4 = link_to t(:back), announcements_path, class: 'card-link btn btn-secondary'
4 = link_to t(:back), announcements_path, class: 'card-link btn btn-secondary'
5
5
6 = render 'form'
6 = render 'form'
7 - -# old style
8 - .container-fluid
9 - %h1 Editing announcement
10 - = error_messages_for :announcement
11 - .row
12 - .col-md-6
13 - = form_for(@announcement) do |f|
14 - .form-group
15 - %label Title
16 - = f.text_field :title, class: 'form-control'
17 - .form-group
18 - %label Notes
19 - (shown internally, used to organize announcements)
20 - = f.text_field :notes, class: 'form-control'
21 - .form-group
22 - %label Body
23 - = f.text_area :body, class: 'form-control', style: 'height: 200px;'
24 - .form-group
25 - %label Author
26 - = f.text_field :author, class: 'form-control'
27 - .checkbox
28 - %label
29 - = f.check_box :published
30 - Published
31 - .checkbox
32 - %label
33 - = f.check_box :frontpage
34 - Show on front page?
35 - .checkbox
36 - %label
37 - = f.check_box :on_nav_bar
38 - Show on top menu bar?
39 - .checkbox
40 - %label
41 - = f.check_box :contest_only
42 - Show only in contest?
43 - = f.submit "Update", class: 'btn btn-primary'
44 - = link_to 'Show', @announcement, class: 'btn btn-default'
45 - = link_to 'Back', announcements_path, class: 'btn btn-default'
@@ -1,7 +1,7
1 :plain
1 :plain
2 var t = $("#{button_id}");
2 var t = $("#{button_id}");
3 - t.removeClass('btn-default');
3 + t.removeClass('btn-outline-secondary');
4 t.removeClass('btn-success');
4 t.removeClass('btn-success');
5 t.removeClass('btn-warning');
5 t.removeClass('btn-warning');
6 - t.addClass("btn-#{button_on ? 'success' : 'default'}");
6 + t.addClass("btn-#{button_on ? 'success' : 'outline-secondary'}");
7 t.text("#{button_on ? 'Yes' : 'No'}");
7 t.text("#{button_on ? 'Yes' : 'No'}");
@@ -2,7 +2,7
2 %nav.navbar.fixed-top.navbar-dark.bg-primary.navbar-expand-lg
2 %nav.navbar.fixed-top.navbar-dark.bg-primary.navbar-expand-lg
3 .container-fluid
3 .container-fluid
4 %a.navbar-brand{href: list_main_path}
4 %a.navbar-brand{href: list_main_path}
5 - %span.glyphicon.glyphicon-home
5 + %span.mi.mi-bs home
6 MAIN
6 MAIN
7 %button.navbar-toggler.collapsed{ type: :button, 'data-bs': {toggle: 'collapse', target: '#navbar-collapse'} }
7 %button.navbar-toggler.collapsed{ type: :button, 'data-bs': {toggle: 'collapse', target: '#navbar-collapse'} }
8 %span.navbar-toggler-icon
8 %span.navbar-toggler-icon
@@ -73,15 +73,15
73 %ul.navbar-nav
73 %ul.navbar-nav
74 %li.nav-item
74 %li.nav-item
75 %a.nav-link{href: help_main_path}
75 %a.nav-link{href: help_main_path}
76 - %span.mi.md-18 help
76 + %span.mi.mi-bs.md-18 help
77 %li.nav-item
77 %li.nav-item
78 %a.nav-link{href: messages_path}
78 %a.nav-link{href: messages_path}
79 - %span.mi.md-18 chat
79 + %span.mi.mi-bs.md-18 chat
80 - if GraderConfiguration['system.user_setting_enabled']
80 - if GraderConfiguration['system.user_setting_enabled']
81 %li.nav-item
81 %li.nav-item
82 %a.nav-link{href: profile_users_path}
82 %a.nav-link{href: profile_users_path}
83 - %span.mi.md-18 settings
83 + %span.mi.mi-bs.md-18 settings
84 %li.nav-item
84 %li.nav-item
85 %a.nav-link{href: login_main_path}
85 %a.nav-link{href: login_main_path}
86 - %span.mi.md-18 exit_to_app
86 + %span.mi.mi-bs.md-18 exit_to_app
87 = @current_user.full_name
87 = @current_user.full_name
@@ -8,12 +8,12
8 %li= msg
8 %li= msg
9 .row.mb-2
9 .row.mb-2
10 .col-sm-2
10 .col-sm-2
11 - = form.label :submission, 'Problem:', class: 'form-label'
11 + = form.label :submission, 'Problem:', class: 'col-form-label'
12 .col-sm-10
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%" }
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
14 .row.mb-2
15 .col-sm-2
15 .col-sm-2
16 - = form.label :file, 'File:', class: 'form-label'
16 + = form.label :file, 'File:', class: 'col-form-label'
17 .col-sm-10
17 .col-sm-10
18 = form.file_field :file, class: 'form-control'
18 = form.file_field :file, class: 'form-control'
19 = form.submit 'Submit', class: 'btn btn-primary'
19 = form.submit 'Submit', class: 'btn btn-primary'
@@ -38,7 +38,7
38 - if GraderConfiguration.multicontests?
38 - if GraderConfiguration.multicontests?
39 %th Contests
39 %th Contests
40 - for problem in @problems
40 - for problem in @problems
41 - %tr{:class => "#{(problem.available) ? "success" : "danger"}", :id => "prob-#{problem.id}", :name => "prob-#{problem.id}"}
41 + %tr{:class => "#{(problem.available) ? "bg-success bg-opacity-25" : "bg-opacity-25"}", :id => "prob-#{problem.id}", :name => "prob-#{problem.id}"}
42 - @problem=problem
42 - @problem=problem
43 %td= problem.name #in_place_editor_field :problem, :name, {}, :rows=>1
43 %td= problem.name #in_place_editor_field :problem, :name, {}, :rows=>1
44 %td
44 %td
@@ -47,9 +47,9
47 %td.text-right= problem.full_score #in_place_editor_field :problem, :full_score, {}, :rows=>1
47 %td.text-right= problem.full_score #in_place_editor_field :problem, :full_score, {}, :rows=>1
48 %td
48 %td
49 - problem.tags.each do |t|
49 - problem.tags.each do |t|
50 - - #%button.btn.btn-default.btn-xs= t.name
50 + - #%button.btn.btn-default.btn-sm= t.name
51 %span.label.label-default= t.name
51 %span.label.label-default= t.name
52 - %td= link_to "Submit", direct_edit_problem_submissions_path(problem,@current_user.id), class: 'btn btn-xs btn-primary'
52 + %td= link_to "Submit", direct_edit_problem_submissions_path(problem,@current_user.id), class: 'btn btn-sm btn-primary'
53 %td= problem.date_added
53 %td= problem.date_added
54 %td= toggle_button(@problem.available?, toggle_problem_path(@problem), "problem-avail-#{@problem.id}")
54 %td= toggle_button(@problem.available?, toggle_problem_path(@problem), "problem-avail-#{@problem.id}")
55 %td= toggle_button(@problem.view_testcase?, toggle_view_testcase_problem_path(@problem), "problem-view-testcase-#{@problem.id}")
55 %td= toggle_button(@problem.view_testcase?, toggle_view_testcase_problem_path(@problem), "problem-view-testcase-#{@problem.id}")
@@ -57,9 +57,9
57 - if GraderConfiguration.multicontests?
57 - if GraderConfiguration.multicontests?
58 %td
58 %td
59 = problem.contests.collect { |c| c.name }.join(', ')
59 = problem.contests.collect { |c| c.name }.join(', ')
60 - %td= link_to 'Stat', {:action => 'stat', :id => problem.id}, class: 'btn btn-info btn-xs btn-block'
60 + %td= link_to 'Stat', {:action => 'stat', :id => problem.id}, class: 'btn btn-info btn-sm btn-block'
61 - %td= link_to 'Show', {:action => 'show', :id => problem}, class: 'btn btn-info btn-xs btn-block'
61 + %td= link_to 'Show', {:action => 'show', :id => problem}, class: 'btn btn-info btn-sm btn-block'
62 - %td= link_to 'Edit', {:action => 'edit', :id => problem}, class: 'btn btn-info btn-xs btn-block'
62 + %td= link_to 'Edit', {:action => 'edit', :id => problem}, class: 'btn btn-info btn-sm btn-block'
63 - %td= link_to 'Destroy', { :action => 'destroy', :id => problem }, :confirm => 'Are you sure?', :method => :delete, class: 'btn btn-danger btn-xs btn-block'
63 + %td= link_to 'Destroy', { :action => 'destroy', :id => problem }, :confirm => 'Are you sure?', :method => :delete, class: 'btn btn-danger btn-sm btn-block'
64 %br/
64 %br/
65 = link_to '[New problem]', :action => 'new'
65 = link_to '[New problem]', :action => 'new'
@@ -2,7 +2,7
2 locals: {button_id: "#problem-avail-#{@problem.id}",button_on: @problem.available }
2 locals: {button_id: "#problem-avail-#{@problem.id}",button_on: @problem.available }
3 :plain
3 :plain
4 r = $("#prob-#{@problem.id}");
4 r = $("#prob-#{@problem.id}");
5 - r.removeClass('success');
5 + r.removeClass('bg-success');
6 - r.removeClass('danger');
6 + r.removeClass('bg-danger');
7 - r.addClass("#{@problem.available? ? 'success' : 'danger'}");
7 + r.addClass("#{@problem.available? ? 'bg-success' : 'bg-danger-'}");
8
8
@@ -4,8 +4,8
4 /navbar
4 /navbar
5 %ul.nav.nav-pills{role: :tablist}
5 %ul.nav.nav-pills{role: :tablist}
6 - @problem.testcases.each.with_index do |tc,id|
6 - @problem.testcases.each.with_index do |tc,id|
7 - %li{role: :presentation, class: ('active' if id == 0)}
7 + %li.nav-item{role: :presentation, class: ('active' if id == 0)}
8 - %a{href:"#tc#{tc.id}", role: 'tab', data: {toggle: 'tab'}}= tc.num
8 + %a.nav-link{href:"#tc#{tc.id}", role: 'tab', 'data-bs': {toggle: 'tab', target: "#tc#{tc.id}"}}= tc.num
9
9
10 /actual data
10 /actual data
11 .tab-content
11 .tab-content
You need to be logged in to leave comments. Login now