Description:
consolidate
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r489:915396c14fc6 - - 23 files changed: 123 inserted, 159 deleted
@@ -1,6 +1,6 | |||||
|
1 | source 'https://rubygems.org' |
|
1 | source 'https://rubygems.org' |
|
2 |
|
2 | ||
|
3 |
- gem 'rails', '3.2.1 |
|
3 | + gem 'rails', '3.2.21' |
|
4 |
|
4 | ||
|
5 | # Bundle edge Rails instead: |
|
5 | # Bundle edge Rails instead: |
|
6 | # gem 'rails', :git => 'git://github.com/rails/rails.git' |
|
6 | # gem 'rails', :git => 'git://github.com/rails/rails.git' |
@@ -10,13 +10,13 | |||||
|
10 | # Gems used only for assets and not required |
|
10 | # Gems used only for assets and not required |
|
11 | # in production environments by default. |
|
11 | # in production environments by default. |
|
12 | group :assets do |
|
12 | group :assets do |
|
13 |
- gem 'sass-rails', '~> 3.2. |
|
13 | + gem 'sass-rails', '~> 3.2.6' |
|
14 |
- gem 'coffee-rails', '~> 3.2. |
|
14 | + gem 'coffee-rails', '~> 3.2.2' |
|
15 |
|
15 | ||
|
16 | # See https://github.com/sstephenson/execjs#readme for more supported runtimes |
|
16 | # See https://github.com/sstephenson/execjs#readme for more supported runtimes |
|
17 | # gem 'therubyracer', :platforms => :ruby |
|
17 | # gem 'therubyracer', :platforms => :ruby |
|
18 |
|
18 | ||
|
19 |
- gem 'uglifier' |
|
19 | + gem 'uglifier' |
|
20 | end |
|
20 | end |
|
21 |
|
21 | ||
|
22 | gem 'prototype-rails' |
|
22 | gem 'prototype-rails' |
@@ -49,15 +49,15 | |||||
|
49 | #syntax highlighter |
|
49 | #syntax highlighter |
|
50 | gem 'rouge' |
|
50 | gem 'rouge' |
|
51 |
|
51 | ||
|
52 |
- gem |
|
52 | + gem 'haml' |
|
53 |
- gem |
|
53 | + gem 'mail' |
|
54 |
- gem |
|
54 | + gem 'rdiscount' |
|
55 |
- gem |
|
55 | + gem 'test-unit' |
|
56 |
- gem 'will_paginate', '~> 3.0. |
|
56 | + gem 'will_paginate', '~> 3.0.7' |
|
57 | gem 'dynamic_form' |
|
57 | gem 'dynamic_form' |
|
58 | gem 'in_place_editing' |
|
58 | gem 'in_place_editing' |
|
59 |
- gem 'verification', :git => ' |
|
59 | + gem 'verification', :git => 'https://github.com/sikachu/verification.git' |
|
60 |
|
60 | ||
|
61 | group :test, :development do |
|
61 | group :test, :development do |
|
62 |
- gem |
|
62 | + gem 'rspec-rails', '~> 2.99.0' |
|
63 | end |
|
63 | end |
@@ -1,5 +1,5 | |||||
|
1 | GIT |
|
1 | GIT |
|
2 |
- remote: |
|
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) |
@@ -9,12 +9,12 | |||||
|
9 | GEM |
|
9 | GEM |
|
10 | remote: https://rubygems.org/ |
|
10 | remote: https://rubygems.org/ |
|
11 | specs: |
|
11 | specs: |
|
12 |
- actionmailer (3.2.1 |
|
12 | + actionmailer (3.2.21) |
|
13 |
- actionpack (= 3.2.1 |
|
13 | + actionpack (= 3.2.21) |
|
14 | mail (~> 2.5.4) |
|
14 | mail (~> 2.5.4) |
|
15 |
- actionpack (3.2.1 |
|
15 | + actionpack (3.2.21) |
|
16 |
- activemodel (= 3.2.1 |
|
16 | + activemodel (= 3.2.21) |
|
17 |
- activesupport (= 3.2.1 |
|
17 | + activesupport (= 3.2.21) |
|
18 | builder (~> 3.0.0) |
|
18 | builder (~> 3.0.0) |
|
19 | erubis (~> 2.7.0) |
|
19 | erubis (~> 2.7.0) |
|
20 | journey (~> 1.0.4) |
|
20 | journey (~> 1.0.4) |
@@ -22,22 +22,22 | |||||
|
22 | rack-cache (~> 1.2) |
|
22 | rack-cache (~> 1.2) |
|
23 | rack-test (~> 0.6.1) |
|
23 | rack-test (~> 0.6.1) |
|
24 | sprockets (~> 2.2.1) |
|
24 | sprockets (~> 2.2.1) |
|
25 |
- activemodel (3.2.1 |
|
25 | + activemodel (3.2.21) |
|
26 |
- activesupport (= 3.2.1 |
|
26 | + activesupport (= 3.2.21) |
|
27 | builder (~> 3.0.0) |
|
27 | builder (~> 3.0.0) |
|
28 |
- activerecord (3.2.1 |
|
28 | + activerecord (3.2.21) |
|
29 |
- activemodel (= 3.2.1 |
|
29 | + activemodel (= 3.2.21) |
|
30 |
- activesupport (= 3.2.1 |
|
30 | + activesupport (= 3.2.21) |
|
31 | arel (~> 3.0.2) |
|
31 | arel (~> 3.0.2) |
|
32 | tzinfo (~> 0.3.29) |
|
32 | tzinfo (~> 0.3.29) |
|
33 |
- activeresource (3.2.1 |
|
33 | + activeresource (3.2.21) |
|
34 |
- activemodel (= 3.2.1 |
|
34 | + activemodel (= 3.2.21) |
|
35 |
- activesupport (= 3.2.1 |
|
35 | + activesupport (= 3.2.21) |
|
36 |
- activesupport (3.2.1 |
|
36 | + activesupport (3.2.21) |
|
37 | i18n (~> 0.6, >= 0.6.4) |
|
37 | i18n (~> 0.6, >= 0.6.4) |
|
38 | multi_json (~> 1.0) |
|
38 | multi_json (~> 1.0) |
|
39 | arel (3.0.3) |
|
39 | arel (3.0.3) |
|
40 |
- best_in_place (3.0. |
|
40 | + best_in_place (3.0.3) |
|
41 | actionpack (>= 3.2) |
|
41 | actionpack (>= 3.2) |
|
42 | railties (>= 3.2) |
|
42 | railties (>= 3.2) |
|
43 | builder (3.0.4) |
|
43 | builder (3.0.4) |
@@ -47,21 +47,21 | |||||
|
47 | coffee-script (2.3.0) |
|
47 | coffee-script (2.3.0) |
|
48 | coffee-script-source |
|
48 | coffee-script-source |
|
49 | execjs |
|
49 | execjs |
|
50 |
- coffee-script-source (1. |
|
50 | + coffee-script-source (1.9.0) |
|
51 | diff-lcs (1.2.5) |
|
51 | diff-lcs (1.2.5) |
|
52 | dynamic_form (1.1.4) |
|
52 | dynamic_form (1.1.4) |
|
53 | erubis (2.7.0) |
|
53 | erubis (2.7.0) |
|
54 |
- execjs (2. |
|
54 | + execjs (2.3.0) |
|
55 |
- haml (4.0. |
|
55 | + haml (4.0.6) |
|
56 | tilt |
|
56 | tilt |
|
57 | hike (1.2.3) |
|
57 | hike (1.2.3) |
|
58 |
- i18n (0. |
|
58 | + i18n (0.7.0) |
|
59 | in_place_editing (1.2.0) |
|
59 | in_place_editing (1.2.0) |
|
60 | journey (1.0.4) |
|
60 | journey (1.0.4) |
|
61 |
- jquery-rails (3.1. |
|
61 | + jquery-rails (3.1.2) |
|
62 | railties (>= 3.0, < 5.0) |
|
62 | railties (>= 3.0, < 5.0) |
|
63 | thor (>= 0.14, < 2.0) |
|
63 | thor (>= 0.14, < 2.0) |
|
64 |
- jquery-tablesorter (1.1 |
|
64 | + jquery-tablesorter (1.13.4) |
|
65 | railties (>= 3.1, < 5) |
|
65 | railties (>= 3.1, < 5) |
|
66 | jquery-timepicker-addon-rails (1.4.1) |
|
66 | jquery-timepicker-addon-rails (1.4.1) |
|
67 | railties (>= 3.1) |
|
67 | railties (>= 3.1) |
@@ -72,15 +72,15 | |||||
|
72 | jquery-rails |
|
72 | jquery-rails |
|
73 | jquery-ui-rails (= 4.0.3) |
|
73 | jquery-ui-rails (= 4.0.3) |
|
74 | railties (>= 3.1.0) |
|
74 | railties (>= 3.1.0) |
|
75 |
- json (1.8. |
|
75 | + json (1.8.2) |
|
76 | mail (2.5.4) |
|
76 | mail (2.5.4) |
|
77 | mime-types (~> 1.16) |
|
77 | mime-types (~> 1.16) |
|
78 | treetop (~> 1.4.8) |
|
78 | treetop (~> 1.4.8) |
|
79 | mime-types (1.25.1) |
|
79 | mime-types (1.25.1) |
|
80 | multi_json (1.10.1) |
|
80 | multi_json (1.10.1) |
|
81 |
- mysql2 (0.3.1 |
|
81 | + mysql2 (0.3.17) |
|
82 | polyglot (0.3.5) |
|
82 | polyglot (0.3.5) |
|
83 |
- power_assert (0. |
|
83 | + power_assert (0.2.2) |
|
84 | prototype-rails (3.2.1) |
|
84 | prototype-rails (3.2.1) |
|
85 | rails (~> 3.2) |
|
85 | rails (~> 3.2) |
|
86 | rack (1.4.5) |
|
86 | rack (1.4.5) |
@@ -88,34 +88,34 | |||||
|
88 | rack (>= 0.4) |
|
88 | rack (>= 0.4) |
|
89 | rack-ssl (1.3.4) |
|
89 | rack-ssl (1.3.4) |
|
90 | rack |
|
90 | rack |
|
91 |
- rack-test (0.6. |
|
91 | + rack-test (0.6.3) |
|
92 | rack (>= 1.0) |
|
92 | rack (>= 1.0) |
|
93 |
- rails (3.2.1 |
|
93 | + rails (3.2.21) |
|
94 |
- actionmailer (= 3.2.1 |
|
94 | + actionmailer (= 3.2.21) |
|
95 |
- actionpack (= 3.2.1 |
|
95 | + actionpack (= 3.2.21) |
|
96 |
- activerecord (= 3.2.1 |
|
96 | + activerecord (= 3.2.21) |
|
97 |
- activeresource (= 3.2.1 |
|
97 | + activeresource (= 3.2.21) |
|
98 |
- activesupport (= 3.2.1 |
|
98 | + activesupport (= 3.2.21) |
|
99 | bundler (~> 1.0) |
|
99 | bundler (~> 1.0) |
|
100 |
- railties (= 3.2.1 |
|
100 | + railties (= 3.2.21) |
|
101 |
- railties (3.2.1 |
|
101 | + railties (3.2.21) |
|
102 |
- actionpack (= 3.2.1 |
|
102 | + actionpack (= 3.2.21) |
|
103 |
- activesupport (= 3.2.1 |
|
103 | + activesupport (= 3.2.21) |
|
104 | rack-ssl (~> 1.3.2) |
|
104 | rack-ssl (~> 1.3.2) |
|
105 | rake (>= 0.8.7) |
|
105 | rake (>= 0.8.7) |
|
106 | rdoc (~> 3.4) |
|
106 | rdoc (~> 3.4) |
|
107 | thor (>= 0.14.6, < 2.0) |
|
107 | thor (>= 0.14.6, < 2.0) |
|
108 |
- rake (10. |
|
108 | + rake (10.4.2) |
|
109 |
- rdiscount (2.1. |
|
109 | + rdiscount (2.1.8) |
|
110 | rdoc (3.12.2) |
|
110 | rdoc (3.12.2) |
|
111 | json (~> 1.4) |
|
111 | json (~> 1.4) |
|
112 |
- rouge (1. |
|
112 | + rouge (1.8.0) |
|
113 |
- rspec-collection_matchers (1. |
|
113 | + rspec-collection_matchers (1.1.2) |
|
114 | rspec-expectations (>= 2.99.0.beta1) |
|
114 | rspec-expectations (>= 2.99.0.beta1) |
|
115 | rspec-core (2.99.2) |
|
115 | rspec-core (2.99.2) |
|
116 | rspec-expectations (2.99.2) |
|
116 | rspec-expectations (2.99.2) |
|
117 | diff-lcs (>= 1.1.3, < 2.0) |
|
117 | diff-lcs (>= 1.1.3, < 2.0) |
|
118 |
- rspec-mocks (2.99. |
|
118 | + rspec-mocks (2.99.3) |
|
119 | rspec-rails (2.99.0) |
|
119 | rspec-rails (2.99.0) |
|
120 | actionpack (>= 3.0) |
|
120 | actionpack (>= 3.0) |
|
121 | activemodel (>= 3.0) |
|
121 | activemodel (>= 3.0) |
@@ -125,25 +125,25 | |||||
|
125 | rspec-core (~> 2.99.0) |
|
125 | rspec-core (~> 2.99.0) |
|
126 | rspec-expectations (~> 2.99.0) |
|
126 | rspec-expectations (~> 2.99.0) |
|
127 | rspec-mocks (~> 2.99.0) |
|
127 | rspec-mocks (~> 2.99.0) |
|
128 | - sass (3.4.1) |
|
128 | + sass (3.4.11) |
|
129 | sass-rails (3.2.6) |
|
129 | sass-rails (3.2.6) |
|
130 | railties (~> 3.2.0) |
|
130 | railties (~> 3.2.0) |
|
131 | sass (>= 3.1.10) |
|
131 | sass (>= 3.1.10) |
|
132 | tilt (~> 1.3) |
|
132 | tilt (~> 1.3) |
|
133 |
- sprockets (2.2. |
|
133 | + sprockets (2.2.3) |
|
134 | hike (~> 1.2) |
|
134 | hike (~> 1.2) |
|
135 | multi_json (~> 1.0) |
|
135 | multi_json (~> 1.0) |
|
136 | rack (~> 1.0) |
|
136 | rack (~> 1.0) |
|
137 | tilt (~> 1.1, != 1.3.0) |
|
137 | tilt (~> 1.1, != 1.3.0) |
|
138 |
- test-unit (3.0. |
|
138 | + test-unit (3.0.9) |
|
139 | power_assert |
|
139 | power_assert |
|
140 | thor (0.19.1) |
|
140 | thor (0.19.1) |
|
141 | tilt (1.4.1) |
|
141 | tilt (1.4.1) |
|
142 | treetop (1.4.15) |
|
142 | treetop (1.4.15) |
|
143 | polyglot |
|
143 | polyglot |
|
144 | polyglot (>= 0.3.1) |
|
144 | polyglot (>= 0.3.1) |
|
145 |
- tzinfo (0.3.4 |
|
145 | + tzinfo (0.3.43) |
|
146 |
- uglifier (2. |
|
146 | + uglifier (2.7.0) |
|
147 | execjs (>= 0.3.0) |
|
147 | execjs (>= 0.3.0) |
|
148 | json (>= 1.8.0) |
|
148 | json (>= 1.8.0) |
|
149 | will_paginate (3.0.7) |
|
149 | will_paginate (3.0.7) |
@@ -153,7 +153,7 | |||||
|
153 |
|
153 | ||
|
154 | DEPENDENCIES |
|
154 | DEPENDENCIES |
|
155 | best_in_place (~> 3.0.1) |
|
155 | best_in_place (~> 3.0.1) |
|
156 |
- coffee-rails (~> 3.2. |
|
156 | + coffee-rails (~> 3.2.2) |
|
157 | dynamic_form |
|
157 | dynamic_form |
|
158 | haml |
|
158 | haml |
|
159 | in_place_editing |
|
159 | in_place_editing |
@@ -164,12 +164,12 | |||||
|
164 |
|
164 | ||
|
165 | mysql2 |
|
165 | mysql2 |
|
166 | prototype-rails |
|
166 | prototype-rails |
|
167 |
- rails (= 3.2.1 |
|
167 | + rails (= 3.2.21) |
|
168 | rdiscount |
|
168 | rdiscount |
|
169 | rouge |
|
169 | rouge |
|
170 | - rspec-rails (~> 2.0) |
|
170 | + rspec-rails (~> 2.99.0) |
|
171 |
- sass-rails (~> 3.2. |
|
171 | + sass-rails (~> 3.2.6) |
|
172 | test-unit |
|
172 | test-unit |
|
173 |
- uglifier |
|
173 | + uglifier |
|
174 | verification! |
|
174 | verification! |
|
175 |
- will_paginate (~> 3.0. |
|
175 | + will_paginate (~> 3.0.7) |
@@ -37,7 +37,7 | |||||
|
37 | end |
|
37 | end |
|
38 |
|
38 | ||
|
39 | def change_contest_mode |
|
39 | def change_contest_mode |
|
40 | - if ['standard', 'contest', 'indv-contest'].include? params[:id] |
|
40 | + if ['standard', 'contest', 'indv-contest', 'analysis'].include? params[:id] |
|
41 | config = GraderConfiguration.find_by_key('system.mode') |
|
41 | config = GraderConfiguration.find_by_key('system.mode') |
|
42 | config.value = params[:id] |
|
42 | config.value = params[:id] |
|
43 | config.save |
|
43 | config.save |
@@ -71,7 +71,7 | |||||
|
71 | @submission.ip_address = request.remote_ip |
|
71 | @submission.ip_address = request.remote_ip |
|
72 |
|
72 | ||
|
73 | if GraderConfiguration.time_limit_mode? and user.contest_finished? |
|
73 | if GraderConfiguration.time_limit_mode? and user.contest_finished? |
|
74 |
- @submission.errors.add |
|
74 | + @submission.errors.add(:base,"The contest is over.") |
|
75 | prepare_list_information |
|
75 | prepare_list_information |
|
76 | render :action => 'list' and return |
|
76 | render :action => 'list' and return |
|
77 | end |
|
77 | end |
@@ -194,7 +194,7 | |||||
|
194 |
|
194 | ||
|
195 | def confirm_contest_start |
|
195 | def confirm_contest_start |
|
196 | user = User.find(session[:user_id]) |
|
196 | user = User.find(session[:user_id]) |
|
197 |
- if request.method == |
|
197 | + if request.method == 'POST' |
|
198 | user.update_start_time |
|
198 | user.update_start_time |
|
199 | redirect_to :action => 'list' |
|
199 | redirect_to :action => 'list' |
|
200 | else |
|
200 | else |
@@ -31,20 +31,21 | |||||
|
31 | user = User.find(session[:user_id]) |
|
31 | user = User.find(session[:user_id]) |
|
32 | @message = Message.new(params[:message]) |
|
32 | @message = Message.new(params[:message]) |
|
33 | @message.sender = user |
|
33 | @message.sender = user |
|
34 | - if !@message.save |
|
34 | + if @message.body == '' or !@message.save |
|
35 | - render :action => 'list' and return |
|
35 | + flash[:notice] = 'An error occurred' |
|
36 | else |
|
36 | else |
|
37 | flash[:notice] = 'New message posted' |
|
37 | flash[:notice] = 'New message posted' |
|
|
38 | + end | ||
|
38 |
|
|
39 | redirect_to :action => 'list' |
|
39 |
|
|
40 | end |
|
40 | - end |
|
||
|
41 |
|
41 | ||
|
42 | def reply |
|
42 | def reply |
|
43 | user = User.find(session[:user_id]) |
|
43 | user = User.find(session[:user_id]) |
|
44 | @message = Message.new(params[:r_message]) |
|
44 | @message = Message.new(params[:r_message]) |
|
45 | @message.sender = user |
|
45 | @message.sender = user |
|
46 | - if !@message.save |
|
46 | + if @message.body == '' or !@message.save |
|
47 | - render :action => 'show' and return |
|
47 | + flash[:notice] = 'An error occurred' |
|
|
48 | + redirect_to :action => 'show', :id => @message.replying_message_id | ||
|
48 | else |
|
49 | else |
|
49 | flash[:notice] = 'Message replied' |
|
50 | flash[:notice] = 'Message replied' |
|
50 | rep_msg = @message.replying_message |
|
51 | rep_msg = @message.replying_message |
@@ -58,7 +59,7 | |||||
|
58 | message = Message.find(params[:id]) |
|
59 | message = Message.find(params[:id]) |
|
59 | message.replied = true |
|
60 | message.replied = true |
|
60 | message.save |
|
61 | message.save |
|
61 |
- flash[:notice] = 'Message hid |
|
62 | + flash[:notice] = 'Message hidden (just marked replied)' |
|
62 | redirect_to :action => 'console' |
|
63 | redirect_to :action => 'console' |
|
63 | end |
|
64 | end |
|
64 |
|
65 |
@@ -26,7 +26,7 | |||||
|
26 |
|
26 | ||
|
27 | if GraderConfiguration.time_limit_mode? |
|
27 | if GraderConfiguration.time_limit_mode? |
|
28 | if @user.contest_finished? |
|
28 | if @user.contest_finished? |
|
29 |
- @submitted_test_request.errors.add |
|
29 | + @submitted_test_request.errors.add(:base,'Contest is over.') |
|
30 | prepare_index_information |
|
30 | prepare_index_information |
|
31 | render :action => 'index' and return |
|
31 | render :action => 'index' and return |
|
32 | end |
|
32 | end |
@@ -2,7 +2,6 | |||||
|
2 |
|
2 | ||
|
3 | class UserAdminController < ApplicationController |
|
3 | class UserAdminController < ApplicationController |
|
4 |
|
4 | ||
|
5 | - |
|
||
|
6 | include MailHelperMethods |
|
5 | include MailHelperMethods |
|
7 |
|
6 | ||
|
8 | before_filter :admin_authorization |
|
7 | before_filter :admin_authorization |
@@ -151,13 +150,6 | |||||
|
151 | end |
|
150 | end |
|
152 | @scorearray << ustat |
|
151 | @scorearray << ustat |
|
153 | end |
|
152 | end |
|
154 | - |
|
||
|
155 | - if params[:commit] == 'download csv' then |
|
||
|
156 | - csv = gen_csv_from_scorearray(@scorearray,@problems) |
|
||
|
157 | - send_data csv, filename: 'last_score.csv' |
|
||
|
158 | - else |
|
||
|
159 | - render template: 'user_admin/user_stat' |
|
||
|
160 | - end |
|
||
|
161 | end |
|
153 | end |
|
162 |
|
154 | ||
|
163 | def user_stat_max |
|
155 | def user_stat_max |
@@ -63,7 +63,7 | |||||
|
63 | render :action => 'email_error', :layout => 'empty' |
|
63 | render :action => 'email_error', :layout => 'empty' |
|
64 | end |
|
64 | end |
|
65 | else |
|
65 | else |
|
66 |
- @user.errors.add |
|
66 | + @user.errors.add(:base,"Email cannot be blank") if @user.email=='' |
|
67 | render :action => 'new', :layout => 'empty' |
|
67 | render :action => 'new', :layout => 'empty' |
|
68 | end |
|
68 | end |
|
69 | end |
|
69 | end |
@@ -154,7 +154,7 | |||||
|
154 | :login => user.login, |
|
154 | :login => user.login, |
|
155 | :password => user.password, |
|
155 | :password => user.password, |
|
156 | :activation_url => activation_url, |
|
156 | :activation_url => activation_url, |
|
157 | - :admin_email => admin_email |
|
157 | + :admin_email => GraderConfiguration['system.admin_email'] |
|
158 | }) |
|
158 | }) |
|
159 |
|
159 | ||
|
160 | logger.info mail_body |
|
160 | logger.info mail_body |
@@ -170,7 +170,7 | |||||
|
170 | :contest_name => contest_name, |
|
170 | :contest_name => contest_name, |
|
171 | :login => user.login, |
|
171 | :login => user.login, |
|
172 | :password => user.password, |
|
172 | :password => user.password, |
|
173 | - :admin_email => admin_email |
|
173 | + :admin_email => GraderConfiguration['system.admin_email'] |
|
174 | }) |
|
174 | }) |
|
175 |
|
175 | ||
|
176 | logger.info mail_body |
|
176 | logger.info mail_body |
@@ -118,7 +118,7 | |||||
|
118 | <tr> |
|
118 | <tr> |
|
119 | <td class="left-col"> |
|
119 | <td class="left-col"> |
|
120 | #{user.full_name}<br/> |
|
120 | #{user.full_name}<br/> |
|
121 | - #{t 'title_bar.current_time'} #{format_short_time(Time.new)} |
|
121 | + #{t 'title_bar.current_time'} #{format_short_time(Time.zone.now)} |
|
122 | #{time_left} |
|
122 | #{time_left} |
|
123 | <br/> |
|
123 | <br/> |
|
124 | </td> |
|
124 | </td> |
@@ -45,7 +45,7 | |||||
|
45 | import_params[:memory_limit], |
|
45 | import_params[:memory_limit], |
|
46 | import_params[:checker_name], |
|
46 | import_params[:checker_name], |
|
47 | import_to_db) |
|
47 | import_to_db) |
|
48 |
- problem.errors.add |
|
48 | + problem.errors.add(:base,'Import error.') |
|
49 | end |
|
49 | end |
|
50 |
|
50 | ||
|
51 | return problem, importer.log_msg |
|
51 | return problem, importer.log_msg |
@@ -85,17 +85,17 | |||||
|
85 | DEFAULT_MEMORY_LIMIT) |
|
85 | DEFAULT_MEMORY_LIMIT) |
|
86 |
|
86 | ||
|
87 | if time_limit<=0 or time_limit >60 |
|
87 | if time_limit<=0 or time_limit >60 |
|
88 |
- problem.errors.add |
|
88 | + problem.errors.add(:base,'Time limit out of range.') |
|
89 | end |
|
89 | end |
|
90 |
|
90 | ||
|
91 | if memory_limit==0 and params[:memory_limit]!='0' |
|
91 | if memory_limit==0 and params[:memory_limit]!='0' |
|
92 |
- problem.errors.add |
|
92 | + problem.errors.add(:base,'Memory limit format errors.') |
|
93 | elsif memory_limit<=0 or memory_limit >512 |
|
93 | elsif memory_limit<=0 or memory_limit >512 |
|
94 |
- problem.errors.add |
|
94 | + problem.errors.add(:base,'Memory limit out of range.') |
|
95 | end |
|
95 | end |
|
96 |
|
96 | ||
|
97 | if params[:file]==nil or params[:file]=='' |
|
97 | if params[:file]==nil or params[:file]=='' |
|
98 |
- problem.errors.add |
|
98 | + problem.errors.add(:base,'No testdata file.') |
|
99 | end |
|
99 | end |
|
100 |
|
100 | ||
|
101 | checker_name = 'text' |
|
101 | checker_name = 'text' |
@@ -70,12 +70,12 | |||||
|
70 |
|
70 | ||
|
71 | # checks if the user submits any input file |
|
71 | # checks if the user submits any input file |
|
72 | if params[:input_file]==nil or params[:input_file]=="" |
|
72 | if params[:input_file]==nil or params[:input_file]=="" |
|
73 |
- test_request.errors.add |
|
73 | + test_request.errors.add(:base,"No input submitted.") |
|
74 | test_request.input_file_name = nil |
|
74 | test_request.input_file_name = nil |
|
75 | else |
|
75 | else |
|
76 | test_request.input_file_name = save_input_file(params[:input_file], user, problem) |
|
76 | test_request.input_file_name = save_input_file(params[:input_file], user, problem) |
|
77 | if test_request.input_file_name == nil |
|
77 | if test_request.input_file_name == nil |
|
78 |
- test_request.errors.add |
|
78 | + test_request.errors.adds(:base,"No input submitted.") |
|
79 | end |
|
79 | end |
|
80 | if params[:additional_file]!=nil and params[:additional_file]!="" |
|
80 | if params[:additional_file]!=nil and params[:additional_file]!="" |
|
81 | save_additional_file(params[:additional_file], |
|
81 | save_additional_file(params[:additional_file], |
@@ -67,11 +67,6 | |||||
|
67 | user = find_by_login(login) |
|
67 | user = find_by_login(login) |
|
68 | if user |
|
68 | if user |
|
69 | return user if user.authenticated?(password) |
|
69 | return user if user.authenticated?(password) |
|
70 | - if user.authenticated_by_cucas?(password) or user.authenticated_by_pop3?(password) |
|
||
|
71 | - user.password = password |
|
||
|
72 | - user.save |
|
||
|
73 | - return user |
|
||
|
74 | - end |
|
||
|
75 | end |
|
70 | end |
|
76 | end |
|
71 | end |
|
77 |
|
72 | ||
@@ -83,48 +78,6 | |||||
|
83 | end |
|
78 | end |
|
84 | end |
|
79 | end |
|
85 |
|
80 | ||
|
86 | - def authenticated_by_pop3?(password) |
|
||
|
87 | - Net::POP3.enable_ssl |
|
||
|
88 | - pop = Net::POP3.new('pops.it.chula.ac.th') |
|
||
|
89 | - authen = true |
|
||
|
90 | - begin |
|
||
|
91 | - pop.start(login, password) |
|
||
|
92 | - pop.finish |
|
||
|
93 | - return true |
|
||
|
94 | - rescue |
|
||
|
95 | - return false |
|
||
|
96 | - end |
|
||
|
97 | - end |
|
||
|
98 | - |
|
||
|
99 | - def authenticated_by_cucas?(password) |
|
||
|
100 | - url = URI.parse('https://www.cas.chula.ac.th/cas/api/?q=studentAuthenticate') |
|
||
|
101 | - appid = '41508763e340d5858c00f8c1a0f5a2bb' |
|
||
|
102 | - appsecret ='d9cbb5863091dbe186fded85722a1e31' |
|
||
|
103 | - post_args = { |
|
||
|
104 | - 'appid' => appid, |
|
||
|
105 | - 'appsecret' => appsecret, |
|
||
|
106 | - 'username' => login, |
|
||
|
107 | - 'password' => password |
|
||
|
108 | - } |
|
||
|
109 | - |
|
||
|
110 | - #simple call |
|
||
|
111 | - begin |
|
||
|
112 | - http = Net::HTTP.new('www.cas.chula.ac.th', 443) |
|
||
|
113 | - http.use_ssl = true |
|
||
|
114 | - result = [ ] |
|
||
|
115 | - http.start do |http| |
|
||
|
116 | - req = Net::HTTP::Post.new('/cas/api/?q=studentAuthenticate') |
|
||
|
117 | - param = "appid=#{appid}&appsecret=#{appsecret}&username=#{login}&password=#{password}" |
|
||
|
118 | - resp = http.request(req,param) |
|
||
|
119 | - result = JSON.parse resp.body |
|
||
|
120 | - end |
|
||
|
121 | - return true if result["type"] == "beanStudent" |
|
||
|
122 | - rescue |
|
||
|
123 | - return false |
|
||
|
124 | - end |
|
||
|
125 | - return false |
|
||
|
126 | - end |
|
||
|
127 | - |
|
||
|
128 | def admin? |
|
81 | def admin? |
|
129 | self.roles.detect {|r| r.name == 'admin' } |
|
82 | self.roles.detect {|r| r.name == 'admin' } |
|
130 | end |
|
83 | end |
@@ -351,7 +304,7 | |||||
|
351 | def uniqueness_of_email_from_activated_users |
|
304 | def uniqueness_of_email_from_activated_users |
|
352 | user = User.activated_users.find_by_email(self.email) |
|
305 | user = User.activated_users.find_by_email(self.email) |
|
353 | if user and (user.login != self.login) |
|
306 | if user and (user.login != self.login) |
|
354 |
- self.errors.add |
|
307 | + self.errors.add(:base,"Email has already been taken") |
|
355 | end |
|
308 | end |
|
356 | end |
|
309 | end |
|
357 |
|
310 | ||
@@ -362,7 +315,7 | |||||
|
362 | :order => 'created_at DESC') |
|
315 | :order => 'created_at DESC') |
|
363 | if open_user and open_user.created_at and |
|
316 | if open_user and open_user.created_at and |
|
364 | (open_user.created_at > Time.now.gmtime - 5.minutes) |
|
317 | (open_user.created_at > Time.now.gmtime - 5.minutes) |
|
365 |
- self.errors.add |
|
318 | + self.errors.add(:base,"There are already unactivated registrations with this e-mail address (please wait for 5 minutes)") |
|
366 | end |
|
319 | end |
|
367 | end |
|
320 | end |
|
368 |
|
321 |
@@ -11,18 +11,21 | |||||
|
11 |
|
11 | ||
|
12 | .infobox |
|
12 | .infobox |
|
13 | %b Web interface mode: |
|
13 | %b Web interface mode: |
|
14 | - - if (not GraderConfiguration.contest_mode?) and (not GraderConfiguration.indv_contest_mode?) |
|
14 | + - if GraderConfiguration.analysis_mode? |
|
15 | - standard mode |
|
15 | + Analysis Mode |
|
|
16 | + - elsif (not GraderConfiguration.contest_mode?) and (not GraderConfiguration.indv_contest_mode?) | ||
|
|
17 | + Standard Mode | ||
|
16 | - elsif GraderConfiguration.contest_mode? |
|
18 | - elsif GraderConfiguration.contest_mode? |
|
17 |
- |
|
19 | + Normal Contest Mode |
|
18 | - else |
|
20 | - else |
|
19 |
- |
|
21 | + Individual Contest Mode |
|
20 |
|
22 | ||
|
21 | %br/ |
|
23 | %br/ |
|
22 | Change mode to: |
|
24 | Change mode to: |
|
23 |
- =raw "[#{link_to ' |
|
25 | + =raw "[#{link_to 'Standard', :action => 'change_contest_mode', :id => 'standard'}]" |
|
24 |
- =raw "[#{link_to ' |
|
26 | + =raw "[#{link_to 'Contest', :action => 'change_contest_mode', :id => 'contest'}]" |
|
25 |
- =raw "[#{link_to ' |
|
27 | + =raw "[#{link_to 'Individual Contest', :action => 'change_contest_mode', :id => 'indv-contest'}]" |
|
|
28 | + =raw "[#{link_to 'Analysis', :action => 'change_contest_mode', :id => 'analysis'}]" | ||
|
26 |
|
29 | ||
|
27 | - if GraderConfiguration.indv_contest_mode? |
|
30 | - if GraderConfiguration.indv_contest_mode? |
|
28 | = render :partial => 'indv_contest_mode_index' |
|
31 | = render :partial => 'indv_contest_mode_index' |
@@ -25,7 +25,7 | |||||
|
25 | - if @test_request.compiler_message!=nil and @test_request.compiler_message!='' |
|
25 | - if @test_request.compiler_message!=nil and @test_request.compiler_message!='' |
|
26 | %b Compiler Message |
|
26 | %b Compiler Message |
|
27 | %div{:style => "border: 1px solid black; background: lightgrey"} |
|
27 | %div{:style => "border: 1px solid black; background: lightgrey"} |
|
28 | - = simple_format(truncate((@test_request.compiler_message or ''),200)) |
|
28 | + = simple_format(truncate((@test_request.compiler_message or ''), :length => 200)) |
|
29 |
|
29 | ||
|
30 | %b Input (first 2kb) |
|
30 | %b Input (first 2kb) |
|
31 | %div{:style => "border: 1px solid black; background: lightgrey"} |
|
31 | %div{:style => "border: 1px solid black; background: lightgrey"} |
@@ -1,5 +1,5 | |||||
|
1 |
|
1 | ||
|
2 | - <% if compiler_message==nil or compiler_message=='' %> |
|
2 | + <% if compiler_message == nil or compiler_message.chomp == '' %> |
|
3 | No message |
|
3 | No message |
|
4 | <% else %> |
|
4 | <% else %> |
|
5 | <div><div><a href="#" onClick="n = this.parentNode.parentNode.lastChild; |
|
5 | <div><div><a href="#" onClick="n = this.parentNode.parentNode.lastChild; |
@@ -1,6 +1,6 | |||||
|
1 | %h2= "Compiler message for submission \##{@submission.number}, task: #{@submission.problem.name}" |
|
1 | %h2= "Compiler message for submission \##{@submission.number}, task: #{@submission.problem.name}" |
|
2 | %p |
|
2 | %p |
|
3 | - - if @submission.compiler_message.chomp == '' |
|
3 | + - if @submission.compiler_message == nil or @submission.compiler_message.chomp == '' |
|
4 |
- |
|
4 | + No message |
|
5 | - else |
|
5 | - else |
|
6 | = simple_format(@submission.compiler_message) |
|
6 | = simple_format(@submission.compiler_message) |
@@ -12,5 +12,5 | |||||
|
12 |
|
12 | ||
|
13 | =t 'main.confirm_contest_start.timer_starts_after_click' |
|
13 | =t 'main.confirm_contest_start.timer_starts_after_click' |
|
14 |
|
14 | ||
|
15 |
- = form_tag :action => 'confirm_contest_start' |
|
15 | + = form_tag :action => 'confirm_contest_start' do |
|
16 | = submit_tag t('main.confirm_contest_start.start_button'), :confirm => t('main.confirm_contest_start.start_button_confirm') |
|
16 | = submit_tag t('main.confirm_contest_start.start_button'), :confirm => t('main.confirm_contest_start.start_button_confirm') |
@@ -14,7 +14,7 | |||||
|
14 | <%= password_field 'user', 'password_confirmation' %></p> |
|
14 | <%= password_field 'user', 'password_confirmation' %></p> |
|
15 |
|
15 | ||
|
16 | <p><label for="user_email">E-mail</label><br/> |
|
16 | <p><label for="user_email">E-mail</label><br/> |
|
17 |
- <%= |
|
17 | + <%= email_field 'user', 'email' %></p> |
|
18 |
|
18 | ||
|
19 | <p><label for="user_alias">Alias</label><br/> |
|
19 | <p><label for="user_alias">Alias</label><br/> |
|
20 | <%= text_field 'user', 'alias' %></p> |
|
20 | <%= text_field 'user', 'alias' %></p> |
@@ -16,7 +16,7 | |||||
|
16 | <td><%= text_field 'user', 'full_name', :size => 30 %></td> |
|
16 | <td><%= text_field 'user', 'full_name', :size => 30 %></td> |
|
17 | <td><%= password_field 'user', 'password', :size => 10 %></td> |
|
17 | <td><%= password_field 'user', 'password', :size => 10 %></td> |
|
18 | <td><%= password_field 'user', 'password_confirmation', :size => 10 %></td> |
|
18 | <td><%= password_field 'user', 'password_confirmation', :size => 10 %></td> |
|
19 |
- <td><%= |
|
19 | + <td><%= email_field 'user', 'email', :size => 15 %></td> |
|
20 | <td><%= submit_tag "Create" %></td> |
|
20 | <td><%= submit_tag "Create" %></td> |
|
21 | </tr> |
|
21 | </tr> |
|
22 | </table> |
|
22 | </table> |
@@ -11,7 +11,8 | |||||
|
11 |
|
11 | ||
|
12 | = form_tag :action => 'retrieve_password' do |
|
12 | = form_tag :action => 'retrieve_password' do |
|
13 | =t 'registration.password_retrieval.instructions' |
|
13 | =t 'registration.password_retrieval.instructions' |
|
14 | - = text_field 'email', nil, :size => 20 |
|
14 | + %br/ |
|
|
15 | + = email_field 'email', nil, :size => 20 | ||
|
15 | %br/ |
|
16 | %br/ |
|
16 | = submit_tag(t 'registration.password_retrieval.button_label') |
|
17 | = submit_tag(t 'registration.password_retrieval.button_label') |
|
17 |
|
18 |
@@ -25,12 +25,12 | |||||
|
25 | %tr |
|
25 | %tr |
|
26 | %td{:align => "right"} |
|
26 | %td{:align => "right"} |
|
27 | = "#{t 'email_label'}:" |
|
27 | = "#{t 'email_label'}:" |
|
28 |
- %td= f. |
|
28 | + %td= f.email_field :email |
|
29 | %tr |
|
29 | %tr |
|
30 | %td |
|
30 | %td |
|
31 | %td |
|
31 | %td |
|
32 | %small |
|
32 | %small |
|
33 |
- =t |
|
33 | + =t('registration.email_guide').html_safe |
|
34 | %tr |
|
34 | %tr |
|
35 | %td/ |
|
35 | %td/ |
|
36 | %td |
|
36 | %td |
@@ -34,4 +34,7 | |||||
|
34 |
|
34 | ||
|
35 | # Expands the lines which load the assets |
|
35 | # Expands the lines which load the assets |
|
36 | config.assets.debug = true |
|
36 | config.assets.debug = true |
|
|
37 | + | ||
|
|
38 | + # Prevents assets from rendering twice | ||
|
|
39 | + config.serve_static_assets = false | ||
|
37 | end |
|
40 | end |
@@ -22,7 +22,18 | |||||
|
22 | body mail_body |
|
22 | body mail_body |
|
23 | end |
|
23 | end |
|
24 |
|
24 | ||
|
25 | - mail.delivery_settings = { :address => smtp_server } |
|
25 | + mail_option = { |
|
|
26 | + :address => smtp_server, | ||
|
|
27 | + # :domain => nil, | ||
|
|
28 | + # :port => 25, | ||
|
|
29 | + # :user_name => nil, | ||
|
|
30 | + # :password => nil, | ||
|
|
31 | + # :authentication=>'plain', | ||
|
|
32 | + # :enable_starttls_auto => true | ||
|
|
33 | + } | ||
|
|
34 | + | ||
|
|
35 | + mail.delivery_method :smtp, mail_option | ||
|
|
36 | + | ||
|
26 | mail.deliver |
|
37 | mail.deliver |
|
27 | end |
|
38 | end |
|
28 |
|
39 |
You need to be logged in to leave comments.
Login now