Description:
- countdown timer
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r572:10160025d8ee - - 9 files changed: 65 inserted, 14 deleted
@@ -38,24 +38,25 | |||||
|
38 | # To use debugger |
|
38 | # To use debugger |
|
39 | # gem 'debugger' |
|
39 | # gem 'debugger' |
|
40 | # |
|
40 | # |
|
41 |
|
41 | ||
|
42 | #in-place editor |
|
42 | #in-place editor |
|
43 | gem 'best_in_place', '~> 3.0.1' |
|
43 | gem 'best_in_place', '~> 3.0.1' |
|
44 |
|
44 | ||
|
45 | # jquery addition |
|
45 | # jquery addition |
|
46 | gem 'jquery-rails' |
|
46 | gem 'jquery-rails' |
|
47 | gem 'jquery-ui-sass-rails' |
|
47 | gem 'jquery-ui-sass-rails' |
|
48 | gem 'jquery-timepicker-addon-rails' |
|
48 | gem 'jquery-timepicker-addon-rails' |
|
49 | gem 'jquery-tablesorter' |
|
49 | gem 'jquery-tablesorter' |
|
|
50 | + gem 'jquery-countdown-rails' | ||
|
50 |
|
51 | ||
|
51 | #syntax highlighter |
|
52 | #syntax highlighter |
|
52 | gem 'rouge' |
|
53 | gem 'rouge' |
|
53 |
|
54 | ||
|
54 | #add bootstrap |
|
55 | #add bootstrap |
|
55 | gem 'bootstrap-sass', '~> 3.2.0' |
|
56 | gem 'bootstrap-sass', '~> 3.2.0' |
|
56 | gem 'bootstrap-switch-rails' |
|
57 | gem 'bootstrap-switch-rails' |
|
57 | gem 'bootstrap-toggle-rails' |
|
58 | gem 'bootstrap-toggle-rails' |
|
58 | gem 'autoprefixer-rails' |
|
59 | gem 'autoprefixer-rails' |
|
59 |
|
60 | ||
|
60 | #bootstrap sortable |
|
61 | #bootstrap sortable |
|
61 | gem 'momentjs-rails' |
|
62 | gem 'momentjs-rails' |
@@ -62,24 +62,25 | |||||
|
62 | execjs (2.3.0) |
|
62 | execjs (2.3.0) |
|
63 | haml (4.0.6) |
|
63 | haml (4.0.6) |
|
64 | tilt |
|
64 | tilt |
|
65 | haml-rails (0.4) |
|
65 | haml-rails (0.4) |
|
66 | actionpack (>= 3.1, < 4.1) |
|
66 | actionpack (>= 3.1, < 4.1) |
|
67 | activesupport (>= 3.1, < 4.1) |
|
67 | activesupport (>= 3.1, < 4.1) |
|
68 | haml (>= 3.1, < 4.1) |
|
68 | haml (>= 3.1, < 4.1) |
|
69 | railties (>= 3.1, < 4.1) |
|
69 | railties (>= 3.1, < 4.1) |
|
70 | hike (1.2.3) |
|
70 | hike (1.2.3) |
|
71 | i18n (0.7.0) |
|
71 | i18n (0.7.0) |
|
72 | in_place_editing (1.2.0) |
|
72 | in_place_editing (1.2.0) |
|
73 | journey (1.0.4) |
|
73 | journey (1.0.4) |
|
|
74 | + jquery-countdown-rails (2.0.2) | ||
|
74 | jquery-rails (3.1.2) |
|
75 | jquery-rails (3.1.2) |
|
75 | railties (>= 3.0, < 5.0) |
|
76 | railties (>= 3.0, < 5.0) |
|
76 | thor (>= 0.14, < 2.0) |
|
77 | thor (>= 0.14, < 2.0) |
|
77 | jquery-tablesorter (1.13.4) |
|
78 | jquery-tablesorter (1.13.4) |
|
78 | railties (>= 3.1, < 5) |
|
79 | railties (>= 3.1, < 5) |
|
79 | jquery-timepicker-addon-rails (1.4.1) |
|
80 | jquery-timepicker-addon-rails (1.4.1) |
|
80 | railties (>= 3.1) |
|
81 | railties (>= 3.1) |
|
81 | jquery-ui-rails (4.0.3) |
|
82 | jquery-ui-rails (4.0.3) |
|
82 | jquery-rails |
|
83 | jquery-rails |
|
83 | railties (>= 3.1.0) |
|
84 | railties (>= 3.1.0) |
|
84 | jquery-ui-sass-rails (4.0.3.0) |
|
85 | jquery-ui-sass-rails (4.0.3.0) |
|
85 | jquery-rails |
|
86 | jquery-rails |
@@ -173,24 +174,25 | |||||
|
173 | DEPENDENCIES |
|
174 | DEPENDENCIES |
|
174 | ace-rails-ap |
|
175 | ace-rails-ap |
|
175 | autoprefixer-rails |
|
176 | autoprefixer-rails |
|
176 | best_in_place (~> 3.0.1) |
|
177 | best_in_place (~> 3.0.1) |
|
177 | bootstrap-sass (~> 3.2.0) |
|
178 | bootstrap-sass (~> 3.2.0) |
|
178 | bootstrap-switch-rails |
|
179 | bootstrap-switch-rails |
|
179 | bootstrap-toggle-rails |
|
180 | bootstrap-toggle-rails |
|
180 | coffee-rails (~> 3.2.2) |
|
181 | coffee-rails (~> 3.2.2) |
|
181 | dynamic_form |
|
182 | dynamic_form |
|
182 | haml |
|
183 | haml |
|
183 | haml-rails |
|
184 | haml-rails |
|
184 | in_place_editing |
|
185 | in_place_editing |
|
|
186 | + jquery-countdown-rails | ||
|
185 | jquery-rails |
|
187 | jquery-rails |
|
186 | jquery-tablesorter |
|
188 | jquery-tablesorter |
|
187 | jquery-timepicker-addon-rails |
|
189 | jquery-timepicker-addon-rails |
|
188 | jquery-ui-sass-rails |
|
190 | jquery-ui-sass-rails |
|
189 |
|
191 | ||
|
190 | momentjs-rails |
|
192 | momentjs-rails |
|
191 | mysql2 |
|
193 | mysql2 |
|
192 | prototype-rails |
|
194 | prototype-rails |
|
193 | rails (= 3.2.21) |
|
195 | rails (= 3.2.21) |
|
194 | rails_bootstrap_sortable |
|
196 | rails_bootstrap_sortable |
|
195 | rdiscount |
|
197 | rdiscount |
|
196 | rouge |
|
198 | rouge |
@@ -8,28 +8,35 | |||||
|
8 | // the compiled file. |
|
8 | // the compiled file. |
|
9 | // |
|
9 | // |
|
10 | // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD |
|
10 | // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD |
|
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.all |
|
15 | //= require jquery.ui.all |
|
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 custom |
|
||
|
21 | //= require ace-rails-ap |
|
20 | //= require ace-rails-ap |
|
22 | //= require ace/mode-c_cpp |
|
21 | //= require ace/mode-c_cpp |
|
23 | //= require ace/mode-ruby |
|
22 | //= require ace/mode-ruby |
|
24 | //= require ace/mode-pascal |
|
23 | //= require ace/mode-pascal |
|
25 | //= require ace/mode-javascript |
|
24 | //= require ace/mode-javascript |
|
26 | //= require ace/mode-java |
|
25 | //= require ace/mode-java |
|
27 | //= require ace/theme-merbivore |
|
26 | //= require ace/theme-merbivore |
|
28 | - |
|
27 | + //= require custom |
|
|
28 | + //= require jquery.countdown | ||
|
|
29 | + //-------------- addition from local_jquery ----------- | ||
|
|
30 | + //= require jquery.ui.datepicker | ||
|
|
31 | + //= require jquery.ui.slider | ||
|
|
32 | + //= require jquery-ui-timepicker-addon | ||
|
|
33 | + //= require jquery-tablesorter | ||
|
|
34 | + //= require best_in_place | ||
|
|
35 | + //= require best_in_place.jquery-ui | ||
|
29 |
|
36 | ||
|
30 | // since this is after blank line, it is not downloaded |
|
37 | // since this is after blank line, it is not downloaded |
|
31 | //x= require prototype |
|
38 | //x= require prototype |
|
32 | //x= require prototype_ujs |
|
39 | //x= require prototype_ujs |
|
33 | //x= require effects |
|
40 | //x= require effects |
|
34 | //x= require dragdrop |
|
41 | //x= require dragdrop |
|
35 | //x= require controls |
|
42 | //x= require controls |
@@ -5,43 +5,48 | |||||
|
5 | input.trigger 'fileselect', [ |
|
5 | input.trigger 'fileselect', [ |
|
6 | numFiles |
|
6 | numFiles |
|
7 | label |
|
7 | label |
|
8 | ] |
|
8 | ] |
|
9 | return |
|
9 | return |
|
10 |
|
10 | ||
|
11 |
|
11 | ||
|
12 | # document ready |
|
12 | # document ready |
|
13 |
|
13 | ||
|
14 | $ -> |
|
14 | $ -> |
|
15 | $(".select2").select2() |
|
15 | $(".select2").select2() |
|
16 | #$(".bootstrap-switch").bootstrapSwitch() |
|
16 | #$(".bootstrap-switch").bootstrapSwitch() |
|
17 | - $(".bootstrap-toggle").bootstrapToggle() |
|
17 | + #$(".bootstrap-toggle").bootstrapToggle() |
|
18 | $('.btn-file :file').on 'fileselect', (event, numFiles, label) -> |
|
18 | $('.btn-file :file').on 'fileselect', (event, numFiles, label) -> |
|
19 | input = $(this).parents('.input-group').find(':text') |
|
19 | input = $(this).parents('.input-group').find(':text') |
|
20 | log = if numFiles > 1 then numFiles + ' files selected' else label |
|
20 | log = if numFiles > 1 then numFiles + ' files selected' else label |
|
21 | if input.length |
|
21 | if input.length |
|
22 | input.val log |
|
22 | input.val log |
|
23 | else |
|
23 | else |
|
24 | if log |
|
24 | if log |
|
25 | alert log |
|
25 | alert log |
|
26 | return |
|
26 | return |
|
27 | $(".go-button").on 'click', (event) -> |
|
27 | $(".go-button").on 'click', (event) -> |
|
28 | link = $(this).attr("data-source") |
|
28 | link = $(this).attr("data-source") |
|
29 | url = $(link).val() |
|
29 | url = $(link).val() |
|
30 | if url |
|
30 | if url |
|
31 | window.location.href = url |
|
31 | window.location.href = url |
|
32 | return |
|
32 | return |
|
33 | $('.ajax-toggle').on 'click', (event) -> |
|
33 | $('.ajax-toggle').on 'click', (event) -> |
|
34 | target = $(event.target) |
|
34 | target = $(event.target) |
|
35 | target.removeClass 'btn-default' |
|
35 | target.removeClass 'btn-default' |
|
36 | target.removeClass 'btn-success' |
|
36 | target.removeClass 'btn-success' |
|
37 | target.addClass 'btn-warning' |
|
37 | target.addClass 'btn-warning' |
|
38 | target.text '...' |
|
38 | target.text '...' |
|
39 | return |
|
39 | return |
|
40 |
|
40 | ||
|
|
41 | + | ||
|
41 | #ace editor |
|
42 | #ace editor |
|
42 | - e = ace.edit("editor") |
|
43 | + if $("#editor").length > 0 |
|
43 | - e.setTheme('ace/theme/merbivore') |
|
44 | + e = ace.edit("editor") |
|
44 | - e.getSession().setTabSize(2) |
|
45 | + e.setTheme('ace/theme/merbivore') |
|
45 |
- e.getSession().set |
|
46 | + e.getSession().setTabSize(2) |
|
|
47 | + e.getSession().setUseSoftTabs(true) | ||
|
|
48 | + | ||
|
|
49 | + #best in place | ||
|
|
50 | + jQuery(".best_in_place").best_in_place() | ||
|
46 |
|
51 | ||
|
47 | return |
|
52 | return |
@@ -8,30 +8,30 | |||||
|
8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the |
|
8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the |
|
9 | * compiled file so the styles you add here take precedence over styles defined in any styles |
|
9 | * compiled file so the styles you add here take precedence over styles defined in any styles |
|
10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new |
|
10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new |
|
11 | * file per style scope. |
|
11 | * file per style scope. |
|
12 | * |
|
12 | * |
|
13 | // bootstrap says that we should not do this, but @import each file instead |
|
13 | // bootstrap says that we should not do this, but @import each file instead |
|
14 | # *= require_tree . |
|
14 | # *= require_tree . |
|
15 | # *= require_self |
|
15 | # *= require_self |
|
16 | */ |
|
16 | */ |
|
17 |
|
17 | ||
|
18 | @import jquery.ui.all |
|
18 | @import jquery.ui.all |
|
19 | @import jquery.ui.core |
|
19 | @import jquery.ui.core |
|
20 | - @import jquery.ui.core |
|
||
|
21 | @import jquery.ui.theme |
|
20 | @import jquery.ui.theme |
|
22 | @import jquery.ui.datepicker |
|
21 | @import jquery.ui.datepicker |
|
23 | @import jquery.ui.slider |
|
22 | @import jquery.ui.slider |
|
24 | @import jquery-ui-timepicker-addon |
|
23 | @import jquery-ui-timepicker-addon |
|
25 | @import jquery-tablesorter/theme.metro-dark |
|
24 | @import jquery-tablesorter/theme.metro-dark |
|
|
25 | + @import jquery.countdown | ||
|
26 | @import tablesorter-theme.cafe |
|
26 | @import tablesorter-theme.cafe |
|
27 |
|
27 | ||
|
28 | //bootstrap |
|
28 | //bootstrap |
|
29 | @import bootstrap-sprockets |
|
29 | @import bootstrap-sprockets |
|
30 | @import bootstrap |
|
30 | @import bootstrap |
|
31 | @import select2 |
|
31 | @import select2 |
|
32 | @import select2-bootstrap |
|
32 | @import select2-bootstrap |
|
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 |
|
36 | ||
|
37 | //bootstrap navbar color (from) |
|
37 | //bootstrap navbar color (from) |
@@ -125,24 +125,25 | |||||
|
125 | 'ace/mode/c_cpp' |
|
125 | 'ace/mode/c_cpp' |
|
126 | when 'Ruby' |
|
126 | when 'Ruby' |
|
127 | 'ace/mode/ruby' |
|
127 | 'ace/mode/ruby' |
|
128 | when 'Python' |
|
128 | when 'Python' |
|
129 | 'ace/mode/python' |
|
129 | 'ace/mode/python' |
|
130 | when 'Java' |
|
130 | when 'Java' |
|
131 | 'ace/mode/java' |
|
131 | 'ace/mode/java' |
|
132 | else |
|
132 | else |
|
133 | 'ace/mode/c_cpp' |
|
133 | 'ace/mode/c_cpp' |
|
134 | end |
|
134 | end |
|
135 | end |
|
135 | end |
|
136 |
|
136 | ||
|
|
137 | + | ||
|
137 | def user_title_bar(user) |
|
138 | def user_title_bar(user) |
|
138 | header = '' |
|
139 | header = '' |
|
139 | time_left = '' |
|
140 | time_left = '' |
|
140 |
|
141 | ||
|
141 | # |
|
142 | # |
|
142 | # if the contest is over |
|
143 | # if the contest is over |
|
143 | if GraderConfiguration.time_limit_mode? |
|
144 | if GraderConfiguration.time_limit_mode? |
|
144 | if user.contest_finished? |
|
145 | if user.contest_finished? |
|
145 | header = <<CONTEST_OVER |
|
146 | header = <<CONTEST_OVER |
|
146 | <tr><td colspan="2" align="center"> |
|
147 | <tr><td colspan="2" align="center"> |
|
147 | <span class="contest-over-msg">THE CONTEST IS OVER</span> |
|
148 | <span class="contest-over-msg">THE CONTEST IS OVER</span> |
|
148 | </td></tr> |
|
149 | </td></tr> |
@@ -1,30 +1,32 | |||||
|
1 | - - content_for :header do |
|
1 | + /- content_for :header do |
|
2 |
- |
|
2 | + / = javascript_include_tag 'local_jquery' |
|
3 |
|
3 | ||
|
4 | %h1 System configuration |
|
4 | %h1 System configuration |
|
5 |
|
5 | ||
|
6 | %table.info |
|
6 | %table.info |
|
7 | %tr.info-head |
|
7 | %tr.info-head |
|
8 | %th Key |
|
8 | %th Key |
|
9 | %th Type |
|
9 | %th Type |
|
10 | %th Value |
|
10 | %th Value |
|
11 | %th Description |
|
11 | %th Description |
|
12 | - @configurations.each do |conf| |
|
12 | - @configurations.each do |conf| |
|
13 | - @grader_configuration = conf |
|
13 | - @grader_configuration = conf |
|
14 | %tr{:class => cycle("info-odd", "info-even")} |
|
14 | %tr{:class => cycle("info-odd", "info-even")} |
|
15 | %td |
|
15 | %td |
|
16 | - = in_place_editor_field :grader_configuration, :key, {}, :rows=>1 |
|
16 | + /= in_place_editor_field :grader_configuration, :key, {}, :rows=>1 |
|
|
17 | + = @grader_configuration.key | ||
|
17 | %td |
|
18 | %td |
|
18 | - = in_place_editor_field :grader_configuration, :value_type, {}, :rows=>1 |
|
19 | + /= in_place_editor_field :grader_configuration, :value_type, {}, :rows=>1 |
|
|
20 | + = @grader_configuration.value_type | ||
|
19 | %td |
|
21 | %td |
|
20 | = best_in_place @grader_configuration, :value, ok_button: "ok", cancel_button: "cancel" |
|
22 | = best_in_place @grader_configuration, :value, ok_button: "ok", cancel_button: "cancel" |
|
21 | %td= conf.description |
|
23 | %td= conf.description |
|
22 |
|
24 | ||
|
23 | - if GraderConfiguration.config_cached? |
|
25 | - if GraderConfiguration.config_cached? |
|
24 | %br/ |
|
26 | %br/ |
|
25 | Your config is saved, but it does not automatically take effect. |
|
27 | Your config is saved, but it does not automatically take effect. |
|
26 | %br/ |
|
28 | %br/ |
|
27 | If you have one mongrel process running, you can |
|
29 | If you have one mongrel process running, you can |
|
28 | = link_to '[click]', :action => 'reload' |
|
30 | = link_to '[click]', :action => 'reload' |
|
29 | here to reload. |
|
31 | here to reload. |
|
30 | %br/ |
|
32 | %br/ |
@@ -9,24 +9,37 | |||||
|
9 | %ul.nav.navbar-nav |
|
9 | %ul.nav.navbar-nav |
|
10 | - if (@current_user!=nil) and (GraderConfiguration.show_tasks_to?(@current_user)) |
|
10 | - if (@current_user!=nil) and (GraderConfiguration.show_tasks_to?(@current_user)) |
|
11 | //= add_menu("#{I18n.t 'menu.tasks'}", 'tasks', 'list') |
|
11 | //= add_menu("#{I18n.t 'menu.tasks'}", 'tasks', 'list') |
|
12 | %li.dropdown |
|
12 | %li.dropdown |
|
13 | %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"} |
|
13 | %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"} |
|
14 | = "#{I18n.t 'menu.submissions'}" |
|
14 | = "#{I18n.t 'menu.submissions'}" |
|
15 | %span.caret |
|
15 | %span.caret |
|
16 | %ul.dropdown-menu |
|
16 | %ul.dropdown-menu |
|
17 | = add_menu("View", 'main', 'submission') |
|
17 | = add_menu("View", 'main', 'submission') |
|
18 | = add_menu("Self Test", 'test', 'index') |
|
18 | = add_menu("Self Test", 'test', 'index') |
|
19 | - if GraderConfiguration['right.user_hall_of_fame'] |
|
19 | - if GraderConfiguration['right.user_hall_of_fame'] |
|
20 | = add_menu("#{I18n.t 'menu.hall_of_fame'}", 'report', 'problem_hof') |
|
20 | = add_menu("#{I18n.t 'menu.hall_of_fame'}", 'report', 'problem_hof') |
|
|
21 | + / display MODE button (with countdown in contest mode) | ||
|
|
22 | + - if GraderConfiguration.analysis_mode? | ||
|
|
23 | + %div.navbar-btn.btn.btn-success#countdown= "ANALYSIS MODE" | ||
|
|
24 | + - elsif GraderConfiguration.time_limit_mode? | ||
|
|
25 | + - if @current_user.contest_finished? | ||
|
|
26 | + %div.navbar-btn.btn.btn-danger#countdown= "Contest is over" | ||
|
|
27 | + - elsif !@current_user.contest_started? | ||
|
|
28 | + %div.navbar-btn.btn.btn-primary#countdown= (t 'title_bar.contest_not_started') | ||
|
|
29 | + - else | ||
|
|
30 | + %div.navbar-btn.btn.btn-primary#countdown asdf | ||
|
|
31 | + :javascript | ||
|
|
32 | + $("#countdown").countdown({until: "+#{@current_user.contest_time_left.to_i}s", layout: 'Time left: {hnn}:{mnn}:{snn}'}); | ||
|
|
33 | + / admin section | ||
|
21 | - if (@current_user!=nil) and (session[:admin]) |
|
34 | - if (@current_user!=nil) and (session[:admin]) |
|
22 | %li.dropdown |
|
35 | %li.dropdown |
|
23 | %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"} |
|
36 | %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"} |
|
24 | Manage |
|
37 | Manage |
|
25 | %span.caret |
|
38 | %span.caret |
|
26 | %ul.dropdown-menu |
|
39 | %ul.dropdown-menu |
|
27 | = add_menu( 'Announcements', 'announcements', 'index') |
|
40 | = add_menu( 'Announcements', 'announcements', 'index') |
|
28 | = add_menu( 'Problems', 'problems', 'index') |
|
41 | = add_menu( 'Problems', 'problems', 'index') |
|
29 | = add_menu( 'Users', 'user_admin', 'index') |
|
42 | = add_menu( 'Users', 'user_admin', 'index') |
|
30 | = add_menu( 'Graders', 'graders', 'list') |
|
43 | = add_menu( 'Graders', 'graders', 'list') |
|
31 | = add_menu( 'Message ', 'messages', 'console') |
|
44 | = add_menu( 'Message ', 'messages', 'console') |
|
32 | %li.divider{role: 'separator'} |
|
45 | %li.divider{role: 'separator'} |
@@ -36,26 +49,24 | |||||
|
36 | = add_menu( 'Contests', 'contest_management', 'index') |
|
49 | = add_menu( 'Contests', 'contest_management', 'index') |
|
37 | %li.dropdown |
|
50 | %li.dropdown |
|
38 | %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"} |
|
51 | %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"} |
|
39 | Report |
|
52 | Report |
|
40 | %span.caret |
|
53 | %span.caret |
|
41 | %ul.dropdown-menu |
|
54 | %ul.dropdown-menu |
|
42 | = add_menu( 'Results', 'user_admin', 'user_stat') |
|
55 | = add_menu( 'Results', 'user_admin', 'user_stat') |
|
43 | = add_menu( 'Report', 'report', 'multiple_login') |
|
56 | = add_menu( 'Report', 'report', 'multiple_login') |
|
44 | - if (ungraded = Submission.where('graded_at is null').where('submitted_at < ?', 1.minutes.ago).count) > 0 |
|
57 | - if (ungraded = Submission.where('graded_at is null').where('submitted_at < ?', 1.minutes.ago).count) > 0 |
|
45 | =link_to "#{ungraded} backlogs!", |
|
58 | =link_to "#{ungraded} backlogs!", |
|
46 | grader_list_path, |
|
59 | grader_list_path, |
|
47 | class: 'navbar-btn btn btn-default btn-warning', data: {toggle: 'tooltip'},title: 'Number of ungraded submission' |
|
60 | class: 'navbar-btn btn btn-default btn-warning', data: {toggle: 'tooltip'},title: 'Number of ungraded submission' |
|
48 | - =link_to 'Contest Mode, time remain: 00:20:33',grader_list_path, |
|
||
|
49 | - class: 'navbar-btn btn btn-primary' |
|
||
|
50 |
|
61 | ||
|
51 | %ul.nav.navbar-nav.navbar-right |
|
62 | %ul.nav.navbar-nav.navbar-right |
|
52 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-question-sign')}".html_safe, 'main', 'help') |
|
63 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-question-sign')}".html_safe, 'main', 'help') |
|
53 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-comment')}".html_safe, 'messages', 'list', {title: I18n.t('menu.messages'), data: {toggle: 'tooltip'}}) |
|
64 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-comment')}".html_safe, 'messages', 'list', {title: I18n.t('menu.messages'), data: {toggle: 'tooltip'}}) |
|
54 | - if GraderConfiguration['system.user_setting_enabled'] |
|
65 | - if GraderConfiguration['system.user_setting_enabled'] |
|
55 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-cog')}".html_safe, 'users', 'index', {title: I18n.t('menu.settings'), data: {toggle: 'tooltip'}}) |
|
66 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-cog')}".html_safe, 'users', 'index', {title: I18n.t('menu.settings'), data: {toggle: 'tooltip'}}) |
|
56 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-log-out')} #{@current_user.full_name}".html_safe, 'main', 'login', {title: I18n.t('menu.log_out'), data: {toggle: 'tooltip'}}) |
|
67 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-log-out')} #{@current_user.full_name}".html_safe, 'main', 'login', {title: I18n.t('menu.log_out'), data: {toggle: 'tooltip'}}) |
|
57 |
|
68 | ||
|
58 | / |
|
69 | / |
|
59 | - if (@current_user!=nil) and (session[:admin]) |
|
70 | - if (@current_user!=nil) and (session[:admin]) |
|
60 | %nav.navbar.navbar-fixed-top.navbar-inverse.secondnavbar |
|
71 | %nav.navbar.navbar-fixed-top.navbar-inverse.secondnavbar |
|
61 | .container-fluid |
|
72 | .container-fluid |
@@ -13,24 +13,46 | |||||
|
13 | = text_field 'user', 'full_name', :size => 10,class: 'form-control' |
|
13 | = text_field 'user', 'full_name', :size => 10,class: 'form-control' |
|
14 | .form-group |
|
14 | .form-group |
|
15 | = label_tag 'user_password', 'Password' |
|
15 | = label_tag 'user_password', 'Password' |
|
16 | = text_field 'user', 'password', :size => 10,class: 'form-control' |
|
16 | = text_field 'user', 'password', :size => 10,class: 'form-control' |
|
17 | .form-group |
|
17 | .form-group |
|
18 | = label_tag 'user_password_confirmation', 'Confirm' |
|
18 | = label_tag 'user_password_confirmation', 'Confirm' |
|
19 | = text_field 'user', 'password_confirmation', :size => 10,class: 'form-control' |
|
19 | = text_field 'user', 'password_confirmation', :size => 10,class: 'form-control' |
|
20 | .form-group |
|
20 | .form-group |
|
21 | = label_tag 'user_email', 'email' |
|
21 | = label_tag 'user_email', 'email' |
|
22 | = text_field 'user', 'email', :size => 10,class: 'form-control' |
|
22 | = text_field 'user', 'email', :size => 10,class: 'form-control' |
|
23 | =submit_tag "Create", class: 'btn btn-primary' |
|
23 | =submit_tag "Create", class: 'btn btn-primary' |
|
24 |
|
24 | ||
|
|
25 | + .panel.panel-primary | ||
|
|
26 | + .panel-title.panel-heading | ||
|
|
27 | + Import from site management | ||
|
|
28 | + .panel-body | ||
|
|
29 | + = form_tag( {method: 'post',multipart: true, action: 'import'}, {class: 'form-inline'}) do | ||
|
|
30 | + .form-group | ||
|
|
31 | + = label_tag 'user_login', 'Login' | ||
|
|
32 | + = text_field 'user', 'login', :size => 10,class: 'form-control' | ||
|
|
33 | + .form-group | ||
|
|
34 | + = label_tag 'user_full_name', 'Full Name' | ||
|
|
35 | + = text_field 'user', 'full_name', :size => 10,class: 'form-control' | ||
|
|
36 | + .form-group | ||
|
|
37 | + = label_tag 'user_password', 'Password' | ||
|
|
38 | + = text_field 'user', 'password', :size => 10,class: 'form-control' | ||
|
|
39 | + .form-group | ||
|
|
40 | + = label_tag 'user_password_confirmation', 'Confirm' | ||
|
|
41 | + = text_field 'user', 'password_confirmation', :size => 10,class: 'form-control' | ||
|
|
42 | + .form-group | ||
|
|
43 | + = label_tag 'user_email', 'email' | ||
|
|
44 | + = text_field 'user', 'email', :size => 10,class: 'form-control' | ||
|
|
45 | + =submit_tag "Create", class: 'btn btn-primary' | ||
|
|
46 | + | ||
|
25 | .submitbox |
|
47 | .submitbox |
|
26 | %b Import from site management |
|
48 | %b Import from site management |
|
27 | = form_tag({:action => 'import'}, :multipart => true) do |
|
49 | = form_tag({:action => 'import'}, :multipart => true) do |
|
28 | File: #{file_field_tag 'file'} #{submit_tag 'Import'} |
|
50 | File: #{file_field_tag 'file'} #{submit_tag 'Import'} |
|
29 | %br/ |
|
51 | %br/ |
|
30 | %b What else: |
|
52 | %b What else: |
|
31 | = link_to 'New user', {:action => 'new'}, { class: 'btn btn-default btn-sm'} |
|
53 | = link_to 'New user', {:action => 'new'}, { class: 'btn btn-default btn-sm'} |
|
32 | = link_to 'New list of users',{ :action => 'new_list'}, { class: 'btn btn-default btn-sm'} |
|
54 | = link_to 'New list of users',{ :action => 'new_list'}, { class: 'btn btn-default btn-sm'} |
|
33 | = link_to 'View administrators',{ :action => 'admin'}, { class: 'btn btn-default btn-sm'} |
|
55 | = link_to 'View administrators',{ :action => 'admin'}, { class: 'btn btn-default btn-sm'} |
|
34 | = link_to 'Random passwords',{ :action => 'random_all_passwords'}, { class: 'btn btn-default btn-sm'} |
|
56 | = link_to 'Random passwords',{ :action => 'random_all_passwords'}, { class: 'btn btn-default btn-sm'} |
|
35 | = link_to 'View active users',{ :action => 'active'}, { class: 'btn btn-default btn-sm'} |
|
57 | = link_to 'View active users',{ :action => 'active'}, { class: 'btn btn-default btn-sm'} |
|
36 | = link_to 'Mass mailing',{ :action => 'mass_mailing'}, { class: 'btn btn-default btn-sm'} |
|
58 | = link_to 'Mass mailing',{ :action => 'mass_mailing'}, { class: 'btn btn-default btn-sm'} |
You need to be logged in to leave comments.
Login now