Description:
- countdown timer
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r572:10160025d8ee - - 9 files changed: 61 inserted, 10 deleted

@@ -47,6 +47,7
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'
@@ -71,6 +71,7
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)
@@ -182,6 +183,7
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
@@ -17,7 +17,6
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
@@ -25,7 +24,15
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
@@ -14,7 +14,7
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
@@ -38,10 +38,15
38 target.text '...'
38 target.text '...'
39 return
39 return
40
40
41 +
41 #ace editor
42 #ace editor
43 + if $("#editor").length > 0
42 e = ace.edit("editor")
44 e = ace.edit("editor")
43 e.setTheme('ace/theme/merbivore')
45 e.setTheme('ace/theme/merbivore')
44 e.getSession().setTabSize(2)
46 e.getSession().setTabSize(2)
45 e.getSession().setUseSoftTabs(true)
47 e.getSession().setUseSoftTabs(true)
46
48
49 + #best in place
50 + jQuery(".best_in_place").best_in_place()
51 +
47 return
52 return
@@ -17,12 +17,12
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
@@ -134,6 +134,7
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 = ''
@@ -1,5 +1,5
1 - - content_for :header do
1 + /- content_for :header do
2 - = javascript_include_tag 'local_jquery'
2 + / = javascript_include_tag 'local_jquery'
3
3
4 %h1 System configuration
4 %h1 System configuration
5
5
@@ -13,9 +13,11
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
@@ -18,6 +18,19
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"}
@@ -45,8 +58,6
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')
@@ -22,6 +22,28
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
You need to be logged in to leave comments. Login now