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: 65 inserted, 14 deleted

@@ -1,79 +1,80
1 source 'https://rubygems.org'
1 source 'https://rubygems.org'
2
2
3 gem 'rails', '3.2.21'
3 gem 'rails', '3.2.21'
4
4
5 gem 'select2-rails'
5 gem 'select2-rails'
6
6
7 # Bundle edge Rails instead:
7 # Bundle edge Rails instead:
8 # gem 'rails', :git => 'git://github.com/rails/rails.git'
8 # gem 'rails', :git => 'git://github.com/rails/rails.git'
9
9
10 gem 'mysql2'
10 gem 'mysql2'
11
11
12 # Gems used only for assets and not required
12 # Gems used only for assets and not required
13 # in production environments by default.
13 # in production environments by default.
14 group :assets do
14 group :assets do
15 gem 'sass-rails', '~> 3.2.6'
15 gem 'sass-rails', '~> 3.2.6'
16 gem 'coffee-rails', '~> 3.2.2'
16 gem 'coffee-rails', '~> 3.2.2'
17
17
18 # See https://github.com/sstephenson/execjs#readme for more supported runtimes
18 # See https://github.com/sstephenson/execjs#readme for more supported runtimes
19 # gem 'therubyracer', :platforms => :ruby
19 # gem 'therubyracer', :platforms => :ruby
20
20
21 gem 'uglifier'
21 gem 'uglifier'
22 end
22 end
23
23
24 gem 'prototype-rails'
24 gem 'prototype-rails'
25
25
26 # To use ActiveModel has_secure_password
26 # To use ActiveModel has_secure_password
27 # gem 'bcrypt-ruby', '~> 3.0.0'
27 # gem 'bcrypt-ruby', '~> 3.0.0'
28
28
29 # To use Jbuilder templates for JSON
29 # To use Jbuilder templates for JSON
30 # gem 'jbuilder'
30 # gem 'jbuilder'
31
31
32 # Use unicorn as the app server
32 # Use unicorn as the app server
33 # gem 'unicorn'
33 # gem 'unicorn'
34
34
35 # Deploy with Capistrano
35 # Deploy with Capistrano
36 # gem 'capistrano'
36 # gem 'capistrano'
37
37
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 gem 'rails_bootstrap_sortable'
63 gem 'rails_bootstrap_sortable'
63
64
64 #ace editor
65 #ace editor
65 gem 'ace-rails-ap'
66 gem 'ace-rails-ap'
66
67
67 gem 'haml'
68 gem 'haml'
68 gem 'haml-rails'
69 gem 'haml-rails'
69 gem 'mail'
70 gem 'mail'
70 gem 'rdiscount'
71 gem 'rdiscount'
71 gem 'test-unit'
72 gem 'test-unit'
72 gem 'will_paginate', '~> 3.0.7'
73 gem 'will_paginate', '~> 3.0.7'
73 gem 'dynamic_form'
74 gem 'dynamic_form'
74 gem 'in_place_editing'
75 gem 'in_place_editing'
75 gem 'verification', :git => 'https://github.com/sikachu/verification.git'
76 gem 'verification', :git => 'https://github.com/sikachu/verification.git'
76
77
77 group :test, :development do
78 group :test, :development do
78 gem 'rspec-rails', '~> 2.99.0'
79 gem 'rspec-rails', '~> 2.99.0'
79 end
80 end
@@ -1,203 +1,205
1 GIT
1 GIT
2 remote: https://github.com/sikachu/verification.git
2 remote: https://github.com/sikachu/verification.git
3 revision: 76eaf51b13276ecae54bd9cd115832595d2ff56d
3 revision: 76eaf51b13276ecae54bd9cd115832595d2ff56d
4 specs:
4 specs:
5 verification (1.0.3)
5 verification (1.0.3)
6 actionpack (>= 3.0.0, < 5.0)
6 actionpack (>= 3.0.0, < 5.0)
7 activesupport (>= 3.0.0, < 5.0)
7 activesupport (>= 3.0.0, < 5.0)
8
8
9 GEM
9 GEM
10 remote: https://rubygems.org/
10 remote: https://rubygems.org/
11 specs:
11 specs:
12 ace-rails-ap (4.0.2)
12 ace-rails-ap (4.0.2)
13 actionmailer (3.2.21)
13 actionmailer (3.2.21)
14 actionpack (= 3.2.21)
14 actionpack (= 3.2.21)
15 mail (~> 2.5.4)
15 mail (~> 2.5.4)
16 actionpack (3.2.21)
16 actionpack (3.2.21)
17 activemodel (= 3.2.21)
17 activemodel (= 3.2.21)
18 activesupport (= 3.2.21)
18 activesupport (= 3.2.21)
19 builder (~> 3.0.0)
19 builder (~> 3.0.0)
20 erubis (~> 2.7.0)
20 erubis (~> 2.7.0)
21 journey (~> 1.0.4)
21 journey (~> 1.0.4)
22 rack (~> 1.4.5)
22 rack (~> 1.4.5)
23 rack-cache (~> 1.2)
23 rack-cache (~> 1.2)
24 rack-test (~> 0.6.1)
24 rack-test (~> 0.6.1)
25 sprockets (~> 2.2.1)
25 sprockets (~> 2.2.1)
26 activemodel (3.2.21)
26 activemodel (3.2.21)
27 activesupport (= 3.2.21)
27 activesupport (= 3.2.21)
28 builder (~> 3.0.0)
28 builder (~> 3.0.0)
29 activerecord (3.2.21)
29 activerecord (3.2.21)
30 activemodel (= 3.2.21)
30 activemodel (= 3.2.21)
31 activesupport (= 3.2.21)
31 activesupport (= 3.2.21)
32 arel (~> 3.0.2)
32 arel (~> 3.0.2)
33 tzinfo (~> 0.3.29)
33 tzinfo (~> 0.3.29)
34 activeresource (3.2.21)
34 activeresource (3.2.21)
35 activemodel (= 3.2.21)
35 activemodel (= 3.2.21)
36 activesupport (= 3.2.21)
36 activesupport (= 3.2.21)
37 activesupport (3.2.21)
37 activesupport (3.2.21)
38 i18n (~> 0.6, >= 0.6.4)
38 i18n (~> 0.6, >= 0.6.4)
39 multi_json (~> 1.0)
39 multi_json (~> 1.0)
40 arel (3.0.3)
40 arel (3.0.3)
41 autoprefixer-rails (6.0.3)
41 autoprefixer-rails (6.0.3)
42 execjs
42 execjs
43 json
43 json
44 best_in_place (3.0.3)
44 best_in_place (3.0.3)
45 actionpack (>= 3.2)
45 actionpack (>= 3.2)
46 railties (>= 3.2)
46 railties (>= 3.2)
47 bootstrap-sass (3.2.0.2)
47 bootstrap-sass (3.2.0.2)
48 sass (~> 3.2)
48 sass (~> 3.2)
49 bootstrap-switch-rails (3.3.3)
49 bootstrap-switch-rails (3.3.3)
50 bootstrap-toggle-rails (2.2.1.0)
50 bootstrap-toggle-rails (2.2.1.0)
51 builder (3.0.4)
51 builder (3.0.4)
52 coffee-rails (3.2.2)
52 coffee-rails (3.2.2)
53 coffee-script (>= 2.2.0)
53 coffee-script (>= 2.2.0)
54 railties (~> 3.2.0)
54 railties (~> 3.2.0)
55 coffee-script (2.3.0)
55 coffee-script (2.3.0)
56 coffee-script-source
56 coffee-script-source
57 execjs
57 execjs
58 coffee-script-source (1.9.0)
58 coffee-script-source (1.9.0)
59 diff-lcs (1.2.5)
59 diff-lcs (1.2.5)
60 dynamic_form (1.1.4)
60 dynamic_form (1.1.4)
61 erubis (2.7.0)
61 erubis (2.7.0)
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
86 jquery-ui-rails (= 4.0.3)
87 jquery-ui-rails (= 4.0.3)
87 railties (>= 3.1.0)
88 railties (>= 3.1.0)
88 json (1.8.2)
89 json (1.8.2)
89 mail (2.5.4)
90 mail (2.5.4)
90 mime-types (~> 1.16)
91 mime-types (~> 1.16)
91 treetop (~> 1.4.8)
92 treetop (~> 1.4.8)
92 mime-types (1.25.1)
93 mime-types (1.25.1)
93 momentjs-rails (2.11.1)
94 momentjs-rails (2.11.1)
94 railties (>= 3.1)
95 railties (>= 3.1)
95 multi_json (1.10.1)
96 multi_json (1.10.1)
96 mysql2 (0.3.20)
97 mysql2 (0.3.20)
97 polyglot (0.3.5)
98 polyglot (0.3.5)
98 power_assert (0.2.2)
99 power_assert (0.2.2)
99 prototype-rails (3.2.1)
100 prototype-rails (3.2.1)
100 rails (~> 3.2)
101 rails (~> 3.2)
101 rack (1.4.5)
102 rack (1.4.5)
102 rack-cache (1.2)
103 rack-cache (1.2)
103 rack (>= 0.4)
104 rack (>= 0.4)
104 rack-ssl (1.3.4)
105 rack-ssl (1.3.4)
105 rack
106 rack
106 rack-test (0.6.3)
107 rack-test (0.6.3)
107 rack (>= 1.0)
108 rack (>= 1.0)
108 rails (3.2.21)
109 rails (3.2.21)
109 actionmailer (= 3.2.21)
110 actionmailer (= 3.2.21)
110 actionpack (= 3.2.21)
111 actionpack (= 3.2.21)
111 activerecord (= 3.2.21)
112 activerecord (= 3.2.21)
112 activeresource (= 3.2.21)
113 activeresource (= 3.2.21)
113 activesupport (= 3.2.21)
114 activesupport (= 3.2.21)
114 bundler (~> 1.0)
115 bundler (~> 1.0)
115 railties (= 3.2.21)
116 railties (= 3.2.21)
116 rails_bootstrap_sortable (2.0.0)
117 rails_bootstrap_sortable (2.0.0)
117 momentjs-rails (~> 2, >= 2.8.3)
118 momentjs-rails (~> 2, >= 2.8.3)
118 railties (3.2.21)
119 railties (3.2.21)
119 actionpack (= 3.2.21)
120 actionpack (= 3.2.21)
120 activesupport (= 3.2.21)
121 activesupport (= 3.2.21)
121 rack-ssl (~> 1.3.2)
122 rack-ssl (~> 1.3.2)
122 rake (>= 0.8.7)
123 rake (>= 0.8.7)
123 rdoc (~> 3.4)
124 rdoc (~> 3.4)
124 thor (>= 0.14.6, < 2.0)
125 thor (>= 0.14.6, < 2.0)
125 rake (10.4.2)
126 rake (10.4.2)
126 rdiscount (2.1.8)
127 rdiscount (2.1.8)
127 rdoc (3.12.2)
128 rdoc (3.12.2)
128 json (~> 1.4)
129 json (~> 1.4)
129 rouge (1.8.0)
130 rouge (1.8.0)
130 rspec-collection_matchers (1.1.2)
131 rspec-collection_matchers (1.1.2)
131 rspec-expectations (>= 2.99.0.beta1)
132 rspec-expectations (>= 2.99.0.beta1)
132 rspec-core (2.99.2)
133 rspec-core (2.99.2)
133 rspec-expectations (2.99.2)
134 rspec-expectations (2.99.2)
134 diff-lcs (>= 1.1.3, < 2.0)
135 diff-lcs (>= 1.1.3, < 2.0)
135 rspec-mocks (2.99.3)
136 rspec-mocks (2.99.3)
136 rspec-rails (2.99.0)
137 rspec-rails (2.99.0)
137 actionpack (>= 3.0)
138 actionpack (>= 3.0)
138 activemodel (>= 3.0)
139 activemodel (>= 3.0)
139 activesupport (>= 3.0)
140 activesupport (>= 3.0)
140 railties (>= 3.0)
141 railties (>= 3.0)
141 rspec-collection_matchers
142 rspec-collection_matchers
142 rspec-core (~> 2.99.0)
143 rspec-core (~> 2.99.0)
143 rspec-expectations (~> 2.99.0)
144 rspec-expectations (~> 2.99.0)
144 rspec-mocks (~> 2.99.0)
145 rspec-mocks (~> 2.99.0)
145 sass (3.4.11)
146 sass (3.4.11)
146 sass-rails (3.2.6)
147 sass-rails (3.2.6)
147 railties (~> 3.2.0)
148 railties (~> 3.2.0)
148 sass (>= 3.1.10)
149 sass (>= 3.1.10)
149 tilt (~> 1.3)
150 tilt (~> 1.3)
150 select2-rails (4.0.1)
151 select2-rails (4.0.1)
151 thor (~> 0.14)
152 thor (~> 0.14)
152 sprockets (2.2.3)
153 sprockets (2.2.3)
153 hike (~> 1.2)
154 hike (~> 1.2)
154 multi_json (~> 1.0)
155 multi_json (~> 1.0)
155 rack (~> 1.0)
156 rack (~> 1.0)
156 tilt (~> 1.1, != 1.3.0)
157 tilt (~> 1.1, != 1.3.0)
157 test-unit (3.0.9)
158 test-unit (3.0.9)
158 power_assert
159 power_assert
159 thor (0.19.1)
160 thor (0.19.1)
160 tilt (1.4.1)
161 tilt (1.4.1)
161 treetop (1.4.15)
162 treetop (1.4.15)
162 polyglot
163 polyglot
163 polyglot (>= 0.3.1)
164 polyglot (>= 0.3.1)
164 tzinfo (0.3.43)
165 tzinfo (0.3.43)
165 uglifier (2.7.0)
166 uglifier (2.7.0)
166 execjs (>= 0.3.0)
167 execjs (>= 0.3.0)
167 json (>= 1.8.0)
168 json (>= 1.8.0)
168 will_paginate (3.0.7)
169 will_paginate (3.0.7)
169
170
170 PLATFORMS
171 PLATFORMS
171 ruby
172 ruby
172
173
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 mail
191 mail
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
197 rspec-rails (~> 2.99.0)
199 rspec-rails (~> 2.99.0)
198 sass-rails (~> 3.2.6)
200 sass-rails (~> 3.2.6)
199 select2-rails
201 select2-rails
200 test-unit
202 test-unit
201 uglifier
203 uglifier
202 verification!
204 verification!
203 will_paginate (~> 3.0.7)
205 will_paginate (~> 3.0.7)
@@ -1,35 +1,42
1 // This is a manifest file that'll be compiled into application.js, which will include all the files
1 // This is a manifest file that'll be compiled into application.js, which will include all the files
2 // listed below.
2 // listed below.
3 //
3 //
4 // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
4 // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5 // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
5 // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6 //
6 //
7 // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
7 // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
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
@@ -1,47 +1,52
1 $(document).on 'change', '.btn-file :file', ->
1 $(document).on 'change', '.btn-file :file', ->
2 input = $(this)
2 input = $(this)
3 numFiles = if input.get(0).files then input.get(0).files.length else 1
3 numFiles = if input.get(0).files then input.get(0).files.length else 1
4 label = input.val().replace(/\\/g, '/').replace(/.*\//, '')
4 label = input.val().replace(/\\/g, '/').replace(/.*\//, '')
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().setUseSoftTabs(true)
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
@@ -1,121 +1,121
1 /*
1 /*
2 * This is a manifest file that'll be compiled into application.css, which will include all the files
2 * This is a manifest file that'll be compiled into application.css, which will include all the files
3 * listed below.
3 * listed below.
4 *
4 *
5 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
5 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6 * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
6 * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7 *
7 *
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)
38 $bgDefault : #19197b
38 $bgDefault : #19197b
39 $bgHighlight : #06064b
39 $bgHighlight : #06064b
40 $colDefault : #8e8eb4
40 $colDefault : #8e8eb4
41 $colHighlight : #ffffff
41 $colHighlight : #ffffff
42 $dropDown : false
42 $dropDown : false
43 .navbar-default
43 .navbar-default
44 background-color: $bgDefault
44 background-color: $bgDefault
45 border-color: $bgHighlight
45 border-color: $bgHighlight
46 .navbar-brand
46 .navbar-brand
47 color: $colDefault
47 color: $colDefault
48 &:hover, &:focus
48 &:hover, &:focus
49 color: $colHighlight
49 color: $colHighlight
50 .navbar-text
50 .navbar-text
51 color: $colDefault
51 color: $colDefault
52 .navbar-nav
52 .navbar-nav
53 > li
53 > li
54 > a
54 > a
55 color: $colDefault
55 color: $colDefault
56 &:hover, &:focus
56 &:hover, &:focus
57 color: $colHighlight
57 color: $colHighlight
58 @if $dropDown
58 @if $dropDown
59 > .dropdown-menu
59 > .dropdown-menu
60 background-color: $bgDefault
60 background-color: $bgDefault
61 > li
61 > li
62 > a
62 > a
63 color: $colDefault
63 color: $colDefault
64 &:hover, &:focus
64 &:hover, &:focus
65 color: $colHighlight
65 color: $colHighlight
66 background-color: $bgHighlight
66 background-color: $bgHighlight
67 > .divider
67 > .divider
68 background-color: $bgHighlight
68 background-color: $bgHighlight
69 @if $dropDown
69 @if $dropDown
70 .open .dropdown-menu > .active
70 .open .dropdown-menu > .active
71 > a, > a:hover, > a:focus
71 > a, > a:hover, > a:focus
72 color: $colHighlight
72 color: $colHighlight
73 background-color: $bgHighlight
73 background-color: $bgHighlight
74 > .active
74 > .active
75 > a, > a:hover, > a:focus
75 > a, > a:hover, > a:focus
76 color: $colHighlight
76 color: $colHighlight
77 background-color: $bgHighlight
77 background-color: $bgHighlight
78 > .open
78 > .open
79 > a, > a:hover, > a:focus
79 > a, > a:hover, > a:focus
80 color: $colHighlight
80 color: $colHighlight
81 background-color: $bgHighlight
81 background-color: $bgHighlight
82 .navbar-toggle
82 .navbar-toggle
83 border-color: $bgHighlight
83 border-color: $bgHighlight
84 &:hover, &:focus
84 &:hover, &:focus
85 background-color: $bgHighlight
85 background-color: $bgHighlight
86 .icon-bar
86 .icon-bar
87 background-color: $colDefault
87 background-color: $colDefault
88 .navbar-collapse,
88 .navbar-collapse,
89 .navbar-form
89 .navbar-form
90 border-color: $colDefault
90 border-color: $colDefault
91 .navbar-link
91 .navbar-link
92 color: $colDefault
92 color: $colDefault
93 &:hover
93 &:hover
94 color: $colHighlight
94 color: $colHighlight
95 @media (max-width: 767px)
95 @media (max-width: 767px)
96 .navbar-default .navbar-nav .open .dropdown-menu
96 .navbar-default .navbar-nav .open .dropdown-menu
97 > li > a
97 > li > a
98 color: $colDefault
98 color: $colDefault
99 &:hover, &:focus
99 &:hover, &:focus
100 color: $colHighlight
100 color: $colHighlight
101 > .active
101 > .active
102 > a, > a:hover, > a:focus
102 > a, > a:hover, > a:focus
103 color: $colHighlight
103 color: $colHighlight
104 background-color: $bgHighlight
104 background-color: $bgHighlight
105
105
106 .secondnavbar
106 .secondnavbar
107 top: 50px
107 top: 50px
108
108
109
109
110 // --------------- bootstrap file upload ----------------------
110 // --------------- bootstrap file upload ----------------------
111 .btn-file
111 .btn-file
112 position: relative
112 position: relative
113 overflow: hidden
113 overflow: hidden
114
114
115 .btn-file input[type=file]
115 .btn-file input[type=file]
116 position: absolute
116 position: absolute
117 top: 0
117 top: 0
118 right: 0
118 right: 0
119 min-width: 100%
119 min-width: 100%
120 min-height: 100%
120 min-height: 100%
121 font-size: 100px
121 font-size: 100px
@@ -41,157 +41,158
41 # admin menu
41 # admin menu
42 menu_items << "<b>Administrative task:</b> "
42 menu_items << "<b>Administrative task:</b> "
43 append_to menu_items, '[Announcements]', 'announcements', 'index'
43 append_to menu_items, '[Announcements]', 'announcements', 'index'
44 append_to menu_items, '[Msg console]', 'messages', 'console'
44 append_to menu_items, '[Msg console]', 'messages', 'console'
45 append_to menu_items, '[Problems]', 'problems', 'index'
45 append_to menu_items, '[Problems]', 'problems', 'index'
46 append_to menu_items, '[Users]', 'user_admin', 'index'
46 append_to menu_items, '[Users]', 'user_admin', 'index'
47 append_to menu_items, '[Results]', 'user_admin', 'user_stat'
47 append_to menu_items, '[Results]', 'user_admin', 'user_stat'
48 append_to menu_items, '[Report]', 'report', 'multiple_login'
48 append_to menu_items, '[Report]', 'report', 'multiple_login'
49 append_to menu_items, '[Graders]', 'graders', 'list'
49 append_to menu_items, '[Graders]', 'graders', 'list'
50 append_to menu_items, '[Contests]', 'contest_management', 'index'
50 append_to menu_items, '[Contests]', 'contest_management', 'index'
51 append_to menu_items, '[Sites]', 'sites', 'index'
51 append_to menu_items, '[Sites]', 'sites', 'index'
52 append_to menu_items, '[System config]', 'configurations', 'index'
52 append_to menu_items, '[System config]', 'configurations', 'index'
53 menu_items << "<br/>"
53 menu_items << "<br/>"
54 end
54 end
55
55
56 # main page
56 # main page
57 append_to menu_items, "[#{I18n.t 'menu.main'}]", 'main', 'list'
57 append_to menu_items, "[#{I18n.t 'menu.main'}]", 'main', 'list'
58 append_to menu_items, "[#{I18n.t 'menu.messages'}]", 'messages', 'list'
58 append_to menu_items, "[#{I18n.t 'menu.messages'}]", 'messages', 'list'
59
59
60 if (user!=nil) and (GraderConfiguration.show_tasks_to?(user))
60 if (user!=nil) and (GraderConfiguration.show_tasks_to?(user))
61 append_to menu_items, "[#{I18n.t 'menu.tasks'}]", 'tasks', 'list'
61 append_to menu_items, "[#{I18n.t 'menu.tasks'}]", 'tasks', 'list'
62 append_to menu_items, "[#{I18n.t 'menu.submissions'}]", 'main', 'submission'
62 append_to menu_items, "[#{I18n.t 'menu.submissions'}]", 'main', 'submission'
63 append_to menu_items, "[#{I18n.t 'menu.test'}]", 'test', 'index'
63 append_to menu_items, "[#{I18n.t 'menu.test'}]", 'test', 'index'
64 end
64 end
65
65
66 if GraderConfiguration['right.user_hall_of_fame']
66 if GraderConfiguration['right.user_hall_of_fame']
67 append_to menu_items, "[#{I18n.t 'menu.hall_of_fame'}]", 'report', 'problem_hof'
67 append_to menu_items, "[#{I18n.t 'menu.hall_of_fame'}]", 'report', 'problem_hof'
68 end
68 end
69 append_to menu_items, "[#{I18n.t 'menu.help'}]", 'main', 'help'
69 append_to menu_items, "[#{I18n.t 'menu.help'}]", 'main', 'help'
70
70
71 if GraderConfiguration['system.user_setting_enabled']
71 if GraderConfiguration['system.user_setting_enabled']
72 append_to menu_items, "[#{I18n.t 'menu.settings'}]", 'users', 'index'
72 append_to menu_items, "[#{I18n.t 'menu.settings'}]", 'users', 'index'
73 end
73 end
74 append_to menu_items, "[#{I18n.t 'menu.log_out'}]", 'main', 'login'
74 append_to menu_items, "[#{I18n.t 'menu.log_out'}]", 'main', 'login'
75
75
76 menu_items.html_safe
76 menu_items.html_safe
77 end
77 end
78
78
79 def append_to(option,label, controller, action)
79 def append_to(option,label, controller, action)
80 option << ' ' if option!=''
80 option << ' ' if option!=''
81 option << link_to_unless_current(label,
81 option << link_to_unless_current(label,
82 :controller => controller,
82 :controller => controller,
83 :action => action)
83 :action => action)
84 end
84 end
85
85
86 def format_short_time(time)
86 def format_short_time(time)
87 now = Time.now.gmtime
87 now = Time.now.gmtime
88 st = ''
88 st = ''
89 if (time.yday != now.yday) or
89 if (time.yday != now.yday) or
90 (time.year != now.year)
90 (time.year != now.year)
91 st = time.strftime("%x ")
91 st = time.strftime("%x ")
92 end
92 end
93 st + time.strftime("%X")
93 st + time.strftime("%X")
94 end
94 end
95
95
96 def format_short_duration(duration)
96 def format_short_duration(duration)
97 return '' if duration==nil
97 return '' if duration==nil
98 d = duration.to_f
98 d = duration.to_f
99 return Time.at(d).gmtime.strftime("%X")
99 return Time.at(d).gmtime.strftime("%X")
100 end
100 end
101
101
102 def read_textfile(fname,max_size=2048)
102 def read_textfile(fname,max_size=2048)
103 begin
103 begin
104 File.open(fname).read(max_size)
104 File.open(fname).read(max_size)
105 rescue
105 rescue
106 nil
106 nil
107 end
107 end
108 end
108 end
109
109
110 def toggle_button(on,toggle_url,id, option={})
110 def toggle_button(on,toggle_url,id, option={})
111 btn_size = option[:size] || 'btn-xs'
111 btn_size = option[:size] || 'btn-xs'
112 link_to (on ? "Yes" : "No"), toggle_url,
112 link_to (on ? "Yes" : "No"), toggle_url,
113 {class: "btn btn-block #{btn_size} btn-#{on ? 'success' : 'default'} ajax-toggle",
113 {class: "btn btn-block #{btn_size} btn-#{on ? 'success' : 'default'} ajax-toggle",
114 id: id,
114 id: id,
115 data: {remote: true, method: 'get'}}
115 data: {remote: true, method: 'get'}}
116 end
116 end
117
117
118 def get_ace_mode(language)
118 def get_ace_mode(language)
119 # return ace mode string from Language
119 # return ace mode string from Language
120
120
121 case language.pretty_name
121 case language.pretty_name
122 when 'Pascal'
122 when 'Pascal'
123 'ace/mode/pascal'
123 'ace/mode/pascal'
124 when 'C++','C'
124 when 'C++','C'
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>
149 CONTEST_OVER
150 CONTEST_OVER
150 end
151 end
151 if !user.contest_started?
152 if !user.contest_started?
152 time_left = "&nbsp;&nbsp;" + (t 'title_bar.contest_not_started')
153 time_left = "&nbsp;&nbsp;" + (t 'title_bar.contest_not_started')
153 else
154 else
154 time_left = "&nbsp;&nbsp;" + (t 'title_bar.remaining_time') +
155 time_left = "&nbsp;&nbsp;" + (t 'title_bar.remaining_time') +
155 " #{format_short_duration(user.contest_time_left)}"
156 " #{format_short_duration(user.contest_time_left)}"
156 end
157 end
157 end
158 end
158
159
159 #
160 #
160 # if the contest is in the anaysis mode
161 # if the contest is in the anaysis mode
161 if GraderConfiguration.analysis_mode?
162 if GraderConfiguration.analysis_mode?
162 header = <<ANALYSISMODE
163 header = <<ANALYSISMODE
163 <tr><td colspan="2" align="center">
164 <tr><td colspan="2" align="center">
164 <span class="contest-over-msg">ANALYSIS MODE</span>
165 <span class="contest-over-msg">ANALYSIS MODE</span>
165 </td></tr>
166 </td></tr>
166 ANALYSISMODE
167 ANALYSISMODE
167 end
168 end
168
169
169 contest_name = GraderConfiguration['contest.name']
170 contest_name = GraderConfiguration['contest.name']
170
171
171 #
172 #
172 # build real title bar
173 # build real title bar
173 result = <<TITLEBAR
174 result = <<TITLEBAR
174 <div class="title">
175 <div class="title">
175 <table>
176 <table>
176 #{header}
177 #{header}
177 <tr>
178 <tr>
178 <td class="left-col">
179 <td class="left-col">
179 #{user.full_name}<br/>
180 #{user.full_name}<br/>
180 #{t 'title_bar.current_time'} #{format_short_time(Time.zone.now)}
181 #{t 'title_bar.current_time'} #{format_short_time(Time.zone.now)}
181 #{time_left}
182 #{time_left}
182 <br/>
183 <br/>
183 </td>
184 </td>
184 <td class="right-col">#{contest_name}</td>
185 <td class="right-col">#{contest_name}</td>
185 </tr>
186 </tr>
186 </table>
187 </table>
187 </div>
188 </div>
188 TITLEBAR
189 TITLEBAR
189 result.html_safe
190 result.html_safe
190 end
191 end
191
192
192 def markdown(text)
193 def markdown(text)
193 markdown = RDiscount.new(text)
194 markdown = RDiscount.new(text)
194 markdown.to_html.html_safe
195 markdown.to_html.html_safe
195 end
196 end
196
197
197 end
198 end
@@ -1,32 +1,34
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
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/
31 If you have more than one process running, you should restart
33 If you have more than one process running, you should restart
32 them manually.
34 them manually.
@@ -1,73 +1,84
1 %header.navbar.navbar-default.navbar-fixed-top
1 %header.navbar.navbar-default.navbar-fixed-top
2 %nav
2 %nav
3 .container-fluid
3 .container-fluid
4 .navbar-header
4 .navbar-header
5 %a.navbar-brand{href: main_list_path}
5 %a.navbar-brand{href: main_list_path}
6 %span.glyphicon.glyphicon-home
6 %span.glyphicon.glyphicon-home
7 MAIN
7 MAIN
8 .collapse.navbar-collapse
8 .collapse.navbar-collapse
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'}
33 = add_menu( 'System config', 'configurations', 'index')
46 = add_menu( 'System config', 'configurations', 'index')
34 %li.divider{role: 'separator'}
47 %li.divider{role: 'separator'}
35 = add_menu( 'Sites', 'sites', 'index')
48 = add_menu( 'Sites', 'sites', 'index')
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
62 .collapse.navbar-collapse
73 .collapse.navbar-collapse
63 %ul.nav.navbar-nav
74 %ul.nav.navbar-nav
64 = add_menu( '[Announcements]', 'announcements', 'index')
75 = add_menu( '[Announcements]', 'announcements', 'index')
65 = add_menu( '[Msg console]', 'messages', 'console')
76 = add_menu( '[Msg console]', 'messages', 'console')
66 = add_menu( '[Problems]', 'problems', 'index')
77 = add_menu( '[Problems]', 'problems', 'index')
67 = add_menu( '[Users]', 'user_admin', 'index')
78 = add_menu( '[Users]', 'user_admin', 'index')
68 = add_menu( '[Results]', 'user_admin', 'user_stat')
79 = add_menu( '[Results]', 'user_admin', 'user_stat')
69 = add_menu( '[Report]', 'report', 'multiple_login')
80 = add_menu( '[Report]', 'report', 'multiple_login')
70 = add_menu( '[Graders]', 'graders', 'list')
81 = add_menu( '[Graders]', 'graders', 'list')
71 = add_menu( '[Contests]', 'contest_management', 'index')
82 = add_menu( '[Contests]', 'contest_management', 'index')
72 = add_menu( '[Sites]', 'sites', 'index')
83 = add_menu( '[Sites]', 'sites', 'index')
73 = add_menu( '[System config]', 'configurations', 'index')
84 = add_menu( '[System config]', 'configurations', 'index')
@@ -1,87 +1,109
1 %h1 Listing users
1 %h1 Listing users
2
2
3 .panel.panel-primary
3 .panel.panel-primary
4 .panel-title.panel-heading
4 .panel-title.panel-heading
5 Quick Add
5 Quick Add
6 .panel-body
6 .panel-body
7 = form_tag( {method: 'post'}, {class: 'form-inline'}) do
7 = form_tag( {method: 'post'}, {class: 'form-inline'}) do
8 .form-group
8 .form-group
9 = label_tag 'user_login', 'Login'
9 = label_tag 'user_login', 'Login'
10 = text_field 'user', 'login', :size => 10,class: 'form-control'
10 = text_field 'user', 'login', :size => 10,class: 'form-control'
11 .form-group
11 .form-group
12 = label_tag 'user_full_name', 'Full Name'
12 = label_tag 'user_full_name', 'Full Name'
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'}
37 - if GraderConfiguration.multicontests?
59 - if GraderConfiguration.multicontests?
38 %br/
60 %br/
39 %b Multi-contest:
61 %b Multi-contest:
40 = link_to '[Manage bulk users in contests]', :action => 'contest_management'
62 = link_to '[Manage bulk users in contests]', :action => 'contest_management'
41 View users in:
63 View users in:
42 - @contests.each do |contest|
64 - @contests.each do |contest|
43 = link_to "[#{contest.name}]", :action => 'contests', :id => contest.id
65 = link_to "[#{contest.name}]", :action => 'contests', :id => contest.id
44 = link_to "[no contest]", :action => 'contests', :id => 'none'
66 = link_to "[no contest]", :action => 'contests', :id => 'none'
45 Total #{@user_count} users |
67 Total #{@user_count} users |
46 - if !@paginated
68 - if !@paginated
47 Display all users.
69 Display all users.
48 \#{link_to '[show in pages]', :action => 'index', :page => '1'}
70 \#{link_to '[show in pages]', :action => 'index', :page => '1'}
49 - else
71 - else
50 Display in pages.
72 Display in pages.
51 \#{link_to '[display all]', :action => 'index', :page => 'all'} |
73 \#{link_to '[display all]', :action => 'index', :page => 'all'} |
52 \#{will_paginate @users, :container => false}
74 \#{will_paginate @users, :container => false}
53
75
54
76
55 %table.table.table-hover.table-condense
77 %table.table.table-hover.table-condense
56 %thead
78 %thead
57 %th Login
79 %th Login
58 %th Full name
80 %th Full name
59 %th email
81 %th email
60 %th Remark
82 %th Remark
61 %th
83 %th
62 Activated
84 Activated
63 %sup{class: 'text-primary',data: {toggle: 'tooltip', placement: 'top'}, title: 'User has already confirmed the email?' } [?]
85 %sup{class: 'text-primary',data: {toggle: 'tooltip', placement: 'top'}, title: 'User has already confirmed the email?' } [?]
64 %th
86 %th
65 Enabled
87 Enabled
66 %sup{class: 'text-primary',data: {toggle: 'tooltip', placement: 'top'}, title: 'Allow the user to login?' } [?]
88 %sup{class: 'text-primary',data: {toggle: 'tooltip', placement: 'top'}, title: 'Allow the user to login?' } [?]
67 %th Last IP
89 %th Last IP
68 %th
90 %th
69 %th
91 %th
70 %th
92 %th
71 %th
93 %th
72 - for user in @users
94 - for user in @users
73 %tr
95 %tr
74 %td= link_to user.login, controller: :users, :action => 'profile', :id => user
96 %td= link_to user.login, controller: :users, :action => 'profile', :id => user
75 %td= user.full_name
97 %td= user.full_name
76 %td= user.email
98 %td= user.email
77 %td= user.remark
99 %td= user.remark
78 %td= toggle_button(user.activated?, toggle_activate_user_url(user),"toggle_activate_user_#{user.id}")
100 %td= toggle_button(user.activated?, toggle_activate_user_url(user),"toggle_activate_user_#{user.id}")
79 %td= toggle_button(user.enabled?, toggle_enable_user_url(user),"toggle_enable_user_#{user.id}")
101 %td= toggle_button(user.enabled?, toggle_enable_user_url(user),"toggle_enable_user_#{user.id}")
80 %td= user.last_ip
102 %td= user.last_ip
81 %td= link_to 'Clear IP', {:action => 'clear_last_ip', :id => user, :page=>params[:page]}, :confirm => 'This will reset last logging in ip of the user, are you sure?', class: 'btn btn-default btn-xs btn-block'
103 %td= link_to 'Clear IP', {:action => 'clear_last_ip', :id => user, :page=>params[:page]}, :confirm => 'This will reset last logging in ip of the user, are you sure?', class: 'btn btn-default btn-xs btn-block'
82 %td= link_to 'Show', {:action => 'show', :id => user}, class: 'btn btn-default btn-xs btn-block'
104 %td= link_to 'Show', {:action => 'show', :id => user}, class: 'btn btn-default btn-xs btn-block'
83 %td= link_to 'Edit', {:action => 'edit', :id => user}, class: 'btn btn-default btn-xs btn-block'
105 %td= link_to 'Edit', {:action => 'edit', :id => user}, class: 'btn btn-default btn-xs btn-block'
84 %td= link_to 'Destroy', { :action => 'destroy', :id => user }, :confirm => 'Are you sure?', :method => :post, class: 'btn btn-danger btn-xs btn-block'
106 %td= link_to 'Destroy', { :action => 'destroy', :id => user }, :confirm => 'Are you sure?', :method => :post, class: 'btn btn-danger btn-xs btn-block'
85 %br/
107 %br/
86 = link_to '[New user]', :action => 'new'
108 = link_to '[New user]', :action => 'new'
87 = link_to '[New list of users]', :action => 'new_list'
109 = link_to '[New list of users]', :action => 'new_list'
You need to be logged in to leave comments. Login now