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
@@ -1,127 +1,124 | |||
|
1 | 1 | source 'https://rubygems.org' |
|
2 | 2 | git_source(:github) { |repo| "https://github.com/#{repo}.git" } |
|
3 | 3 | |
|
4 | 4 | ruby '3.1.2' |
|
5 | 5 | |
|
6 | 6 | #rails |
|
7 | 7 | gem 'rails', '~>7.0' |
|
8 | 8 | |
|
9 | 9 | # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] |
|
10 | 10 | gem "sprockets-rails" |
|
11 | 11 | |
|
12 | 12 | gem 'activerecord-session_store' |
|
13 | 13 | gem 'puma' |
|
14 | 14 | |
|
15 | 15 | # Reduces boot times through caching; required in config/boot.rb |
|
16 | 16 | gem 'bootsnap', require: false |
|
17 | 17 | |
|
18 | 18 | # Bundle edge Rails instead: |
|
19 | 19 | # gem 'rails', :git => 'git://github.com/rails/rails.git' |
|
20 | 20 | |
|
21 | 21 | #---------------- database --------------------- |
|
22 | 22 | #the database |
|
23 | 23 | gem 'mysql2' |
|
24 | 24 | #for testing |
|
25 | 25 | gem 'sqlite3' |
|
26 | 26 | #gem 'rails-controller-testing' |
|
27 | 27 | #for dumping database into yaml |
|
28 | 28 | #gem 'yaml_db' |
|
29 | 29 | |
|
30 | 30 | |
|
31 | 31 | #------------- assset pipeline ----------------- |
|
32 | 32 | # Gems used only for assets and not required |
|
33 | 33 | # in production environments by default. |
|
34 | 34 | #sass-rails is depricated |
|
35 | 35 | #gem 'sass-rails' |
|
36 | 36 | gem 'sassc-rails' |
|
37 | 37 | gem 'coffee-rails' |
|
38 | 38 | gem 'material_icons' |
|
39 | 39 | |
|
40 | 40 | # See https://github.com/sstephenson/execjs#readme for more supported runtimes |
|
41 | 41 | # gem 'therubyracer', :platforms => :ruby |
|
42 | 42 | |
|
43 | 43 | gem "importmap-rails", "~> 1.1" |
|
44 | 44 | # gem 'uglifier' |
|
45 | 45 | |
|
46 | 46 | gem 'haml' |
|
47 | 47 | gem 'haml-rails' |
|
48 | 48 | |
|
49 | 49 | # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks |
|
50 | 50 | #gem 'turbolinks', '~> 5' |
|
51 | 51 | # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder |
|
52 | 52 | gem 'jbuilder' |
|
53 | 53 | |
|
54 | 54 | |
|
55 | 55 | #in-place editor |
|
56 | 56 | gem 'best_in_place', git: "https://github.com/mmotherwell/best_in_place" |
|
57 | 57 | |
|
58 | 58 | # jquery addition |
|
59 | 59 | gem 'jquery-rails' |
|
60 | 60 | #gem 'jquery-ui-rails' |
|
61 | 61 | #gem 'jquery-timepicker-addon-rails' |
|
62 | 62 | #gem 'jquery-tablesorter' |
|
63 | 63 | #gem 'jquery-countdown-rails' |
|
64 | 64 | |
|
65 | 65 | #syntax highlighter |
|
66 | 66 | gem 'rouge' |
|
67 | 67 | |
|
68 | 68 | #bootstrap add-ons |
|
69 | 69 | #gem 'bootstrap-sass', '~> 3.4.1' |
|
70 | 70 | gem 'bootstrap', '~> 5.2' |
|
71 | 71 | #gem 'bootstrap-switch-rails' |
|
72 | 72 | #gem 'bootstrap-toggle-rails' |
|
73 | 73 | #gem 'autoprefixer-rails' |
|
74 | 74 | gem 'momentjs-rails' |
|
75 | 75 | #gem 'rails_bootstrap_sortable' |
|
76 | 76 | #gem 'bootstrap-datepicker-rails' |
|
77 | 77 | #gem 'bootstrap3-datetimepicker-rails', '~> 4.17.47' |
|
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' |
|
106 | 103 | end |
|
107 | 104 | |
|
108 | 105 | group :development do |
|
109 | 106 | # Access an interactive console on exception pages or by calling 'console' anywhere in the code. |
|
110 | 107 | gem 'web-console', '>= 3.3.0' |
|
111 | 108 | gem 'listen', '>= 3.0.5', '< 3.2' |
|
112 | 109 | # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring |
|
113 | 110 | gem 'spring' |
|
114 | 111 | gem 'spring-watcher-listen', '~> 2.0.0' |
|
115 | 112 | |
|
116 | 113 | # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] |
|
117 | 114 | # gem "rack-mini-profiler" |
|
118 | 115 | end |
|
119 | 116 | |
|
120 | 117 | group :test do |
|
121 | 118 | # Adds support for Capybara system testing and selenium driver |
|
122 | 119 | gem 'capybara' |
|
123 | 120 | gem 'selenium-webdriver' |
|
124 | 121 | gem 'webdrivers' |
|
125 | 122 | end |
|
126 | 123 | |
|
127 | 124 |
@@ -1,342 +1,340 | |||
|
1 | 1 | GIT |
|
2 | 2 | remote: https://github.com/mmotherwell/best_in_place |
|
3 | 3 | revision: 88eb3052623a9a6cd346864d2aca05021c2f80d0 |
|
4 | 4 | specs: |
|
5 | 5 | best_in_place (3.1.1) |
|
6 | 6 | actionpack (>= 3.2) |
|
7 | 7 | railties (>= 3.2) |
|
8 | 8 | |
|
9 | 9 | GEM |
|
10 | 10 | remote: https://rubygems.org/ |
|
11 | 11 | specs: |
|
12 | 12 | RubyInline (3.12.6) |
|
13 | 13 | ZenTest (~> 4.3) |
|
14 | 14 | ZenTest (4.12.1) |
|
15 | 15 | ace-rails-ap (4.4) |
|
16 | 16 | actioncable (7.0.4) |
|
17 | 17 | actionpack (= 7.0.4) |
|
18 | 18 | activesupport (= 7.0.4) |
|
19 | 19 | nio4r (~> 2.0) |
|
20 | 20 | websocket-driver (>= 0.6.1) |
|
21 | 21 | actionmailbox (7.0.4) |
|
22 | 22 | actionpack (= 7.0.4) |
|
23 | 23 | activejob (= 7.0.4) |
|
24 | 24 | activerecord (= 7.0.4) |
|
25 | 25 | activestorage (= 7.0.4) |
|
26 | 26 | activesupport (= 7.0.4) |
|
27 | 27 | mail (>= 2.7.1) |
|
28 | 28 | net-imap |
|
29 | 29 | net-pop |
|
30 | 30 | net-smtp |
|
31 | 31 | actionmailer (7.0.4) |
|
32 | 32 | actionpack (= 7.0.4) |
|
33 | 33 | actionview (= 7.0.4) |
|
34 | 34 | activejob (= 7.0.4) |
|
35 | 35 | activesupport (= 7.0.4) |
|
36 | 36 | mail (~> 2.5, >= 2.5.4) |
|
37 | 37 | net-imap |
|
38 | 38 | net-pop |
|
39 | 39 | net-smtp |
|
40 | 40 | rails-dom-testing (~> 2.0) |
|
41 | 41 | actionpack (7.0.4) |
|
42 | 42 | actionview (= 7.0.4) |
|
43 | 43 | activesupport (= 7.0.4) |
|
44 | 44 | rack (~> 2.0, >= 2.2.0) |
|
45 | 45 | rack-test (>= 0.6.3) |
|
46 | 46 | rails-dom-testing (~> 2.0) |
|
47 | 47 | rails-html-sanitizer (~> 1.0, >= 1.2.0) |
|
48 | 48 | actiontext (7.0.4) |
|
49 | 49 | actionpack (= 7.0.4) |
|
50 | 50 | activerecord (= 7.0.4) |
|
51 | 51 | activestorage (= 7.0.4) |
|
52 | 52 | activesupport (= 7.0.4) |
|
53 | 53 | globalid (>= 0.6.0) |
|
54 | 54 | nokogiri (>= 1.8.5) |
|
55 | 55 | actionview (7.0.4) |
|
56 | 56 | activesupport (= 7.0.4) |
|
57 | 57 | builder (~> 3.1) |
|
58 | 58 | erubi (~> 1.4) |
|
59 | 59 | rails-dom-testing (~> 2.0) |
|
60 | 60 | rails-html-sanitizer (~> 1.1, >= 1.2.0) |
|
61 | 61 | activejob (7.0.4) |
|
62 | 62 | activesupport (= 7.0.4) |
|
63 | 63 | globalid (>= 0.3.6) |
|
64 | 64 | activemodel (7.0.4) |
|
65 | 65 | activesupport (= 7.0.4) |
|
66 | 66 | activerecord (7.0.4) |
|
67 | 67 | activemodel (= 7.0.4) |
|
68 | 68 | activesupport (= 7.0.4) |
|
69 | 69 | activerecord-session_store (2.0.0) |
|
70 | 70 | actionpack (>= 5.2.4.1) |
|
71 | 71 | activerecord (>= 5.2.4.1) |
|
72 | 72 | multi_json (~> 1.11, >= 1.11.2) |
|
73 | 73 | rack (>= 2.0.8, < 3) |
|
74 | 74 | railties (>= 5.2.4.1) |
|
75 | 75 | activestorage (7.0.4) |
|
76 | 76 | actionpack (= 7.0.4) |
|
77 | 77 | activejob (= 7.0.4) |
|
78 | 78 | activerecord (= 7.0.4) |
|
79 | 79 | activesupport (= 7.0.4) |
|
80 | 80 | marcel (~> 1.0) |
|
81 | 81 | mini_mime (>= 1.1.0) |
|
82 | 82 | activesupport (7.0.4) |
|
83 | 83 | concurrent-ruby (~> 1.0, >= 1.0.2) |
|
84 | 84 | i18n (>= 1.6, < 2) |
|
85 | 85 | minitest (>= 5.1) |
|
86 | 86 | tzinfo (~> 2.0) |
|
87 | 87 | addressable (2.8.1) |
|
88 | 88 | public_suffix (>= 2.0.2, < 6.0) |
|
89 | 89 | ansi (1.5.0) |
|
90 | 90 | autoprefixer-rails (10.4.7.0) |
|
91 | 91 | execjs (~> 2) |
|
92 | 92 | bindex (0.8.1) |
|
93 | 93 | bootsnap (1.13.0) |
|
94 | 94 | msgpack (~> 1.2) |
|
95 | 95 | bootstrap (5.2.1) |
|
96 | 96 | autoprefixer-rails (>= 9.1.0) |
|
97 | 97 | popper_js (>= 2.11.6, < 3) |
|
98 | 98 | sassc-rails (>= 2.0.0) |
|
99 | 99 | builder (3.2.4) |
|
100 | 100 | byebug (11.1.3) |
|
101 | 101 | capybara (3.37.1) |
|
102 | 102 | addressable |
|
103 | 103 | matrix |
|
104 | 104 | mini_mime (>= 0.1.3) |
|
105 | 105 | nokogiri (~> 1.8) |
|
106 | 106 | rack (>= 1.6.0) |
|
107 | 107 | rack-test (>= 0.6.3) |
|
108 | 108 | regexp_parser (>= 1.5, < 3.0) |
|
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) |
|
134 | 133 | actionpack (>= 5.1) |
|
135 | 134 | activesupport (>= 5.1) |
|
136 | 135 | haml (>= 4.0.6, < 6.0) |
|
137 | 136 | html2haml (>= 1.0.1) |
|
138 | 137 | railties (>= 5.1) |
|
139 | 138 | html2haml (2.2.0) |
|
140 | 139 | erubis (~> 2.7.0) |
|
141 | 140 | haml (>= 4.0, < 6) |
|
142 | 141 | nokogiri (>= 1.6.0) |
|
143 | 142 | ruby_parser (~> 3.5) |
|
144 | 143 | i18n (1.12.0) |
|
145 | 144 | concurrent-ruby (~> 1.0) |
|
146 | 145 | importmap-rails (1.1.5) |
|
147 | 146 | actionpack (>= 6.0.0) |
|
148 | 147 | railties (>= 6.0.0) |
|
149 | 148 | in_place_editing (1.2.0) |
|
150 | 149 | jbuilder (2.11.5) |
|
151 | 150 | actionview (>= 5.0.0) |
|
152 | 151 | activesupport (>= 5.0.0) |
|
153 | 152 | jquery-rails (4.5.0) |
|
154 | 153 | rails-dom-testing (>= 1, < 3) |
|
155 | 154 | railties (>= 4.2.0) |
|
156 | 155 | thor (>= 0.14, < 2.0) |
|
157 | 156 | listen (3.0.8) |
|
158 | 157 | rb-fsevent (~> 0.9, >= 0.9.4) |
|
159 | 158 | rb-inotify (~> 0.9, >= 0.9.7) |
|
160 | 159 | loofah (2.19.0) |
|
161 | 160 | crass (~> 1.0.2) |
|
162 | 161 | nokogiri (>= 1.5.9) |
|
163 | 162 | mail (2.7.1) |
|
164 | 163 | mini_mime (>= 0.1.1) |
|
165 | 164 | marcel (1.0.2) |
|
166 | 165 | material_icons (2.2.1) |
|
167 | 166 | railties (>= 3.2) |
|
168 | 167 | matrix (0.4.2) |
|
169 | 168 | method_source (1.0.0) |
|
170 | 169 | mini_mime (1.1.2) |
|
171 | 170 | minitest (5.16.3) |
|
172 | 171 | minitest-reporters (1.5.0) |
|
173 | 172 | ansi |
|
174 | 173 | builder |
|
175 | 174 | minitest (>= 5.0) |
|
176 | 175 | ruby-progressbar |
|
177 | 176 | momentjs-rails (2.29.4.1) |
|
178 | 177 | railties (>= 3.1) |
|
179 | 178 | msgpack (1.5.6) |
|
180 | 179 | multi_json (1.15.0) |
|
181 | 180 | mysql2 (0.5.4) |
|
182 | 181 | net-imap (0.2.3) |
|
183 | 182 | digest |
|
184 | 183 | net-protocol |
|
185 | 184 | strscan |
|
186 | 185 | net-pop (0.1.1) |
|
187 | 186 | digest |
|
188 | 187 | net-protocol |
|
189 | 188 | timeout |
|
190 | 189 | net-protocol (0.1.3) |
|
191 | 190 | timeout |
|
192 | 191 | net-smtp (0.3.1) |
|
193 | 192 | digest |
|
194 | 193 | net-protocol |
|
195 | 194 | timeout |
|
196 | 195 | nio4r (2.5.8) |
|
197 | 196 | nokogiri (1.13.8-x86_64-linux) |
|
198 | 197 | racc (~> 1.4) |
|
199 | 198 | popper_js (2.11.6) |
|
200 | 199 | public_suffix (5.0.0) |
|
201 | 200 | puma (5.6.5) |
|
202 | 201 | nio4r (~> 2.0) |
|
203 | 202 | racc (1.6.0) |
|
204 | 203 | rack (2.2.4) |
|
205 | 204 | rack-test (2.0.2) |
|
206 | 205 | rack (>= 1.3) |
|
207 | 206 | rails (7.0.4) |
|
208 | 207 | actioncable (= 7.0.4) |
|
209 | 208 | actionmailbox (= 7.0.4) |
|
210 | 209 | actionmailer (= 7.0.4) |
|
211 | 210 | actionpack (= 7.0.4) |
|
212 | 211 | actiontext (= 7.0.4) |
|
213 | 212 | actionview (= 7.0.4) |
|
214 | 213 | activejob (= 7.0.4) |
|
215 | 214 | activemodel (= 7.0.4) |
|
216 | 215 | activerecord (= 7.0.4) |
|
217 | 216 | activestorage (= 7.0.4) |
|
218 | 217 | activesupport (= 7.0.4) |
|
219 | 218 | bundler (>= 1.15.0) |
|
220 | 219 | railties (= 7.0.4) |
|
221 | 220 | rails-dom-testing (2.0.3) |
|
222 | 221 | activesupport (>= 4.2.0) |
|
223 | 222 | nokogiri (>= 1.6) |
|
224 | 223 | rails-html-sanitizer (1.4.3) |
|
225 | 224 | loofah (~> 2.3) |
|
226 | 225 | railties (7.0.4) |
|
227 | 226 | actionpack (= 7.0.4) |
|
228 | 227 | activesupport (= 7.0.4) |
|
229 | 228 | method_source |
|
230 | 229 | rake (>= 12.2) |
|
231 | 230 | thor (~> 1.0) |
|
232 | 231 | zeitwerk (~> 2.5) |
|
233 | 232 | rake (13.0.6) |
|
234 | 233 | rb-fsevent (0.11.2) |
|
235 | 234 | rb-inotify (0.10.1) |
|
236 | 235 | ffi (~> 1.0) |
|
237 | 236 | rdiscount (2.2.0.2) |
|
238 | 237 | regexp_parser (2.5.0) |
|
239 | 238 | rexml (3.2.5) |
|
240 | 239 | rouge (4.0.0) |
|
241 | 240 | ruby-progressbar (1.11.0) |
|
242 | 241 | ruby_parser (3.19.1) |
|
243 | 242 | sexp_processor (~> 4.16) |
|
244 | 243 | rubyzip (2.3.2) |
|
245 | 244 | sassc (2.4.0) |
|
246 | 245 | ffi (~> 1.9) |
|
247 | 246 | sassc-rails (2.1.2) |
|
248 | 247 | railties (>= 4.0.0) |
|
249 | 248 | sassc (>= 2.0) |
|
250 | 249 | sprockets (> 3.0) |
|
251 | 250 | sprockets-rails |
|
252 | 251 | tilt |
|
253 | 252 | selenium-webdriver (4.4.0) |
|
254 | 253 | childprocess (>= 0.5, < 5.0) |
|
255 | 254 | rexml (~> 3.2, >= 3.2.5) |
|
256 | 255 | rubyzip (>= 1.2.2, < 3.0) |
|
257 | 256 | websocket (~> 1.0) |
|
258 | 257 | sexp_processor (4.16.1) |
|
259 | 258 | simple_form (5.1.0) |
|
260 | 259 | actionpack (>= 5.2) |
|
261 | 260 | activemodel (>= 5.2) |
|
262 | 261 | spring (2.1.1) |
|
263 | 262 | spring-watcher-listen (2.0.1) |
|
264 | 263 | listen (>= 2.7, < 4.0) |
|
265 | 264 | spring (>= 1.2, < 3.0) |
|
266 | 265 | sprockets (4.1.1) |
|
267 | 266 | concurrent-ruby (~> 1.0) |
|
268 | 267 | rack (> 1, < 3) |
|
269 | 268 | sprockets-rails (3.4.2) |
|
270 | 269 | actionpack (>= 5.2) |
|
271 | 270 | activesupport (>= 5.2) |
|
272 | 271 | sprockets (>= 3.0.0) |
|
273 | 272 | sqlite3 (1.5.0-x86_64-linux) |
|
274 | 273 | strscan (3.0.4) |
|
275 | 274 | temple (0.8.2) |
|
276 | 275 | thor (1.2.1) |
|
277 | 276 | tilt (2.0.11) |
|
278 | 277 | timeout (0.3.0) |
|
279 | 278 | tzinfo (2.0.5) |
|
280 | 279 | concurrent-ruby (~> 1.0) |
|
281 | 280 | web-console (4.2.0) |
|
282 | 281 | actionview (>= 6.0.0) |
|
283 | 282 | activemodel (>= 6.0.0) |
|
284 | 283 | bindex (>= 0.4.0) |
|
285 | 284 | railties (>= 6.0.0) |
|
286 | 285 | webdrivers (5.1.0) |
|
287 | 286 | nokogiri (~> 1.6) |
|
288 | 287 | rubyzip (>= 1.3.0) |
|
289 | 288 | selenium-webdriver (~> 4.0) |
|
290 | 289 | websocket (1.2.9) |
|
291 | 290 | websocket-driver (0.7.5) |
|
292 | 291 | websocket-extensions (>= 0.1.0) |
|
293 | 292 | websocket-extensions (0.1.5) |
|
294 | 293 | xpath (3.2.0) |
|
295 | 294 | nokogiri (~> 1.8) |
|
296 | 295 | zeitwerk (2.6.0) |
|
297 | 296 | |
|
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 |
|
323 | 321 | mysql2 |
|
324 | 322 | puma |
|
325 | 323 | rails (~> 7.0) |
|
326 | 324 | rdiscount |
|
327 | 325 | rouge |
|
328 | 326 | sassc-rails |
|
329 | 327 | selenium-webdriver |
|
330 | 328 | simple_form |
|
331 | 329 | spring |
|
332 | 330 | spring-watcher-listen (~> 2.0.0) |
|
333 | 331 | sprockets-rails |
|
334 | 332 | sqlite3 |
|
335 | 333 | web-console (>= 3.3.0) |
|
336 | 334 | webdrivers |
|
337 | 335 | |
|
338 | 336 | RUBY VERSION |
|
339 | 337 | ruby 3.1.2p20 |
|
340 | 338 | |
|
341 | 339 | BUNDLED WITH |
|
342 | 340 | 2.3.22 |
@@ -1,197 +1,205 | |||
|
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%; |
|
18 | 26 | font-size: 100px; |
|
19 | 27 | text-align: right; |
|
20 | 28 | filter: alpha(opacity = 0); |
|
21 | 29 | opacity: 0; |
|
22 | 30 | outline: none; |
|
23 | 31 | background: white; |
|
24 | 32 | cursor: inherit; |
|
25 | 33 | display: block; |
|
26 | 34 | } |
|
27 | 35 | |
|
28 | 36 | body { |
|
29 | 37 | //font-size: 13px |
|
30 | 38 | font-family: 'Krub', Tahoma, "sans-serif"; |
|
31 | 39 | margin: 10px; |
|
32 | 40 | padding: 10px; |
|
33 | 41 | padding-top: 60px; |
|
34 | 42 | } |
|
35 | 43 | |
|
36 | 44 | // ------------------ bootstrap sortable -------------------- |
|
37 | 45 | table.sortable th { |
|
38 | 46 | padding-right: 20px !important; |
|
39 | 47 | |
|
40 | 48 | span.sign { |
|
41 | 49 | right: (-15px) !important; |
|
42 | 50 | } |
|
43 | 51 | |
|
44 | 52 | &.text-right { |
|
45 | 53 | padding-left: 20px !important; |
|
46 | 54 | padding-right: 8px !important; |
|
47 | 55 | |
|
48 | 56 | &:after, span.sign { |
|
49 | 57 | left: (-15px) !important; |
|
50 | 58 | } |
|
51 | 59 | } |
|
52 | 60 | } |
|
53 | 61 | |
|
54 | 62 | input { |
|
55 | 63 | font-family: Tahoma, "sans-serif"; |
|
56 | 64 | } |
|
57 | 65 | |
|
58 | 66 | h1 { |
|
59 | 67 | color: #334488; |
|
60 | 68 | } |
|
61 | 69 | |
|
62 | 70 | h2 { |
|
63 | 71 | color: #5566bb; |
|
64 | 72 | } |
|
65 | 73 | |
|
66 | 74 | hr { |
|
67 | 75 | border-top: 1px solid #dddddd; |
|
68 | 76 | border-bottom: 1px solid #eeeeee; |
|
69 | 77 | } |
|
70 | 78 | |
|
71 | 79 | //#a |
|
72 | 80 | // color: #6666cc |
|
73 | 81 | // text-decoration: none |
|
74 | 82 | // |
|
75 | 83 | // &:link, &:visited |
|
76 | 84 | // color: #6666cc |
|
77 | 85 | // text-decoration: none |
|
78 | 86 | // |
|
79 | 87 | // &:hover, &:focus |
|
80 | 88 | // color: #111166 |
|
81 | 89 | // text-decoration: none |
|
82 | 90 | |
|
83 | 91 | div { |
|
84 | 92 | &.userbar { |
|
85 | 93 | line-height: 1.5em; |
|
86 | 94 | text-align: right; |
|
87 | 95 | font-size: 12px; |
|
88 | 96 | } |
|
89 | 97 | |
|
90 | 98 | &.title { |
|
91 | 99 | padding: 10px 0px; |
|
92 | 100 | line-height: 1.5em; |
|
93 | 101 | font-size: 13px; |
|
94 | 102 | |
|
95 | 103 | span.contest-over-msg { |
|
96 | 104 | font-size: 15px; |
|
97 | 105 | color: red; |
|
98 | 106 | } |
|
99 | 107 | |
|
100 | 108 | table { |
|
101 | 109 | width: 100%; |
|
102 | 110 | font-weight: bold; |
|
103 | 111 | } |
|
104 | 112 | |
|
105 | 113 | td { |
|
106 | 114 | &.left-col { |
|
107 | 115 | text-align: left; |
|
108 | 116 | vertical-align: top; |
|
109 | 117 | color: #444444; |
|
110 | 118 | } |
|
111 | 119 | |
|
112 | 120 | &.right-col { |
|
113 | 121 | text-align: right; |
|
114 | 122 | vertical-align: top; |
|
115 | 123 | font-size: 18px; |
|
116 | 124 | color: #116699; |
|
117 | 125 | } |
|
118 | 126 | } |
|
119 | 127 | } |
|
120 | 128 | } |
|
121 | 129 | |
|
122 | 130 | table.info { |
|
123 | 131 | margin: 10px 0; |
|
124 | 132 | border: 1px solid #666666; |
|
125 | 133 | border-collapse: collapse; |
|
126 | 134 | font-size: 12px; |
|
127 | 135 | |
|
128 | 136 | th { |
|
129 | 137 | border: 1px solid #666666; |
|
130 | 138 | line-height: 1.5em; |
|
131 | 139 | padding: 0 0.5em; |
|
132 | 140 | } |
|
133 | 141 | |
|
134 | 142 | td { |
|
135 | 143 | border-left: 1px solid #666666; |
|
136 | 144 | border-right: 1px solid #666666; |
|
137 | 145 | line-height: 1.5em; |
|
138 | 146 | padding: 0 0.5em; |
|
139 | 147 | } |
|
140 | 148 | } |
|
141 | 149 | |
|
142 | 150 | tr { |
|
143 | 151 | &.info-head { |
|
144 | 152 | background: #777777; |
|
145 | 153 | color: white; |
|
146 | 154 | } |
|
147 | 155 | |
|
148 | 156 | &.info-odd { |
|
149 | 157 | background: #eeeeee; |
|
150 | 158 | } |
|
151 | 159 | |
|
152 | 160 | &.info-even { |
|
153 | 161 | background: #fcfcfc; |
|
154 | 162 | } |
|
155 | 163 | } |
|
156 | 164 | |
|
157 | 165 | @mixin basicbox { |
|
158 | 166 | background: #eeeeff; |
|
159 | 167 | border: 1px dotted #99aaee; |
|
160 | 168 | padding: 5px; |
|
161 | 169 | margin: 10px 0px; |
|
162 | 170 | color: black; |
|
163 | 171 | font-size: 13px; |
|
164 | 172 | } |
|
165 | 173 | |
|
166 | 174 | .infobox { |
|
167 | 175 | @include basicbox; |
|
168 | 176 | } |
|
169 | 177 | |
|
170 | 178 | .submitbox { |
|
171 | 179 | @include basicbox; |
|
172 | 180 | } |
|
173 | 181 | |
|
174 | 182 | .errorExplanation { |
|
175 | 183 | border: 1px dotted gray; |
|
176 | 184 | color: #bb2222; |
|
177 | 185 | padding: 5px 15px 5px 15px; |
|
178 | 186 | margin-bottom: 5px; |
|
179 | 187 | background-color: white; |
|
180 | 188 | font-weight: normal; |
|
181 | 189 | |
|
182 | 190 | h2 { |
|
183 | 191 | color: #cc1111; |
|
184 | 192 | font-weight: bold; |
|
185 | 193 | } |
|
186 | 194 | } |
|
187 | 195 | |
|
188 | 196 | table.uinfo { |
|
189 | 197 | border-collapse: collapse; |
|
190 | 198 | border: 1px solid black; |
|
191 | 199 | font-size: 13px; |
|
192 | 200 | } |
|
193 | 201 | |
|
194 | 202 | td.uinfo { |
|
195 | 203 | vertical-align: top; |
|
196 | 204 | border: 1px solid black; |
|
197 | 205 | padding: 5px; |
@@ -1,116 +1,114 | |||
|
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 |
|
19 | 17 | # GET /announcements/1.xml |
|
20 | 18 | def show |
|
21 | 19 | @announcement = Announcement.find(params[:id]) |
|
22 | 20 | |
|
23 | 21 | respond_to do |format| |
|
24 | 22 | format.html # show.html.erb |
|
25 | 23 | format.xml { render :xml => @announcement } |
|
26 | 24 | end |
|
27 | 25 | end |
|
28 | 26 | |
|
29 | 27 | # GET /announcements/new |
|
30 | 28 | # GET /announcements/new.xml |
|
31 | 29 | def new |
|
32 | 30 | @announcement = Announcement.new |
|
33 | 31 | |
|
34 | 32 | respond_to do |format| |
|
35 | 33 | format.html # new.html.erb |
|
36 | 34 | format.xml { render :xml => @announcement } |
|
37 | 35 | end |
|
38 | 36 | end |
|
39 | 37 | |
|
40 | 38 | # GET /announcements/1/edit |
|
41 | 39 | def edit |
|
42 | 40 | @announcement = Announcement.find(params[:id]) |
|
43 | 41 | end |
|
44 | 42 | |
|
45 | 43 | # POST /announcements |
|
46 | 44 | # POST /announcements.xml |
|
47 | 45 | def create |
|
48 | 46 | @announcement = Announcement.new(announcement_params) |
|
49 | 47 | |
|
50 | 48 | respond_to do |format| |
|
51 | 49 | if @announcement.save |
|
52 | 50 | flash[:notice] = 'Announcement was successfully created.' |
|
53 | 51 | format.html { redirect_to(@announcement) } |
|
54 | 52 | format.xml { render :xml => @announcement, :status => :created, :location => @announcement } |
|
55 | 53 | else |
|
56 | 54 | format.html { render :action => "new" } |
|
57 | 55 | format.xml { render :xml => @announcement.errors, :status => :unprocessable_entity } |
|
58 | 56 | end |
|
59 | 57 | end |
|
60 | 58 | end |
|
61 | 59 | |
|
62 | 60 | # PUT /announcements/1 |
|
63 | 61 | # PUT /announcements/1.xml |
|
64 | 62 | def update |
|
65 | 63 | @announcement = Announcement.find(params[:id]) |
|
66 | 64 | |
|
67 | 65 | respond_to do |format| |
|
68 | 66 | if @announcement.update(announcement_params) |
|
69 | 67 | flash[:notice] = 'Announcement was successfully updated.' |
|
70 | 68 | format.html { redirect_to(@announcement) } |
|
71 | 69 | format.js {} |
|
72 | 70 | format.xml { head :ok } |
|
73 | 71 | else |
|
74 | 72 | format.html { render :action => "edit" } |
|
75 | 73 | format.js {} |
|
76 | 74 | format.xml { render :xml => @announcement.errors, :status => :unprocessable_entity } |
|
77 | 75 | end |
|
78 | 76 | end |
|
79 | 77 | end |
|
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 | |
|
105 | 103 | respond_to do |format| |
|
106 | 104 | format.html { redirect_to(announcements_url) } |
|
107 | 105 | format.xml { head :ok } |
|
108 | 106 | end |
|
109 | 107 | end |
|
110 | 108 | |
|
111 | 109 | private |
|
112 | 110 | |
|
113 | 111 | def announcement_params |
|
114 | 112 | params.require(:announcement).permit(:author, :body, :published, :frontpage, :contest_only, :title, :on_nav_bar) |
|
115 | 113 | end |
|
116 | 114 | end |
@@ -1,203 +1,199 | |||
|
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 |
|
24 | 20 | end |
|
25 | 21 | |
|
26 | 22 | def create |
|
27 | 23 | @problem = Problem.new(problem_params) |
|
28 | 24 | @description = Description.new(description_params) |
|
29 | 25 | if @description.body!='' |
|
30 | 26 | if !@description.save |
|
31 | 27 | render :action => new and return |
|
32 | 28 | end |
|
33 | 29 | else |
|
34 | 30 | @description = nil |
|
35 | 31 | end |
|
36 | 32 | @problem.description = @description |
|
37 | 33 | if @problem.save |
|
38 | 34 | flash[:notice] = 'Problem was successfully created.' |
|
39 | 35 | redirect_to action: :index |
|
40 | 36 | else |
|
41 | 37 | render :action => 'new' |
|
42 | 38 | end |
|
43 | 39 | end |
|
44 | 40 | |
|
45 | 41 | def quick_create |
|
46 | 42 | @problem = Problem.new(problem_params) |
|
47 | 43 | @problem.full_name = @problem.name if @problem.full_name == '' |
|
48 | 44 | @problem.full_score = 100 |
|
49 | 45 | @problem.available = false |
|
50 | 46 | @problem.test_allowed = true |
|
51 | 47 | @problem.output_only = false |
|
52 | 48 | @problem.date_added = Time.new |
|
53 | 49 | if @problem.save |
|
54 | 50 | flash[:notice] = 'Problem was successfully created.' |
|
55 | 51 | redirect_to action: :index |
|
56 | 52 | else |
|
57 | 53 | flash[:notice] = 'Error saving problem' |
|
58 | 54 | redirect_to action: :index |
|
59 | 55 | end |
|
60 | 56 | end |
|
61 | 57 | |
|
62 | 58 | def edit |
|
63 | 59 | @problem = Problem.find(params[:id]) |
|
64 | 60 | @description = @problem.description |
|
65 | 61 | end |
|
66 | 62 | |
|
67 | 63 | def update |
|
68 | 64 | @problem = Problem.find(params[:id]) |
|
69 | 65 | @description = @problem.description |
|
70 | 66 | if @description.nil? and params[:description][:body]!='' |
|
71 | 67 | @description = Description.new(description_params) |
|
72 | 68 | if !@description.save |
|
73 | 69 | flash[:notice] = 'Error saving description' |
|
74 | 70 | render :action => 'edit' and return |
|
75 | 71 | end |
|
76 | 72 | @problem.description = @description |
|
77 | 73 | elsif @description |
|
78 | 74 | if !@description.update(description_params) |
|
79 | 75 | flash[:notice] = 'Error saving description' |
|
80 | 76 | render :action => 'edit' and return |
|
81 | 77 | end |
|
82 | 78 | end |
|
83 | 79 | if params[:file] and params[:file].content_type != 'application/pdf' |
|
84 | 80 | flash[:notice] = 'Error: Uploaded file is not PDF' |
|
85 | 81 | render :action => 'edit' and return |
|
86 | 82 | end |
|
87 | 83 | if @problem.update(problem_params) |
|
88 | 84 | flash[:notice] = 'Problem was successfully updated.' |
|
89 | 85 | unless params[:file] == nil or params[:file] == '' |
|
90 | 86 | flash[:notice] = 'Problem was successfully updated and a new PDF file is uploaded.' |
|
91 | 87 | out_dirname = "#{Problem.download_file_basedir}/#{@problem.id}" |
|
92 | 88 | if not FileTest.exists? out_dirname |
|
93 | 89 | Dir.mkdir out_dirname |
|
94 | 90 | end |
|
95 | 91 | |
|
96 | 92 | out_filename = "#{out_dirname}/#{@problem.name}.pdf" |
|
97 | 93 | if FileTest.exists? out_filename |
|
98 | 94 | File.delete out_filename |
|
99 | 95 | end |
|
100 | 96 | |
|
101 | 97 | File.open(out_filename,"wb") do |file| |
|
102 | 98 | file.write(params[:file].read) |
|
103 | 99 | end |
|
104 | 100 | @problem.description_filename = "#{@problem.name}.pdf" |
|
105 | 101 | @problem.save |
|
106 | 102 | end |
|
107 | 103 | redirect_to :action => 'show', :id => @problem |
|
108 | 104 | else |
|
109 | 105 | render :action => 'edit' |
|
110 | 106 | end |
|
111 | 107 | end |
|
112 | 108 | |
|
113 | 109 | def destroy |
|
114 | 110 | p = Problem.find(params[:id]).destroy |
|
115 | 111 | redirect_to action: :index |
|
116 | 112 | end |
|
117 | 113 | |
|
118 | 114 | def toggle |
|
119 | 115 | @problem = Problem.find(params[:id]) |
|
120 | 116 | @problem.update(available: !(@problem.available) ) |
|
121 | 117 | respond_to do |format| |
|
122 | 118 | format.js { } |
|
123 | 119 | end |
|
124 | 120 | end |
|
125 | 121 | |
|
126 | 122 | def toggle_test |
|
127 | 123 | @problem = Problem.find(params[:id]) |
|
128 | 124 | @problem.update(test_allowed: !(@problem.test_allowed?) ) |
|
129 | 125 | respond_to do |format| |
|
130 | 126 | format.js { } |
|
131 | 127 | end |
|
132 | 128 | end |
|
133 | 129 | |
|
134 | 130 | def toggle_view_testcase |
|
135 | 131 | @problem = Problem.find(params[:id]) |
|
136 | 132 | @problem.update(view_testcase: !(@problem.view_testcase?) ) |
|
137 | 133 | respond_to do |format| |
|
138 | 134 | format.js { } |
|
139 | 135 | end |
|
140 | 136 | end |
|
141 | 137 | |
|
142 | 138 | def turn_all_off |
|
143 | 139 | Problem.available.all.each do |problem| |
|
144 | 140 | problem.available = false |
|
145 | 141 | problem.save |
|
146 | 142 | end |
|
147 | 143 | redirect_to action: :index |
|
148 | 144 | end |
|
149 | 145 | |
|
150 | 146 | def turn_all_on |
|
151 | 147 | Problem.where.not(available: true).each do |problem| |
|
152 | 148 | problem.available = true |
|
153 | 149 | problem.save |
|
154 | 150 | end |
|
155 | 151 | redirect_to action: :index |
|
156 | 152 | end |
|
157 | 153 | |
|
158 | 154 | def stat |
|
159 | 155 | @problem = Problem.find(params[:id]) |
|
160 | 156 | unless @problem.available or session[:admin] |
|
161 | 157 | redirect_to :controller => 'main', :action => 'list' |
|
162 | 158 | return |
|
163 | 159 | end |
|
164 | 160 | @submissions = Submission.includes(:user).includes(:language).where(problem_id: params[:id]).order(:user_id,:id) |
|
165 | 161 | |
|
166 | 162 | #stat summary |
|
167 | 163 | range =65 |
|
168 | 164 | @histogram = { data: Array.new(range,0), summary: {} } |
|
169 | 165 | user = Hash.new(0) |
|
170 | 166 | @submissions.find_each do |sub| |
|
171 | 167 | d = (DateTime.now.in_time_zone - sub.submitted_at) / 24 / 60 / 60 |
|
172 | 168 | @histogram[:data][d.to_i] += 1 if d < range |
|
173 | 169 | user[sub.user_id] = [user[sub.user_id], ((sub.try(:points) || 0) >= @problem.full_score) ? 1 : 0].max |
|
174 | 170 | end |
|
175 | 171 | @histogram[:summary][:max] = [@histogram[:data].max,1].max |
|
176 | 172 | |
|
177 | 173 | @summary = { attempt: user.count, solve: 0 } |
|
178 | 174 | user.each_value { |v| @summary[:solve] += 1 if v == 1 } |
|
179 | 175 | end |
|
180 | 176 | |
|
181 | 177 | def manage |
|
182 | 178 | @problems = Problem.order(date_added: :desc) |
|
183 | 179 | end |
|
184 | 180 | |
|
185 | 181 | def do_manage |
|
186 | 182 | if params.has_key? 'change_date_added' and params[:date_added].strip.empty? == false |
|
187 | 183 | change_date_added |
|
188 | 184 | elsif params.has_key? 'add_to_contest' |
|
189 | 185 | add_to_contest |
|
190 | 186 | elsif params.has_key? 'enable_problem' |
|
191 | 187 | set_available(true) |
|
192 | 188 | elsif params.has_key? 'disable_problem' |
|
193 | 189 | set_available(false) |
|
194 | 190 | elsif params.has_key? 'add_group' |
|
195 | 191 | group = Group.find(params[:group_id]) |
|
196 | 192 | ok = [] |
|
197 | 193 | failed = [] |
|
198 | 194 | get_problems_from_params.each do |p| |
|
199 | 195 | begin |
|
200 | 196 | group.problems << p |
|
201 | 197 | ok << p.full_name |
|
202 | 198 | rescue => e |
|
203 | 199 | failed << p.full_name |
@@ -1,222 +1,222 | |||
|
1 | 1 | # Methods added to this helper will be available to all templates in the application. |
|
2 | 2 | module ApplicationHelper |
|
3 | 3 | |
|
4 | 4 | #new bootstrap header |
|
5 | 5 | def navbar_user_header |
|
6 | 6 | left_menu = '' |
|
7 | 7 | right_menu = '' |
|
8 | 8 | user = User.find(session[:user_id]) |
|
9 | 9 | |
|
10 | 10 | if (user!=nil) and (GraderConfiguration.show_tasks_to?(user)) |
|
11 | 11 | left_menu << add_menu("#{I18n.t 'menu.tasks'}", 'tasks', 'list') |
|
12 | 12 | left_menu << add_menu("#{I18n.t 'menu.submissions'}", 'main', 'submission') |
|
13 | 13 | left_menu << add_menu("#{I18n.t 'menu.test'}", 'test', 'index') |
|
14 | 14 | end |
|
15 | 15 | |
|
16 | 16 | if GraderConfiguration['right.user_hall_of_fame'] |
|
17 | 17 | left_menu << add_menu("#{I18n.t 'menu.hall_of_fame'}", 'report', 'problem_hof') |
|
18 | 18 | end |
|
19 | 19 | |
|
20 | 20 | right_menu << add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-question-sign')}".html_safe, 'main', 'help') |
|
21 | 21 | right_menu << add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-comment')}".html_safe, 'messages', 'list', {title: I18n.t('menu.messages'), data: {toggle: 'tooltip'}}) |
|
22 | 22 | if GraderConfiguration['system.user_setting_enabled'] |
|
23 | 23 | right_menu << add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-cog')}".html_safe, 'users', 'index', {title: I18n.t('menu.settings'), data: {toggle: 'tooltip'}}) |
|
24 | 24 | end |
|
25 | 25 | right_menu << add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-log-out')} #{user.full_name}".html_safe, 'main', 'login', {title: I18n.t('menu.log_out'), data: {toggle: 'tooltip'}}) |
|
26 | 26 | |
|
27 | 27 | |
|
28 | 28 | result = content_tag(:ul,left_menu.html_safe,class: 'nav navbar-nav') + content_tag(:ul,right_menu.html_safe,class: 'nav navbar-nav navbar-right') |
|
29 | 29 | end |
|
30 | 30 | |
|
31 | 31 | def add_menu(title, controller, action, html_option = {}) |
|
32 | 32 | link_option = {controller: controller, action: action} |
|
33 | 33 | html_option[:class] = (html_option[:class] || '') + " active" if current_page?(link_option) |
|
34 | 34 | content_tag(:li, link_to(title,link_option),html_option) |
|
35 | 35 | end |
|
36 | 36 | |
|
37 | 37 | def user_header |
|
38 | 38 | menu_items = '' |
|
39 | 39 | user = User.find(session[:user_id]) |
|
40 | 40 | |
|
41 | 41 | if (user!=nil) and (session[:admin]) |
|
42 | 42 | # admin menu |
|
43 | 43 | menu_items << "<b>Administrative task:</b> " |
|
44 | 44 | append_to menu_items, '[Announcements]', 'announcements', 'index' |
|
45 | 45 | append_to menu_items, '[Msg console]', 'messages', 'console' |
|
46 | 46 | append_to menu_items, '[Problems]', 'problems', 'index' |
|
47 | 47 | append_to menu_items, '[Users]', 'user_admin', 'index' |
|
48 | 48 | append_to menu_items, '[Results]', 'user_admin', 'user_stat' |
|
49 | 49 | append_to menu_items, '[Report]', 'report', 'multiple_login' |
|
50 | 50 | append_to menu_items, '[Graders]', 'graders', 'list' |
|
51 | 51 | append_to menu_items, '[Contests]', 'contest_management', 'index' |
|
52 | 52 | append_to menu_items, '[Sites]', 'sites', 'index' |
|
53 | 53 | append_to menu_items, '[System config]', 'configurations', 'index' |
|
54 | 54 | menu_items << "<br/>" |
|
55 | 55 | end |
|
56 | 56 | |
|
57 | 57 | # main page |
|
58 | 58 | append_to menu_items, "[#{I18n.t 'menu.main'}]", 'main', 'list' |
|
59 | 59 | append_to menu_items, "[#{I18n.t 'menu.messages'}]", 'messages', 'list' |
|
60 | 60 | |
|
61 | 61 | if (user!=nil) and (GraderConfiguration.show_tasks_to?(user)) |
|
62 | 62 | append_to menu_items, "[#{I18n.t 'menu.tasks'}]", 'tasks', 'list' |
|
63 | 63 | append_to menu_items, "[#{I18n.t 'menu.submissions'}]", 'main', 'submission' |
|
64 | 64 | append_to menu_items, "[#{I18n.t 'menu.test'}]", 'test', 'index' |
|
65 | 65 | end |
|
66 | 66 | |
|
67 | 67 | if GraderConfiguration['right.user_hall_of_fame'] |
|
68 | 68 | append_to menu_items, "[#{I18n.t 'menu.hall_of_fame'}]", 'report', 'problem_hof' |
|
69 | 69 | end |
|
70 | 70 | append_to menu_items, "[#{I18n.t 'menu.help'}]", 'main', 'help' |
|
71 | 71 | |
|
72 | 72 | if GraderConfiguration['system.user_setting_enabled'] |
|
73 | 73 | append_to menu_items, "[#{I18n.t 'menu.settings'}]", 'users', 'index' |
|
74 | 74 | end |
|
75 | 75 | append_to menu_items, "[#{I18n.t 'menu.log_out'}]", 'main', 'login' |
|
76 | 76 | |
|
77 | 77 | menu_items.html_safe |
|
78 | 78 | end |
|
79 | 79 | |
|
80 | 80 | def append_to(option,label, controller, action) |
|
81 | 81 | option << ' ' if option!='' |
|
82 | 82 | option << link_to_unless_current(label, |
|
83 | 83 | :controller => controller, |
|
84 | 84 | :action => action) |
|
85 | 85 | end |
|
86 | 86 | |
|
87 | 87 | def format_short_time(time) |
|
88 | 88 | now = Time.zone.now |
|
89 | 89 | st = '' |
|
90 | 90 | if (time.yday != now.yday) or (time.year != now.year) |
|
91 | 91 | st = time.strftime("%d/%m/%y ") |
|
92 | 92 | end |
|
93 | 93 | st + time.strftime("%X") |
|
94 | 94 | end |
|
95 | 95 | |
|
96 | 96 | def format_short_duration(duration) |
|
97 | 97 | return '' if duration==nil |
|
98 | 98 | d = duration.to_f |
|
99 | 99 | return Time.at(d).gmtime.strftime("%X") |
|
100 | 100 | end |
|
101 | 101 | |
|
102 | 102 | def format_full_time_ago(time) |
|
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' |
|
131 | 131 | when 'Ruby' |
|
132 | 132 | 'ace/mode/ruby' |
|
133 | 133 | when 'Python' |
|
134 | 134 | 'ace/mode/python' |
|
135 | 135 | when 'Java' |
|
136 | 136 | 'ace/mode/java' |
|
137 | 137 | else |
|
138 | 138 | 'ace/mode/c_cpp' |
|
139 | 139 | end |
|
140 | 140 | end |
|
141 | 141 | |
|
142 | 142 | |
|
143 | 143 | def user_title_bar(user) |
|
144 | 144 | header = '' |
|
145 | 145 | time_left = '' |
|
146 | 146 | |
|
147 | 147 | # |
|
148 | 148 | # if the contest is over |
|
149 | 149 | if GraderConfiguration.time_limit_mode? |
|
150 | 150 | if user.contest_finished? |
|
151 | 151 | header = <<CONTEST_OVER |
|
152 | 152 | <tr><td colspan="2" align="center"> |
|
153 | 153 | <span class="contest-over-msg">THE CONTEST IS OVER</span> |
|
154 | 154 | </td></tr> |
|
155 | 155 | CONTEST_OVER |
|
156 | 156 | end |
|
157 | 157 | if !user.contest_started? |
|
158 | 158 | time_left = " " + (t 'title_bar.contest_not_started') |
|
159 | 159 | else |
|
160 | 160 | time_left = " " + (t 'title_bar.remaining_time') + |
|
161 | 161 | " #{format_short_duration(user.contest_time_left)}" |
|
162 | 162 | end |
|
163 | 163 | end |
|
164 | 164 | |
|
165 | 165 | # |
|
166 | 166 | # if the contest is in the anaysis mode |
|
167 | 167 | if GraderConfiguration.analysis_mode? |
|
168 | 168 | header = <<ANALYSISMODE |
|
169 | 169 | <tr><td colspan="2" align="center"> |
|
170 | 170 | <span class="contest-over-msg">ANALYSIS MODE</span> |
|
171 | 171 | </td></tr> |
|
172 | 172 | ANALYSISMODE |
|
173 | 173 | end |
|
174 | 174 | |
|
175 | 175 | contest_name = GraderConfiguration['contest.name'] |
|
176 | 176 | |
|
177 | 177 | # |
|
178 | 178 | # build real title bar |
|
179 | 179 | result = <<TITLEBAR |
|
180 | 180 | <div class="title"> |
|
181 | 181 | <table> |
|
182 | 182 | #{header} |
|
183 | 183 | <tr> |
|
184 | 184 | <td class="left-col"> |
|
185 | 185 | <br/> |
|
186 | 186 | </td> |
|
187 | 187 | <td class="right-col">#{contest_name}</td> |
|
188 | 188 | </tr> |
|
189 | 189 | </table> |
|
190 | 190 | </div> |
|
191 | 191 | TITLEBAR |
|
192 | 192 | result.html_safe |
|
193 | 193 | end |
|
194 | 194 | |
|
195 | 195 | def markdown(text) |
|
196 | 196 | markdown = RDiscount.new(text) |
|
197 | 197 | markdown.to_html.html_safe |
|
198 | 198 | end |
|
199 | 199 | |
|
200 | 200 | |
|
201 | 201 | BOOTSTRAP_FLASH_MSG = { |
|
202 | 202 | success: 'alert-success', |
|
203 | 203 | error: 'alert-danger', |
|
204 | 204 | alert: 'alert-danger', |
|
205 | 205 | notice: 'alert-info' |
|
206 | 206 | } |
|
207 | 207 | |
|
208 | 208 | def bootstrap_class_for(flash_type) |
|
209 | 209 | BOOTSTRAP_FLASH_MSG.fetch(flash_type.to_sym, flash_type.to_s) |
|
210 | 210 | end |
|
211 | 211 | |
|
212 | 212 | def flash_messages |
|
213 | 213 | flash.each do |msg_type, message| |
|
214 | 214 | concat(content_tag(:div, message, class: "alert #{bootstrap_class_for(msg_type)} fade in") do |
|
215 | 215 | concat content_tag(:button, 'x', class: "close", data: { dismiss: 'alert' }) |
|
216 | 216 | concat message |
|
217 | 217 | end) |
|
218 | 218 | end |
|
219 | 219 | nil |
|
220 | 220 | end |
|
221 | 221 | |
|
222 | 222 | end |
@@ -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,87 +1,87 | |||
|
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' |
|
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 | 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 | 24 | %div.btn.btn-success#countdown= "ANALYSIS MODE" |
|
25 | 25 | - elsif GraderConfiguration.time_limit_mode? |
|
26 | 26 | - if @current_user.contest_finished? |
|
27 | 27 | %div.btn.btn-danger#countdown= "Contest is over" |
|
28 | 28 | - elsif !@current_user.contest_started? |
|
29 | 29 | %div.btn.btn-primary#countdown= (t 'title_bar.contest_not_started') |
|
30 | 30 | - else |
|
31 | 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 | 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 |
|
41 | 41 | %li= link_to 'Announcements', announcements_path, class: 'dropdown-item' |
|
42 | 42 | %li= link_to 'Problems', problems_path, class: 'dropdown-item' |
|
43 | 43 | %li= link_to 'Tags', tags_path, class: 'dropdown-item' |
|
44 | 44 | %li= link_to 'Users', user_admin_index_path, class: 'dropdown-item' |
|
45 | 45 | %li= link_to 'User Groups', groups_path, class: 'dropdown-item' |
|
46 | 46 | %li= link_to 'Graders', graders_list_path, class: 'dropdown-item' |
|
47 | 47 | %li= link_to 'Message ', console_messages_path, class: 'dropdown-item' |
|
48 | 48 | %li |
|
49 | 49 | %hr.dropdown-divider |
|
50 | 50 | %li= link_to 'System config', grader_configuration_index_path, class: 'dropdown-item' |
|
51 | 51 | %li |
|
52 | 52 | %hr.dropdown-divider |
|
53 | 53 | %li= link_to 'Sites', sites_path, class: 'dropdown-item' |
|
54 | 54 | %li= link_to 'Contests', contest_management_index_path, class: 'dropdown-item' |
|
55 | 55 | -# |
|
56 | 56 | / report |
|
57 | 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 |
|
61 | 61 | %li= link_to 'Current Score', current_score_report_path, class: 'dropdown-item' |
|
62 | 62 | %li= link_to 'Score Report', max_score_report_path, class: 'dropdown-item' |
|
63 | 63 | %li= link_to 'Submission Report', submission_report_path, class: 'dropdown-item' |
|
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' |
@@ -1,65 +1,65 | |||
|
1 | 1 | - content_for :head do |
|
2 | 2 | = stylesheet_link_tag 'problems' |
|
3 | 3 | %h1 Problems |
|
4 | 4 | %p |
|
5 | 5 | = link_to 'Import problems', {:action => 'import'}, class: 'btn btn-success btn-sm' |
|
6 | 6 | = link_to 'New problem', new_problem_path, class: 'btn btn-success btn-sm' |
|
7 | 7 | = link_to 'Bulk Manage', { action: 'manage'}, class: 'btn btn-info btn-sm' |
|
8 | 8 | = link_to 'Turn off all problems', {:action => 'turn_all_off'}, class: 'btn btn-default btn-sm' |
|
9 | 9 | = link_to 'Turn on all problems', {:action => 'turn_all_on'}, class: 'btn btn-default btn-sm' |
|
10 | 10 | .submitbox |
|
11 | 11 | = form_tag action: 'quick_create', controller: 'problems' do |
|
12 | 12 | %b Quick New: |
|
13 | 13 | %label{:for => "problem_name"} Name |
|
14 | 14 | = text_field 'problem', 'name' |
|
15 | 15 | | |
|
16 | 16 | %label{:for => "problem_full_name"} Full name |
|
17 | 17 | = text_field 'problem', 'full_name' |
|
18 | 18 | = submit_tag "Create" |
|
19 | 19 | %table.table.table-condense.table-hover |
|
20 | 20 | %thead |
|
21 | 21 | %th Name |
|
22 | 22 | %th Full name |
|
23 | 23 | %th.text-right Full score |
|
24 | 24 | %th Tags |
|
25 | 25 | %th |
|
26 | 26 | Submit |
|
27 | 27 | %sup{class: 'text-primary',data: {toggle: 'tooltip'}, title: 'Admin can always submit to any problem' } [?] |
|
28 | 28 | %th Date added |
|
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,25 +1,25 | |||
|
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' |
|
21 | 21 | .row |
|
22 | 22 | .col-md-6 |
|
23 | 23 | %textarea{ rows: 25,readonly: true,style: "width:100%;resize=none;overflow-y: scroll;"}= tc.input |
|
24 | 24 | .col-md-6 |
|
25 | 25 | %textarea{ rows: 25,readonly: true,style: "width:100%;resize=none;overflow-y: scroll;"}= tc.sol |
You need to be logged in to leave comments.
Login now