Description:
change datetime picker widget
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r692:57c9378ff75a - - 7 files changed: 62 inserted, 29 deleted
@@ -44,48 +44,50 | |||||
|
44 |
|
44 | ||
|
45 | # To use debugger |
|
45 | # To use debugger |
|
46 | # gem 'debugger' |
|
46 | # gem 'debugger' |
|
47 | # |
|
47 | # |
|
48 |
|
48 | ||
|
49 | #in-place editor |
|
49 | #in-place editor |
|
50 | gem 'best_in_place', '~> 3.0.1' |
|
50 | gem 'best_in_place', '~> 3.0.1' |
|
51 |
|
51 | ||
|
52 | # jquery addition |
|
52 | # jquery addition |
|
53 | gem 'jquery-rails' |
|
53 | gem 'jquery-rails' |
|
54 | gem 'jquery-ui-rails' |
|
54 | gem 'jquery-ui-rails' |
|
55 | gem 'jquery-timepicker-addon-rails' |
|
55 | gem 'jquery-timepicker-addon-rails' |
|
56 | gem 'jquery-tablesorter' |
|
56 | gem 'jquery-tablesorter' |
|
57 | gem 'jquery-countdown-rails' |
|
57 | gem 'jquery-countdown-rails' |
|
58 |
|
58 | ||
|
59 | #syntax highlighter |
|
59 | #syntax highlighter |
|
60 | gem 'rouge' |
|
60 | gem 'rouge' |
|
61 |
|
61 | ||
|
62 | #add bootstrap |
|
62 | #add bootstrap |
|
63 | gem 'bootstrap-sass', '~> 3.2.0' |
|
63 | gem 'bootstrap-sass', '~> 3.2.0' |
|
64 | gem 'bootstrap-switch-rails' |
|
64 | gem 'bootstrap-switch-rails' |
|
65 | gem 'bootstrap-toggle-rails' |
|
65 | gem 'bootstrap-toggle-rails' |
|
66 | gem 'autoprefixer-rails' |
|
66 | gem 'autoprefixer-rails' |
|
67 |
|
67 | ||
|
68 | - #bootstrap sortable |
|
68 | + #more bootstrp add-on |
|
69 | gem 'momentjs-rails' |
|
69 | gem 'momentjs-rails' |
|
70 | gem 'rails_bootstrap_sortable' |
|
70 | gem 'rails_bootstrap_sortable' |
|
|
71 | + gem 'bootstrap-datepicker-rails' | ||
|
|
72 | + gem 'bootstrap3-datetimepicker-rails' | ||
|
71 |
|
73 | ||
|
72 | #----------- user interface ----------------- |
|
74 | #----------- user interface ----------------- |
|
73 | #select 2 |
|
75 | #select 2 |
|
74 | gem 'select2-rails' |
|
76 | gem 'select2-rails' |
|
75 | #ace editor |
|
77 | #ace editor |
|
76 | gem 'ace-rails-ap' |
|
78 | gem 'ace-rails-ap' |
|
77 | #paginator |
|
79 | #paginator |
|
78 | gem 'will_paginate', '~> 3.0.7' |
|
80 | gem 'will_paginate', '~> 3.0.7' |
|
79 |
|
81 | ||
|
80 | gem 'mail' |
|
82 | gem 'mail' |
|
81 | gem 'rdiscount' |
|
83 | gem 'rdiscount' |
|
82 | gem 'dynamic_form' |
|
84 | gem 'dynamic_form' |
|
83 | gem 'in_place_editing' |
|
85 | gem 'in_place_editing' |
|
84 | gem 'verification', :git => 'https://github.com/sikachu/verification.git' |
|
86 | gem 'verification', :git => 'https://github.com/sikachu/verification.git' |
|
85 |
|
87 | ||
|
86 |
|
88 | ||
|
87 | #---------------- testiing ----------------------- |
|
89 | #---------------- testiing ----------------------- |
|
88 | gem 'minitest-reporters' |
|
90 | gem 'minitest-reporters' |
|
89 |
|
91 | ||
|
90 | #---------------- for console -------------------- |
|
92 | #---------------- for console -------------------- |
|
91 | gem 'fuzzy-string-match' |
|
93 | gem 'fuzzy-string-match' |
@@ -40,52 +40,56 | |||||
|
40 | builder (~> 3.1) |
|
40 | builder (~> 3.1) |
|
41 | activerecord (4.2.7.1) |
|
41 | activerecord (4.2.7.1) |
|
42 | activemodel (= 4.2.7.1) |
|
42 | activemodel (= 4.2.7.1) |
|
43 | activesupport (= 4.2.7.1) |
|
43 | activesupport (= 4.2.7.1) |
|
44 | arel (~> 6.0) |
|
44 | arel (~> 6.0) |
|
45 | activerecord-session_store (1.0.0) |
|
45 | activerecord-session_store (1.0.0) |
|
46 | actionpack (>= 4.0, < 5.1) |
|
46 | actionpack (>= 4.0, < 5.1) |
|
47 | activerecord (>= 4.0, < 5.1) |
|
47 | activerecord (>= 4.0, < 5.1) |
|
48 | multi_json (~> 1.11, >= 1.11.2) |
|
48 | multi_json (~> 1.11, >= 1.11.2) |
|
49 | rack (>= 1.5.2, < 3) |
|
49 | rack (>= 1.5.2, < 3) |
|
50 | railties (>= 4.0, < 5.1) |
|
50 | railties (>= 4.0, < 5.1) |
|
51 | activesupport (4.2.7.1) |
|
51 | activesupport (4.2.7.1) |
|
52 | i18n (~> 0.7) |
|
52 | i18n (~> 0.7) |
|
53 | json (~> 1.7, >= 1.7.7) |
|
53 | json (~> 1.7, >= 1.7.7) |
|
54 | minitest (~> 5.1) |
|
54 | minitest (~> 5.1) |
|
55 | thread_safe (~> 0.3, >= 0.3.4) |
|
55 | thread_safe (~> 0.3, >= 0.3.4) |
|
56 | tzinfo (~> 1.1) |
|
56 | tzinfo (~> 1.1) |
|
57 | ansi (1.5.0) |
|
57 | ansi (1.5.0) |
|
58 | arel (6.0.4) |
|
58 | arel (6.0.4) |
|
59 | autoprefixer-rails (6.6.0) |
|
59 | autoprefixer-rails (6.6.0) |
|
60 | execjs |
|
60 | execjs |
|
61 | best_in_place (3.0.3) |
|
61 | best_in_place (3.0.3) |
|
62 | actionpack (>= 3.2) |
|
62 | actionpack (>= 3.2) |
|
63 | railties (>= 3.2) |
|
63 | railties (>= 3.2) |
|
|
64 | + bootstrap-datepicker-rails (1.7.1.1) | ||
|
|
65 | + railties (>= 3.0) | ||
|
64 | bootstrap-sass (3.2.0.2) |
|
66 | bootstrap-sass (3.2.0.2) |
|
65 | sass (~> 3.2) |
|
67 | sass (~> 3.2) |
|
66 | bootstrap-switch-rails (3.3.3) |
|
68 | bootstrap-switch-rails (3.3.3) |
|
67 | bootstrap-toggle-rails (2.2.1.0) |
|
69 | bootstrap-toggle-rails (2.2.1.0) |
|
|
70 | + bootstrap3-datetimepicker-rails (4.17.47) | ||
|
|
71 | + momentjs-rails (>= 2.8.1) | ||
|
68 | builder (3.2.2) |
|
72 | builder (3.2.2) |
|
69 | coffee-rails (4.2.1) |
|
73 | coffee-rails (4.2.1) |
|
70 | coffee-script (>= 2.2.0) |
|
74 | coffee-script (>= 2.2.0) |
|
71 | railties (>= 4.0.0, < 5.2.x) |
|
75 | railties (>= 4.0.0, < 5.2.x) |
|
72 | coffee-script (2.4.1) |
|
76 | coffee-script (2.4.1) |
|
73 | coffee-script-source |
|
77 | coffee-script-source |
|
74 | execjs |
|
78 | execjs |
|
75 | coffee-script-source (1.12.2) |
|
79 | coffee-script-source (1.12.2) |
|
76 | concurrent-ruby (1.0.4) |
|
80 | concurrent-ruby (1.0.4) |
|
77 | dynamic_form (1.1.4) |
|
81 | dynamic_form (1.1.4) |
|
78 | erubis (2.7.0) |
|
82 | erubis (2.7.0) |
|
79 | execjs (2.7.0) |
|
83 | execjs (2.7.0) |
|
80 | fuzzy-string-match (1.0.0) |
|
84 | fuzzy-string-match (1.0.0) |
|
81 | RubyInline (>= 3.8.6) |
|
85 | RubyInline (>= 3.8.6) |
|
82 | globalid (0.3.7) |
|
86 | globalid (0.3.7) |
|
83 | activesupport (>= 4.1.0) |
|
87 | activesupport (>= 4.1.0) |
|
84 | haml (4.0.7) |
|
88 | haml (4.0.7) |
|
85 | tilt |
|
89 | tilt |
|
86 | haml-rails (0.9.0) |
|
90 | haml-rails (0.9.0) |
|
87 | actionpack (>= 4.0.1) |
|
91 | actionpack (>= 4.0.1) |
|
88 | activesupport (>= 4.0.1) |
|
92 | activesupport (>= 4.0.1) |
|
89 | haml (>= 4.0.6, < 5.0) |
|
93 | haml (>= 4.0.6, < 5.0) |
|
90 | html2haml (>= 1.0.1) |
|
94 | html2haml (>= 1.0.1) |
|
91 | railties (>= 4.0.1) |
|
95 | railties (>= 4.0.1) |
@@ -180,51 +184,53 | |||||
|
180 | actionpack (>= 4.0) |
|
184 | actionpack (>= 4.0) |
|
181 | activesupport (>= 4.0) |
|
185 | activesupport (>= 4.0) |
|
182 | sprockets (>= 3.0.0) |
|
186 | sprockets (>= 3.0.0) |
|
183 | sqlite3 (1.3.12) |
|
187 | sqlite3 (1.3.12) |
|
184 | thor (0.19.4) |
|
188 | thor (0.19.4) |
|
185 | thread_safe (0.3.5) |
|
189 | thread_safe (0.3.5) |
|
186 | tilt (2.0.5) |
|
190 | tilt (2.0.5) |
|
187 | tzinfo (1.2.2) |
|
191 | tzinfo (1.2.2) |
|
188 | thread_safe (~> 0.1) |
|
192 | thread_safe (~> 0.1) |
|
189 | uglifier (3.0.4) |
|
193 | uglifier (3.0.4) |
|
190 | execjs (>= 0.3.0, < 3) |
|
194 | execjs (>= 0.3.0, < 3) |
|
191 | will_paginate (3.0.12) |
|
195 | will_paginate (3.0.12) |
|
192 | yaml_db (0.4.2) |
|
196 | yaml_db (0.4.2) |
|
193 | rails (>= 3.0, < 5.1) |
|
197 | rails (>= 3.0, < 5.1) |
|
194 | rake (>= 0.8.7) |
|
198 | rake (>= 0.8.7) |
|
195 |
|
199 | ||
|
196 | PLATFORMS |
|
200 | PLATFORMS |
|
197 | ruby |
|
201 | ruby |
|
198 |
|
202 | ||
|
199 | DEPENDENCIES |
|
203 | DEPENDENCIES |
|
200 | ace-rails-ap |
|
204 | ace-rails-ap |
|
201 | activerecord-session_store |
|
205 | activerecord-session_store |
|
202 | autoprefixer-rails |
|
206 | autoprefixer-rails |
|
203 | best_in_place (~> 3.0.1) |
|
207 | best_in_place (~> 3.0.1) |
|
|
208 | + bootstrap-datepicker-rails | ||
|
204 | bootstrap-sass (~> 3.2.0) |
|
209 | bootstrap-sass (~> 3.2.0) |
|
205 | bootstrap-switch-rails |
|
210 | bootstrap-switch-rails |
|
206 | bootstrap-toggle-rails |
|
211 | bootstrap-toggle-rails |
|
|
212 | + bootstrap3-datetimepicker-rails | ||
|
207 | coffee-rails |
|
213 | coffee-rails |
|
208 | dynamic_form |
|
214 | dynamic_form |
|
209 | fuzzy-string-match |
|
215 | fuzzy-string-match |
|
210 | haml |
|
216 | haml |
|
211 | haml-rails |
|
217 | haml-rails |
|
212 | in_place_editing |
|
218 | in_place_editing |
|
213 | jquery-countdown-rails |
|
219 | jquery-countdown-rails |
|
214 | jquery-rails |
|
220 | jquery-rails |
|
215 | jquery-tablesorter |
|
221 | jquery-tablesorter |
|
216 | jquery-timepicker-addon-rails |
|
222 | jquery-timepicker-addon-rails |
|
217 | jquery-ui-rails |
|
223 | jquery-ui-rails |
|
218 |
|
224 | ||
|
219 | minitest-reporters |
|
225 | minitest-reporters |
|
220 | momentjs-rails |
|
226 | momentjs-rails |
|
221 | mysql2 |
|
227 | mysql2 |
|
222 | rails (~> 4.2.0) |
|
228 | rails (~> 4.2.0) |
|
223 | rails_bootstrap_sortable |
|
229 | rails_bootstrap_sortable |
|
224 | rdiscount |
|
230 | rdiscount |
|
225 | rouge |
|
231 | rouge |
|
226 | sass-rails |
|
232 | sass-rails |
|
227 | select2-rails |
|
233 | select2-rails |
|
228 | sqlite3 |
|
234 | sqlite3 |
|
229 | uglifier |
|
235 | uglifier |
|
230 | verification! |
|
236 | verification! |
@@ -11,31 +11,33 | |||||
|
11 | // GO AFTER THE REQUIRES BELOW. |
|
11 | // GO AFTER THE REQUIRES BELOW. |
|
12 | // |
|
12 | // |
|
13 | //= require jquery |
|
13 | //= require jquery |
|
14 | //= require jquery_ujs |
|
14 | //= require jquery_ujs |
|
15 | //= require jquery-ui |
|
15 | //= require jquery-ui |
|
16 | //= require bootstrap-sprockets |
|
16 | //= require bootstrap-sprockets |
|
17 | //= require moment |
|
17 | //= require moment |
|
18 | //= require bootstrap-sortable |
|
18 | //= require bootstrap-sortable |
|
19 | //= require select2 |
|
19 | //= require select2 |
|
20 | //= require ace-rails-ap |
|
20 | //= require ace-rails-ap |
|
21 | //= require ace/mode-c_cpp |
|
21 | //= require ace/mode-c_cpp |
|
22 | //= require ace/mode-python |
|
22 | //= require ace/mode-python |
|
23 | //= require ace/mode-ruby |
|
23 | //= require ace/mode-ruby |
|
24 | //= require ace/mode-pascal |
|
24 | //= require ace/mode-pascal |
|
25 | //= require ace/mode-javascript |
|
25 | //= require ace/mode-javascript |
|
26 | //= require ace/mode-java |
|
26 | //= require ace/mode-java |
|
27 | //= require ace/theme-merbivore |
|
27 | //= require ace/theme-merbivore |
|
28 | //= require custom |
|
28 | //= require custom |
|
29 | //= require jquery.countdown |
|
29 | //= require jquery.countdown |
|
30 | //-------------- addition from local_jquery ----------- |
|
30 | //-------------- addition from local_jquery ----------- |
|
31 | //= require jquery-tablesorter |
|
31 | //= require jquery-tablesorter |
|
32 | //= require best_in_place |
|
32 | //= require best_in_place |
|
33 | //= require best_in_place.jquery-ui |
|
33 | //= require best_in_place.jquery-ui |
|
34 | //= require brython |
|
34 | //= require brython |
|
|
35 | + //= require bootstrap-datepicker | ||
|
|
36 | + //= require bootstrap-datetimepicker | ||
|
35 |
|
37 | ||
|
36 | // since this is after blank line, it is not downloaded |
|
38 | // since this is after blank line, it is not downloaded |
|
37 | //x= require prototype |
|
39 | //x= require prototype |
|
38 | //x= require prototype_ujs |
|
40 | //x= require prototype_ujs |
|
39 | //x= require effects |
|
41 | //x= require effects |
|
40 | //x= require dragdrop |
|
42 | //x= require dragdrop |
|
41 | //x= require controls |
|
43 | //x= require controls |
@@ -12,48 +12,50 | |||||
|
12 | * // bootstrap says that we should not do this, but @import each file instead |
|
12 | * // bootstrap says that we should not do this, but @import each file instead |
|
13 | * # *= require_tree . |
|
13 | * # *= require_tree . |
|
14 | * # *= require_self |
|
14 | * # *= require_self |
|
15 | */ |
|
15 | */ |
|
16 |
|
16 | ||
|
17 | @import "jquery-ui"; |
|
17 | @import "jquery-ui"; |
|
18 | //@import "jquery.ui.core"; |
|
18 | //@import "jquery.ui.core"; |
|
19 | //@import "jquery.ui.theme"; |
|
19 | //@import "jquery.ui.theme"; |
|
20 | //@import "jquery.ui.datepicker"; |
|
20 | //@import "jquery.ui.datepicker"; |
|
21 | //@import "jquery.ui.slider"; |
|
21 | //@import "jquery.ui.slider"; |
|
22 | @import "jquery-ui-timepicker-addon"; |
|
22 | @import "jquery-ui-timepicker-addon"; |
|
23 | @import "jquery-tablesorter/theme.metro-dark"; |
|
23 | @import "jquery-tablesorter/theme.metro-dark"; |
|
24 | @import "jquery.countdown"; |
|
24 | @import "jquery.countdown"; |
|
25 | @import "tablesorter-theme.cafe"; |
|
25 | @import "tablesorter-theme.cafe"; |
|
26 |
|
26 | ||
|
27 | //bootstrap |
|
27 | //bootstrap |
|
28 | @import "bootstrap-sprockets"; |
|
28 | @import "bootstrap-sprockets"; |
|
29 | @import "bootstrap"; |
|
29 | @import "bootstrap"; |
|
30 | @import "select2"; |
|
30 | @import "select2"; |
|
31 | @import "select2-bootstrap"; |
|
31 | @import "select2-bootstrap"; |
|
32 |
|
32 | ||
|
33 | //@import bootstrap3-switch |
|
33 | //@import bootstrap3-switch |
|
34 | @import "bootstrap-toggle"; |
|
34 | @import "bootstrap-toggle"; |
|
35 | @import "bootstrap-sortable"; |
|
35 | @import "bootstrap-sortable"; |
|
|
36 | + @import "bootstrap-datepicker3"; | ||
|
|
37 | + @import "bootstrap-datetimepicker"; | ||
|
36 |
|
38 | ||
|
37 | //bootstrap navbar color (from) |
|
39 | //bootstrap navbar color (from) |
|
38 | $bgDefault: #19197b; |
|
40 | $bgDefault: #19197b; |
|
39 | $bgHighlight: #06064b; |
|
41 | $bgHighlight: #06064b; |
|
40 | $colDefault: #8e8eb4; |
|
42 | $colDefault: #8e8eb4; |
|
41 | $colHighlight: #ffffff; |
|
43 | $colHighlight: #ffffff; |
|
42 | $dropDown: false; |
|
44 | $dropDown: false; |
|
43 |
|
45 | ||
|
44 | @font-face { |
|
46 | @font-face { |
|
45 | font-family: 'Glyphicons Halflings'; |
|
47 | font-family: 'Glyphicons Halflings'; |
|
46 | src: font-path('bootstrap/glyphicons-halflings-regular.eot'); |
|
48 | src: font-path('bootstrap/glyphicons-halflings-regular.eot'); |
|
47 | src: font-path('bootstrap/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), |
|
49 | src: font-path('bootstrap/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), |
|
48 | font-path('bootstrap/glyphicons-halflings-regular.woff') format('woff'), |
|
50 | font-path('bootstrap/glyphicons-halflings-regular.woff') format('woff'), |
|
49 | font-path('bootstrap/glyphicons-halflings-regular.ttf') format('truetype'), |
|
51 | font-path('bootstrap/glyphicons-halflings-regular.ttf') format('truetype'), |
|
50 | font-path('bootstrap/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg'); |
|
52 | font-path('bootstrap/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg'); |
|
51 | } |
|
53 | } |
|
52 |
|
54 | ||
|
53 |
|
55 | ||
|
54 | .navbar-default { |
|
56 | .navbar-default { |
|
55 | background-color: $bgDefault; |
|
57 | background-color: $bgDefault; |
|
56 | border-color: $bgHighlight; |
|
58 | border-color: $bgHighlight; |
|
57 |
|
59 | ||
|
58 | .navbar-brand { |
|
60 | .navbar-brand { |
|
59 | color: $colDefault; |
|
61 | color: $colDefault; |
@@ -237,52 +237,49 | |||||
|
237 | end |
|
237 | end |
|
238 |
|
238 | ||
|
239 | def remove_contest |
|
239 | def remove_contest |
|
240 | problem = Problem.find(params[:id]) |
|
240 | problem = Problem.find(params[:id]) |
|
241 | contest = Contest.find(params[:contest_id]) |
|
241 | contest = Contest.find(params[:contest_id]) |
|
242 | if problem!=nil and contest!=nil |
|
242 | if problem!=nil and contest!=nil |
|
243 | problem.contests.delete(contest) |
|
243 | problem.contests.delete(contest) |
|
244 | end |
|
244 | end |
|
245 | redirect_to :action => 'manage' |
|
245 | redirect_to :action => 'manage' |
|
246 | end |
|
246 | end |
|
247 |
|
247 | ||
|
248 | ################################## |
|
248 | ################################## |
|
249 | protected |
|
249 | protected |
|
250 |
|
250 | ||
|
251 | def allow_test_pair_import? |
|
251 | def allow_test_pair_import? |
|
252 | if defined? ALLOW_TEST_PAIR_IMPORT |
|
252 | if defined? ALLOW_TEST_PAIR_IMPORT |
|
253 | return ALLOW_TEST_PAIR_IMPORT |
|
253 | return ALLOW_TEST_PAIR_IMPORT |
|
254 | else |
|
254 | else |
|
255 | return false |
|
255 | return false |
|
256 | end |
|
256 | end |
|
257 | end |
|
257 | end |
|
258 |
|
258 | ||
|
259 | def change_date_added |
|
259 | def change_date_added |
|
260 | problems = get_problems_from_params |
|
260 | problems = get_problems_from_params |
|
261 |
- |
|
261 | + date = Date.parse(params[:date_added]) |
|
262 | - month = params[:date_added][:month].to_i |
|
||
|
263 | - day = params[:date_added][:day].to_i |
|
||
|
264 | - date = Date.new(year,month,day) |
|
||
|
265 | problems.each do |p| |
|
262 | problems.each do |p| |
|
266 | p.date_added = date |
|
263 | p.date_added = date |
|
267 | p.save |
|
264 | p.save |
|
268 | end |
|
265 | end |
|
269 | end |
|
266 | end |
|
270 |
|
267 | ||
|
271 | def add_to_contest |
|
268 | def add_to_contest |
|
272 | problems = get_problems_from_params |
|
269 | problems = get_problems_from_params |
|
273 | contest = Contest.find(params[:contest][:id]) |
|
270 | contest = Contest.find(params[:contest][:id]) |
|
274 | if contest!=nil and contest.enabled |
|
271 | if contest!=nil and contest.enabled |
|
275 | problems.each do |p| |
|
272 | problems.each do |p| |
|
276 | p.contests << contest |
|
273 | p.contests << contest |
|
277 | end |
|
274 | end |
|
278 | end |
|
275 | end |
|
279 | end |
|
276 | end |
|
280 |
|
277 | ||
|
281 | def set_available(avail) |
|
278 | def set_available(avail) |
|
282 | problems = get_problems_from_params |
|
279 | problems = get_problems_from_params |
|
283 | problems.each do |p| |
|
280 | problems.each do |p| |
|
284 | p.available = avail |
|
281 | p.available = avail |
|
285 | p.save |
|
282 | p.save |
|
286 | end |
|
283 | end |
|
287 | end |
|
284 | end |
|
288 |
|
285 |
@@ -26,69 +26,82 | |||||
|
26 | } |
|
26 | } |
|
27 | shiftclick(start,stop,$(this).is(':checked') ) |
|
27 | shiftclick(start,stop,$(this).is(':checked') ) |
|
28 | } |
|
28 | } |
|
29 | start = orig_stop |
|
29 | start = orig_stop |
|
30 | } else { |
|
30 | } else { |
|
31 | start = parseInt($(this).attr('id').split('-')[2]); |
|
31 | start = parseInt($(this).attr('id').split('-')[2]); |
|
32 | } |
|
32 | } |
|
33 | }); |
|
33 | }); |
|
34 | }); |
|
34 | }); |
|
35 |
|
35 | ||
|
36 |
|
36 | ||
|
37 | %h1 Manage problems |
|
37 | %h1 Manage problems |
|
38 |
|
38 | ||
|
39 | %p= link_to '[Back to problem list]', problems_path |
|
39 | %p= link_to '[Back to problem list]', problems_path |
|
40 |
|
40 | ||
|
41 | = form_tag :action=>'do_manage' do |
|
41 | = form_tag :action=>'do_manage' do |
|
42 | .panel.panel-primary |
|
42 | .panel.panel-primary |
|
43 | .panel-heading |
|
43 | .panel-heading |
|
44 | Action |
|
44 | Action |
|
45 | .panel-body |
|
45 | .panel-body |
|
46 | .submit-box |
|
46 | .submit-box |
|
47 | What do you want to do to the selected problem? |
|
47 | What do you want to do to the selected problem? |
|
48 | %br/ |
|
48 | %br/ |
|
49 | (You can shift-click to select a range of problems) |
|
49 | (You can shift-click to select a range of problems) |
|
50 | - %ul |
|
50 | + %ul.form-inline |
|
51 | %li |
|
51 | %li |
|
52 | Change date added to |
|
52 | Change date added to |
|
53 | - = select_date Date.current, :prefix => 'date_added' |
|
53 | + .input-group.date |
|
|
54 | + = text_field_tag :date_added, class: 'form-control' | ||
|
|
55 | + %span.input-group-addon | ||
|
|
56 | + %span.glyphicon.glyphicon-calendar | ||
|
|
57 | + -# = select_date Date.current, :prefix => 'date_added' | ||
|
54 | |
|
58 | |
|
55 |
- = submit_tag 'Change', :name => 'change_date_added', class: 'btn btn- |
|
59 | + = submit_tag 'Change', :name => 'change_date_added', class: 'btn btn-primary btn-sm' |
|
56 | %li |
|
60 | %li |
|
57 | Set available to |
|
61 | Set available to |
|
58 |
- = submit_tag 'True', :name => 'enable_problem', class: 'btn btn- |
|
62 | + = submit_tag 'True', :name => 'enable_problem', class: 'btn btn-primary btn-sm' |
|
59 |
- = submit_tag 'False', :name => 'disable_problem', class: 'btn btn- |
|
63 | + = submit_tag 'False', :name => 'disable_problem', class: 'btn btn-primary btn-sm' |
|
60 |
|
64 | ||
|
61 | - if GraderConfiguration.multicontests? |
|
65 | - if GraderConfiguration.multicontests? |
|
62 | %li |
|
66 | %li |
|
63 | Add to |
|
67 | Add to |
|
64 | = select("contest","id",Contest.all.collect {|c| [c.title, c.id]}) |
|
68 | = select("contest","id",Contest.all.collect {|c| [c.title, c.id]}) |
|
65 |
- = submit_tag 'Add', :name => 'add_to_contest', class: 'btn btn- |
|
69 | + = submit_tag 'Add', :name => 'add_to_contest', class: 'btn btn-primary btn-sm' |
|
66 | %li |
|
70 | %li |
|
67 | Add problems to group |
|
71 | Add problems to group |
|
68 | = select_tag "group_id", options_from_collection_for_select( Group.all, 'id','name',params[:group_name]), id: 'group_name',class: 'select2' |
|
72 | = select_tag "group_id", options_from_collection_for_select( Group.all, 'id','name',params[:group_name]), id: 'group_name',class: 'select2' |
|
69 | = submit_tag 'Add', name: 'add_group', class: 'btn btn-default' |
|
73 | = submit_tag 'Add', name: 'add_group', class: 'btn btn-default' |
|
70 |
|
74 | ||
|
71 |
|
75 | ||
|
72 | %table.table.table-hover |
|
76 | %table.table.table-hover |
|
73 | %tr{style: "text-align: left;"} |
|
77 | %tr{style: "text-align: left;"} |
|
74 | %th= check_box_tag 'select_all' |
|
78 | %th= check_box_tag 'select_all' |
|
75 | %th Name |
|
79 | %th Name |
|
76 | %th Full name |
|
80 | %th Full name |
|
77 | %th Available |
|
81 | %th Available |
|
78 | %th Date added |
|
82 | %th Date added |
|
79 | - if GraderConfiguration.multicontests? |
|
83 | - if GraderConfiguration.multicontests? |
|
80 | %th Contests |
|
84 | %th Contests |
|
81 |
|
85 | ||
|
82 | - num = 0 |
|
86 | - num = 0 |
|
83 | - for problem in @problems |
|
87 | - for problem in @problems |
|
84 | - num += 1 |
|
88 | - num += 1 |
|
85 | %tr{:id => "row-prob-#{problem.id}", :name=> "prob-#{problem.id}"} |
|
89 | %tr{:id => "row-prob-#{problem.id}", :name=> "prob-#{problem.id}"} |
|
86 | %td= check_box_tag "prob-#{problem.id}-#{num}" |
|
90 | %td= check_box_tag "prob-#{problem.id}-#{num}" |
|
87 | %td= problem.name |
|
91 | %td= problem.name |
|
88 | %td= problem.full_name |
|
92 | %td= problem.full_name |
|
89 | %td= problem.available |
|
93 | %td= problem.available |
|
90 | %td= problem.date_added |
|
94 | %td= problem.date_added |
|
91 | - if GraderConfiguration.multicontests? |
|
95 | - if GraderConfiguration.multicontests? |
|
92 | %td |
|
96 | %td |
|
93 | - problem.contests.each do |contest| |
|
97 | - problem.contests.each do |contest| |
|
94 | = "(#{contest.name} [#{link_to 'x', :action => 'remove_contest', :id => problem.id, :contest_id => contest.id }])" |
|
98 | = "(#{contest.name} [#{link_to 'x', :action => 'remove_contest', :id => problem.id, :contest_id => contest.id }])" |
|
|
99 | + | ||
|
|
100 | + :javascript | ||
|
|
101 | + $('.input-group.date').datetimepicker({ | ||
|
|
102 | + format: 'DD/MMM/YYYY', | ||
|
|
103 | + showTodayButton: true, | ||
|
|
104 | + widgetPositioning: {horizontal: 'auto', vertical: 'bottom'}, | ||
|
|
105 | + | ||
|
|
106 | + }); | ||
|
|
107 | + |
@@ -1,24 +1,35 | |||||
|
1 | %h1 Editing site |
|
1 | %h1 Editing site |
|
2 | = error_messages_for :site |
|
2 | = error_messages_for :site |
|
3 | = form_for(@site) do |f| |
|
3 | = form_for(@site) do |f| |
|
4 | - %p |
|
4 | + .row |
|
5 | - %b Name |
|
5 | + .col-md-4 |
|
6 | - %br/ |
|
6 | + .form-group.field |
|
7 | - = f.text_field :name |
|
7 | + = f.label :name, "Name" |
|
8 | - %p |
|
8 | + = f.text_field :name, class: 'form-control' |
|
9 | - %b Password |
|
9 | + .form-group.field |
|
10 | - %br/ |
|
10 | + = f.label :password, "Password" |
|
11 | - = f.text_field :password |
|
11 | + = f.text_field :password, class: 'form-control' |
|
12 | - %p |
|
12 | + .form-group.field |
|
13 | - %b Started |
|
13 | + = f.label :started, "Started" |
|
14 | - %br/ |
|
14 | + = f.check_box :started, class: 'form-control' |
|
15 | - = f.check_box :started |
|
15 | + .form-group.field |
|
16 | - %p |
|
16 | + = f.label :start_time, "Start time" |
|
17 | - %b Start time |
|
17 | + -# = f.datetime_select :start_time, :include_blank => true |
|
18 | - %br/ |
|
18 | + .input-group.date |
|
19 | - = f.datetime_select :start_time, :include_blank => true |
|
19 | + = f.text_field :start_time, class:'form-control' , value: (@site.start_time ? @site.start_time.strftime('%d/%b/%Y %H:%M') : '') |
|
20 | - %p |
|
20 | + %span.input-group-addon |
|
21 | - = f.submit "Update" |
|
21 | + %span.glyphicon.glyphicon-calendar |
|
|
22 | + .actions | ||
|
|
23 | + = f.submit "Update", class: 'btn btn-primary' | ||
|
|
24 | + .col-md-8 | ||
|
|
25 | + | ||
|
22 | = link_to 'Show', @site |
|
26 | = link_to 'Show', @site |
|
23 | | |
|
27 | | |
|
24 | = link_to 'Back', sites_path |
|
28 | = link_to 'Back', sites_path |
|
|
29 | + | ||
|
|
30 | + | ||
|
|
31 | + :javascript | ||
|
|
32 | + $('.input-group.date').datetimepicker({ | ||
|
|
33 | + format: 'DD/MMM/YYYY HH:mm', | ||
|
|
34 | + }); | ||
|
|
35 | + |
You need to be logged in to leave comments.
Login now