Description:
remove unnecessary gems
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r872:17032a7943cf - - 13 files changed: 33 inserted, 75 deleted
@@ -78,28 +78,25 | |||
|
78 | 78 | #gem 'jquery-datatables-rails' |
|
79 | 79 | |
|
80 | 80 | #----------- user interface ----------------- |
|
81 | 81 | gem 'simple_form' |
|
82 | 82 | #select 2 |
|
83 | 83 | #gem 'select2-rails' |
|
84 | 84 | #ace editor |
|
85 | 85 | gem 'ace-rails-ap' |
|
86 | 86 | #paginator |
|
87 | 87 | #gem 'will_paginate', '~> 3.0.7' |
|
88 | 88 | |
|
89 | 89 | gem 'mail' |
|
90 | - gem 'rdiscount' | |
|
91 | - gem 'dynamic_form' | |
|
92 | - gem 'in_place_editing' | |
|
93 | - #gem 'verification', :git => 'https://github.com/sikachu/verification.git' | |
|
90 | + gem 'rdiscount' #markdown | |
|
94 | 91 | |
|
95 | 92 | |
|
96 | 93 | #---------------- testiing ----------------------- |
|
97 | 94 | gem 'minitest-reporters' |
|
98 | 95 | |
|
99 | 96 | #---------------- for console -------------------- |
|
100 | 97 | gem 'fuzzy-string-match' |
|
101 | 98 | |
|
102 | 99 | |
|
103 | 100 | group :development, :test do |
|
104 | 101 | # Call 'byebug' anywhere in the code to stop execution and get a debugger console |
|
105 | 102 | gem 'byebug' |
@@ -109,25 +109,24 | |||
|
109 | 109 | xpath (~> 3.2) |
|
110 | 110 | childprocess (4.1.0) |
|
111 | 111 | coffee-rails (5.0.0) |
|
112 | 112 | coffee-script (>= 2.2.0) |
|
113 | 113 | railties (>= 5.2.0) |
|
114 | 114 | coffee-script (2.4.1) |
|
115 | 115 | coffee-script-source |
|
116 | 116 | execjs |
|
117 | 117 | coffee-script-source (1.12.2) |
|
118 | 118 | concurrent-ruby (1.1.10) |
|
119 | 119 | crass (1.0.6) |
|
120 | 120 | digest (3.1.0) |
|
121 | - dynamic_form (1.1.4) | |
|
122 | 121 | erubi (1.11.0) |
|
123 | 122 | erubis (2.7.0) |
|
124 | 123 | execjs (2.8.1) |
|
125 | 124 | ffi (1.15.5) |
|
126 | 125 | fuzzy-string-match (1.0.1) |
|
127 | 126 | RubyInline (>= 3.8.6) |
|
128 | 127 | globalid (1.0.0) |
|
129 | 128 | activesupport (>= 5.0) |
|
130 | 129 | haml (5.2.2) |
|
131 | 130 | temple (>= 0.8.0) |
|
132 | 131 | tilt |
|
133 | 132 | haml-rails (2.0.1) |
@@ -298,25 +297,24 | |||
|
298 | 297 | PLATFORMS |
|
299 | 298 | x86_64-linux |
|
300 | 299 | |
|
301 | 300 | DEPENDENCIES |
|
302 | 301 | ace-rails-ap |
|
303 | 302 | activerecord-session_store |
|
304 | 303 | best_in_place! |
|
305 | 304 | bootsnap |
|
306 | 305 | bootstrap (~> 5.2) |
|
307 | 306 | byebug |
|
308 | 307 | capybara |
|
309 | 308 | coffee-rails |
|
310 | - dynamic_form | |
|
311 | 309 | fuzzy-string-match |
|
312 | 310 | haml |
|
313 | 311 | haml-rails |
|
314 | 312 | importmap-rails (~> 1.1) |
|
315 | 313 | in_place_editing |
|
316 | 314 | jbuilder |
|
317 | 315 | jquery-rails |
|
318 | 316 | listen (>= 3.0.5, < 3.2) |
|
319 | 317 | |
|
320 | 318 | material_icons |
|
321 | 319 | minitest-reporters |
|
322 | 320 | momentjs-rails |
@@ -1,17 +1,25 | |||
|
1 | 1 | |
|
2 | 2 | .secondnavbar { |
|
3 | 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 | 14 | // --------------- bootstrap file upload ---------------------- |
|
7 | 15 | .btn-file { |
|
8 | 16 | position: relative; |
|
9 | 17 | overflow: hidden; |
|
10 | 18 | } |
|
11 | 19 | |
|
12 | 20 | .btn-file input[type=file] { |
|
13 | 21 | position: absolute; |
|
14 | 22 | top: 0; |
|
15 | 23 | right: 0; |
|
16 | 24 | min-width: 100%; |
|
17 | 25 | min-height: 100%; |
@@ -1,18 +1,16 | |||
|
1 | 1 | class AnnouncementsController < ApplicationController |
|
2 | 2 | |
|
3 | 3 | before_action :admin_authorization |
|
4 | 4 | |
|
5 | - in_place_edit_for :announcement, :published | |
|
6 | - | |
|
7 | 5 | # GET /announcements |
|
8 | 6 | # GET /announcements.xml |
|
9 | 7 | def index |
|
10 | 8 | @announcements = Announcement.order(created_at: :desc) |
|
11 | 9 | |
|
12 | 10 | respond_to do |format| |
|
13 | 11 | format.html # index.html.erb |
|
14 | 12 | format.xml { render :xml => @announcements } |
|
15 | 13 | end |
|
16 | 14 | end |
|
17 | 15 | |
|
18 | 16 | # GET /announcements/1 |
@@ -80,25 +78,25 | |||
|
80 | 78 | |
|
81 | 79 | def toggle |
|
82 | 80 | @announcement = Announcement.find(params[:id]) |
|
83 | 81 | @announcement.update( published: !@announcement.published? ) |
|
84 | 82 | respond_to do |format| |
|
85 | 83 | format.js { render partial: 'toggle_button', |
|
86 | 84 | locals: {button_id: "#announcement_toggle_#{@announcement.id}",button_on: @announcement.published? } } |
|
87 | 85 | end |
|
88 | 86 | end |
|
89 | 87 | |
|
90 | 88 | def toggle_front |
|
91 | 89 | @announcement = Announcement.find(params[:id]) |
|
92 |
- @announcement.update |
|
|
90 | + @announcement.update( frontpage: !@announcement.frontpage? ) | |
|
93 | 91 | respond_to do |format| |
|
94 | 92 | format.js { render partial: 'toggle_button', |
|
95 | 93 | locals: {button_id: "#announcement_toggle_front_#{@announcement.id}",button_on: @announcement.frontpage? } } |
|
96 | 94 | end |
|
97 | 95 | end |
|
98 | 96 | |
|
99 | 97 | # DELETE /announcements/1 |
|
100 | 98 | # DELETE /announcements/1.xml |
|
101 | 99 | def destroy |
|
102 | 100 | @announcement = Announcement.find(params[:id]) |
|
103 | 101 | @announcement.destroy |
|
104 | 102 |
@@ -1,23 +1,19 | |||
|
1 | 1 | class ProblemsController < ApplicationController |
|
2 | 2 | |
|
3 | 3 | before_action :admin_authorization, except: [:stat] |
|
4 | 4 | before_action only: [:stat] do |
|
5 | 5 | authorization_by_roles(['admin','ta']) |
|
6 | 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 | 8 | def index |
|
13 | 9 | @problems = Problem.order(date_added: :desc) |
|
14 | 10 | end |
|
15 | 11 | |
|
16 | 12 | |
|
17 | 13 | def show |
|
18 | 14 | @problem = Problem.find(params[:id]) |
|
19 | 15 | end |
|
20 | 16 | |
|
21 | 17 | def new |
|
22 | 18 | @problem = Problem.new |
|
23 | 19 | @description = nil |
@@ -103,28 +103,28 | |||
|
103 | 103 | st = time_ago_in_words(time) + ' ago (' + format_short_time(time) + ')' |
|
104 | 104 | end |
|
105 | 105 | |
|
106 | 106 | def read_textfile(fname,max_size=2048) |
|
107 | 107 | begin |
|
108 | 108 | File.open(fname).read(max_size) |
|
109 | 109 | rescue |
|
110 | 110 | nil |
|
111 | 111 | end |
|
112 | 112 | end |
|
113 | 113 | |
|
114 | 114 | def toggle_button(on,toggle_url,id, option={}) |
|
115 |
- btn_size = option[:size] || 'btn- |
|
|
115 | + btn_size = option[:size] || 'btn-sm' | |
|
116 | 116 | btn_block = option[:block] || 'btn-block' |
|
117 | 117 | link_to (on ? "Yes" : "No"), toggle_url, |
|
118 |
- {class: "btn #{btn_block} #{btn_size} btn-#{on ? 'success' : ' |
|
|
118 | + {class: "btn #{btn_block} #{btn_size} btn-#{on ? 'success' : 'outline-secondary'} ajax-toggle", | |
|
119 | 119 | id: id, |
|
120 | 120 | data: {remote: true, method: 'get'}} |
|
121 | 121 | end |
|
122 | 122 | |
|
123 | 123 | def get_ace_mode(language) |
|
124 | 124 | # return ace mode string from Language |
|
125 | 125 | |
|
126 | 126 | case language.pretty_name |
|
127 | 127 | when 'Pascal' |
|
128 | 128 | 'ace/mode/pascal' |
|
129 | 129 | when 'C++','C' |
|
130 | 130 | 'ace/mode/c_cpp' |
@@ -1,45 +1,6 | |||
|
1 | 1 | %h1 Edit Announcement |
|
2 | 2 | |
|
3 | 3 | -content_for(:form_buttons) do |
|
4 | 4 | = link_to t(:back), announcements_path, class: 'card-link btn btn-secondary' |
|
5 | 5 | |
|
6 | 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 | 1 | :plain |
|
2 | 2 | var t = $("#{button_id}"); |
|
3 |
- t.removeClass('btn- |
|
|
3 | + t.removeClass('btn-outline-secondary'); | |
|
4 | 4 | t.removeClass('btn-success'); |
|
5 | 5 | t.removeClass('btn-warning'); |
|
6 |
- t.addClass("btn-#{button_on ? 'success' : ' |
|
|
6 | + t.addClass("btn-#{button_on ? 'success' : 'outline-secondary'}"); | |
|
7 | 7 | t.text("#{button_on ? 'Yes' : 'No'}"); |
@@ -1,17 +1,17 | |||
|
1 | 1 | %header |
|
2 | 2 | %nav.navbar.fixed-top.navbar-dark.bg-primary.navbar-expand-lg |
|
3 | 3 | .container-fluid |
|
4 | 4 | %a.navbar-brand{href: list_main_path} |
|
5 |
- %span. |
|
|
5 | + %span.mi.mi-bs home | |
|
6 | 6 | MAIN |
|
7 | 7 | %button.navbar-toggler.collapsed{ type: :button, 'data-bs': {toggle: 'collapse', target: '#navbar-collapse'} } |
|
8 | 8 | %span.navbar-toggler-icon |
|
9 | 9 | .collapse.navbar-collapse#navbar-collapse |
|
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 | 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 |
|
17 | 17 | %li= link_to 'View', submissions_path, class:'dropdown-item' |
@@ -64,24 +64,24 | |||
|
64 | 64 | %li= link_to 'Login Report', login_report_path, class: 'dropdown-item' |
|
65 | 65 | - if (ungraded = Submission.where('graded_at is null').where('submitted_at < ?', 1.minutes.ago).count) > 0 |
|
66 | 66 | =link_to "#{ungraded} backlogs!", |
|
67 | 67 | graders_list_path, |
|
68 | 68 | class: 'navbar-btn btn btn-default btn-warning', data: {toggle: 'tooltip'},title: 'Number of ungraded submission' |
|
69 | 69 | / announcement |
|
70 | 70 | - @nav_announcement.each do |ann| |
|
71 | 71 | %p.navbar-text |
|
72 | 72 | = ann.body.html_safe |
|
73 | 73 | %ul.navbar-nav |
|
74 | 74 | %li.nav-item |
|
75 | 75 | %a.nav-link{href: help_main_path} |
|
76 | - %span.mi.md-18 help | |
|
76 | + %span.mi.mi-bs.md-18 help | |
|
77 | 77 | %li.nav-item |
|
78 | 78 | %a.nav-link{href: messages_path} |
|
79 | - %span.mi.md-18 chat | |
|
79 | + %span.mi.mi-bs.md-18 chat | |
|
80 | 80 | - if GraderConfiguration['system.user_setting_enabled'] |
|
81 | 81 | %li.nav-item |
|
82 | 82 | %a.nav-link{href: profile_users_path} |
|
83 | - %span.mi.md-18 settings | |
|
83 | + %span.mi.mi-bs.md-18 settings | |
|
84 | 84 | %li.nav-item |
|
85 | 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 | 87 | = @current_user.full_name |
@@ -1,19 +1,19 | |||
|
1 | 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 |
|
5 | 5 | %h3= "#{pluralize(@submission.errors.count, "error")} prohibited this user from being saved:" |
|
6 | 6 | %ul |
|
7 | 7 | - @submission.errors.full_messages.each do |msg| |
|
8 | 8 | %li= msg |
|
9 | 9 | .row.mb-2 |
|
10 | 10 | .col-sm-2 |
|
11 | - = form.label :submission, 'Problem:', class: 'form-label' | |
|
11 | + = form.label :submission, 'Problem:', class: 'col-form-label' | |
|
12 | 12 | .col-sm-10 |
|
13 | 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 | 14 | .row.mb-2 |
|
15 | 15 | .col-sm-2 |
|
16 | - = form.label :file, 'File:', class: 'form-label' | |
|
16 | + = form.label :file, 'File:', class: 'col-form-label' | |
|
17 | 17 | .col-sm-10 |
|
18 | 18 | = form.file_field :file, class: 'form-control' |
|
19 | 19 | = form.submit 'Submit', class: 'btn btn-primary' |
@@ -29,37 +29,37 | |||
|
29 | 29 | %th.text-center |
|
30 | 30 | Avail? |
|
31 | 31 | %sup{class: 'text-primary',data: {toggle: 'tooltip'}, title: 'Let user submits to this problem?' } [?] |
|
32 | 32 | %th.text-center |
|
33 | 33 | View Data? |
|
34 | 34 | %sup{class: 'text-primary',data: {toggle: 'tooltip'}, title: 'Let user view the testcase of this problem?' } [?] |
|
35 | 35 | %th.text-center |
|
36 | 36 | Test? |
|
37 | 37 | %sup{class: 'text-primary',data: {toggle: 'tooltip'}, title: 'Let user uses test interface on this problem?' } [?] |
|
38 | 38 | - if GraderConfiguration.multicontests? |
|
39 | 39 | %th Contests |
|
40 | 40 | - for problem in @problems |
|
41 |
- %tr{:class => "#{(problem.available) ? "success" : " |
|
|
41 | + %tr{:class => "#{(problem.available) ? "bg-success bg-opacity-25" : "bg-opacity-25"}", :id => "prob-#{problem.id}", :name => "prob-#{problem.id}"} | |
|
42 | 42 | - @problem=problem |
|
43 | 43 | %td= problem.name #in_place_editor_field :problem, :name, {}, :rows=>1 |
|
44 | 44 | %td |
|
45 | 45 | = problem.full_name #in_place_editor_field :problem, :full_name, {}, :rows=>1 |
|
46 | 46 | = link_to_description_if_any "[#{t 'main.problem_desc'}] <span class='glyphicon glyphicon-file'></span>".html_safe, problem |
|
47 | 47 | %td.text-right= problem.full_score #in_place_editor_field :problem, :full_score, {}, :rows=>1 |
|
48 | 48 | %td |
|
49 | 49 | - problem.tags.each do |t| |
|
50 |
- - #%button.btn.btn-default.btn- |
|
|
50 | + - #%button.btn.btn-default.btn-sm= t.name | |
|
51 | 51 | %span.label.label-default= t.name |
|
52 |
- %td= link_to "Submit", direct_edit_problem_submissions_path(problem,@current_user.id), class: 'btn btn- |
|
|
52 | + %td= link_to "Submit", direct_edit_problem_submissions_path(problem,@current_user.id), class: 'btn btn-sm btn-primary' | |
|
53 | 53 | %td= problem.date_added |
|
54 | 54 | %td= toggle_button(@problem.available?, toggle_problem_path(@problem), "problem-avail-#{@problem.id}") |
|
55 | 55 | %td= toggle_button(@problem.view_testcase?, toggle_view_testcase_problem_path(@problem), "problem-view-testcase-#{@problem.id}") |
|
56 | 56 | %td= toggle_button(@problem.test_allowed?, toggle_test_problem_path(@problem), "problem-test-#{@problem.id}") |
|
57 | 57 | - if GraderConfiguration.multicontests? |
|
58 | 58 | %td |
|
59 | 59 | = problem.contests.collect { |c| c.name }.join(', ') |
|
60 |
- %td= link_to 'Stat', {:action => 'stat', :id => problem.id}, class: 'btn btn-info btn- |
|
|
61 |
- %td= link_to 'Show', {:action => 'show', :id => problem}, class: 'btn btn-info btn- |
|
|
62 |
- %td= link_to 'Edit', {:action => 'edit', :id => problem}, class: 'btn btn-info btn- |
|
|
63 |
- %td= link_to 'Destroy', { :action => 'destroy', :id => problem }, :confirm => 'Are you sure?', :method => :delete, class: 'btn btn-danger btn- |
|
|
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-sm 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-sm btn-block' | |
|
64 | 64 | %br/ |
|
65 | 65 | = link_to '[New problem]', :action => 'new' |
@@ -1,8 +1,8 | |||
|
1 | 1 | = render partial: 'toggle_button', |
|
2 | 2 | locals: {button_id: "#problem-avail-#{@problem.id}",button_on: @problem.available } |
|
3 | 3 | :plain |
|
4 | 4 | r = $("#prob-#{@problem.id}"); |
|
5 | - r.removeClass('success'); | |
|
6 | - r.removeClass('danger'); | |
|
7 | - r.addClass("#{@problem.available? ? 'success' : 'danger'}"); | |
|
5 | + r.removeClass('bg-success'); | |
|
6 | + r.removeClass('bg-danger'); | |
|
7 | + r.addClass("#{@problem.available? ? 'bg-success' : 'bg-danger-'}"); | |
|
8 | 8 |
@@ -1,20 +1,20 | |||
|
1 | 1 | %h1 Test cases |
|
2 | 2 | %h2= @problem.long_name |
|
3 | 3 | |
|
4 | 4 | /navbar |
|
5 | 5 | %ul.nav.nav-pills{role: :tablist} |
|
6 | 6 | - @problem.testcases.each.with_index do |tc,id| |
|
7 | - %li{role: :presentation, class: ('active' if id == 0)} | |
|
8 | - %a{href:"#tc#{tc.id}", role: 'tab', data: {toggle: 'tab'}}= tc.num | |
|
7 | + %li.nav-item{role: :presentation, class: ('active' if id == 0)} | |
|
8 | + %a.nav-link{href:"#tc#{tc.id}", role: 'tab', 'data-bs': {toggle: 'tab', target: "#tc#{tc.id}"}}= tc.num | |
|
9 | 9 | |
|
10 | 10 | /actual data |
|
11 | 11 | .tab-content |
|
12 | 12 | - @problem.testcases.each.with_index do |tc,id| |
|
13 | 13 | .tab-pane{id: "tc#{tc.id}",class: ('active' if id == 0)} |
|
14 | 14 | .row |
|
15 | 15 | .col-md-6 |
|
16 | 16 | %h3 Input |
|
17 | 17 | = link_to "Download",download_input_testcase_path(tc),class: 'btn btn-info btn-sm' |
|
18 | 18 | .col-md-6 |
|
19 | 19 | %h3 Output |
|
20 | 20 | = link_to "Download",download_sol_testcase_path(tc),class: 'btn btn-info btn-sm' |
You need to be logged in to leave comments.
Login now