Description:
Merge pull request #12 from wytesk133/master Updated Gemfile and fixed various bugs
Commit status:
[Not Reviewed]
References:
merge default
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r379:91238b16dbc9 - - 11 files changed: 76 inserted, 71 deleted

@@ -1,50 +1,50
1 source 'https://rubygems.org'
1 source 'https://rubygems.org'
2
2
3 - gem 'rails', '3.2.19'
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'
7
7
8 gem 'mysql2'
8 gem 'mysql2'
9
9
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.3'
13 + gem 'sass-rails', '~> 3.2.6'
14 - gem 'coffee-rails', '~> 3.2.1'
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', '>= 1.0.3'
19 + gem 'uglifier'
20 end
20 end
21
21
22 gem 'prototype-rails'
22 gem 'prototype-rails'
23
23
24 # To use ActiveModel has_secure_password
24 # To use ActiveModel has_secure_password
25 # gem 'bcrypt-ruby', '~> 3.0.0'
25 # gem 'bcrypt-ruby', '~> 3.0.0'
26
26
27 # To use Jbuilder templates for JSON
27 # To use Jbuilder templates for JSON
28 # gem 'jbuilder'
28 # gem 'jbuilder'
29
29
30 # Use unicorn as the app server
30 # Use unicorn as the app server
31 # gem 'unicorn'
31 # gem 'unicorn'
32
32
33 # Deploy with Capistrano
33 # Deploy with Capistrano
34 # gem 'capistrano'
34 # gem 'capistrano'
35
35
36 # To use debugger
36 # To use debugger
37 # gem 'debugger'
37 # gem 'debugger'
38
38
39 - gem "haml"
39 + gem 'haml'
40 - gem "mail"
40 + gem 'mail'
41 - gem "rdiscount"
41 + gem 'rdiscount'
42 - gem "test-unit"
42 + gem 'test-unit'
43 - gem 'will_paginate', '~> 3.0.0'
43 + gem 'will_paginate', '~> 3.0.7'
44 gem 'dynamic_form'
44 gem 'dynamic_form'
45 gem 'in_place_editing'
45 gem 'in_place_editing'
46 - gem 'verification', :git => 'git://github.com/sikachu/verification.git'
46 + gem 'verification', :git => 'https://github.com/sikachu/verification.git'
47
47
48 group :test, :development do
48 group :test, :development do
49 - gem "rspec-rails", "~> 2.0"
49 + gem 'rspec-rails', '~> 2.99.0'
50 end
50 end
@@ -1,151 +1,151
1 GIT
1 GIT
2 - remote: git://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 - actionmailer (3.2.19)
12 + actionmailer (3.2.21)
13 - actionpack (= 3.2.19)
13 + actionpack (= 3.2.21)
14 mail (~> 2.5.4)
14 mail (~> 2.5.4)
15 - actionpack (3.2.19)
15 + actionpack (3.2.21)
16 - activemodel (= 3.2.19)
16 + activemodel (= 3.2.21)
17 - activesupport (= 3.2.19)
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)
21 rack (~> 1.4.5)
21 rack (~> 1.4.5)
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.19)
25 + activemodel (3.2.21)
26 - activesupport (= 3.2.19)
26 + activesupport (= 3.2.21)
27 builder (~> 3.0.0)
27 builder (~> 3.0.0)
28 - activerecord (3.2.19)
28 + activerecord (3.2.21)
29 - activemodel (= 3.2.19)
29 + activemodel (= 3.2.21)
30 - activesupport (= 3.2.19)
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.19)
33 + activeresource (3.2.21)
34 - activemodel (= 3.2.19)
34 + activemodel (= 3.2.21)
35 - activesupport (= 3.2.19)
35 + activesupport (= 3.2.21)
36 - activesupport (3.2.19)
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 builder (3.0.4)
40 builder (3.0.4)
41 coffee-rails (3.2.2)
41 coffee-rails (3.2.2)
42 coffee-script (>= 2.2.0)
42 coffee-script (>= 2.2.0)
43 railties (~> 3.2.0)
43 railties (~> 3.2.0)
44 coffee-script (2.3.0)
44 coffee-script (2.3.0)
45 coffee-script-source
45 coffee-script-source
46 execjs
46 execjs
47 - coffee-script-source (1.7.1)
47 + coffee-script-source (1.8.0)
48 diff-lcs (1.2.5)
48 diff-lcs (1.2.5)
49 dynamic_form (1.1.4)
49 dynamic_form (1.1.4)
50 erubis (2.7.0)
50 erubis (2.7.0)
51 - execjs (2.2.1)
51 + execjs (2.2.2)
52 - haml (4.0.5)
52 + haml (4.0.6)
53 tilt
53 tilt
54 hike (1.2.3)
54 hike (1.2.3)
55 - i18n (0.6.11)
55 + i18n (0.7.0)
56 in_place_editing (1.2.0)
56 in_place_editing (1.2.0)
57 journey (1.0.4)
57 journey (1.0.4)
58 json (1.8.1)
58 json (1.8.1)
59 mail (2.5.4)
59 mail (2.5.4)
60 mime-types (~> 1.16)
60 mime-types (~> 1.16)
61 treetop (~> 1.4.8)
61 treetop (~> 1.4.8)
62 mime-types (1.25.1)
62 mime-types (1.25.1)
63 multi_json (1.10.1)
63 multi_json (1.10.1)
64 - mysql2 (0.3.16)
64 + mysql2 (0.3.17)
65 polyglot (0.3.5)
65 polyglot (0.3.5)
66 - power_assert (0.1.3)
66 + power_assert (0.2.2)
67 prototype-rails (3.2.1)
67 prototype-rails (3.2.1)
68 rails (~> 3.2)
68 rails (~> 3.2)
69 rack (1.4.5)
69 rack (1.4.5)
70 rack-cache (1.2)
70 rack-cache (1.2)
71 rack (>= 0.4)
71 rack (>= 0.4)
72 rack-ssl (1.3.4)
72 rack-ssl (1.3.4)
73 rack
73 rack
74 rack-test (0.6.2)
74 rack-test (0.6.2)
75 rack (>= 1.0)
75 rack (>= 1.0)
76 - rails (3.2.19)
76 + rails (3.2.21)
77 - actionmailer (= 3.2.19)
77 + actionmailer (= 3.2.21)
78 - actionpack (= 3.2.19)
78 + actionpack (= 3.2.21)
79 - activerecord (= 3.2.19)
79 + activerecord (= 3.2.21)
80 - activeresource (= 3.2.19)
80 + activeresource (= 3.2.21)
81 - activesupport (= 3.2.19)
81 + activesupport (= 3.2.21)
82 bundler (~> 1.0)
82 bundler (~> 1.0)
83 - railties (= 3.2.19)
83 + railties (= 3.2.21)
84 - railties (3.2.19)
84 + railties (3.2.21)
85 - actionpack (= 3.2.19)
85 + actionpack (= 3.2.21)
86 - activesupport (= 3.2.19)
86 + activesupport (= 3.2.21)
87 rack-ssl (~> 1.3.2)
87 rack-ssl (~> 1.3.2)
88 rake (>= 0.8.7)
88 rake (>= 0.8.7)
89 rdoc (~> 3.4)
89 rdoc (~> 3.4)
90 thor (>= 0.14.6, < 2.0)
90 thor (>= 0.14.6, < 2.0)
91 - rake (10.3.2)
91 + rake (10.4.2)
92 rdiscount (2.1.7.1)
92 rdiscount (2.1.7.1)
93 rdoc (3.12.2)
93 rdoc (3.12.2)
94 json (~> 1.4)
94 json (~> 1.4)
95 - rspec-collection_matchers (1.0.0)
95 + rspec-collection_matchers (1.1.2)
96 rspec-expectations (>= 2.99.0.beta1)
96 rspec-expectations (>= 2.99.0.beta1)
97 rspec-core (2.99.2)
97 rspec-core (2.99.2)
98 rspec-expectations (2.99.2)
98 rspec-expectations (2.99.2)
99 diff-lcs (>= 1.1.3, < 2.0)
99 diff-lcs (>= 1.1.3, < 2.0)
100 rspec-mocks (2.99.2)
100 rspec-mocks (2.99.2)
101 rspec-rails (2.99.0)
101 rspec-rails (2.99.0)
102 actionpack (>= 3.0)
102 actionpack (>= 3.0)
103 activemodel (>= 3.0)
103 activemodel (>= 3.0)
104 activesupport (>= 3.0)
104 activesupport (>= 3.0)
105 railties (>= 3.0)
105 railties (>= 3.0)
106 rspec-collection_matchers
106 rspec-collection_matchers
107 rspec-core (~> 2.99.0)
107 rspec-core (~> 2.99.0)
108 rspec-expectations (~> 2.99.0)
108 rspec-expectations (~> 2.99.0)
109 rspec-mocks (~> 2.99.0)
109 rspec-mocks (~> 2.99.0)
110 - sass (3.4.1)
110 + sass (3.4.9)
111 sass-rails (3.2.6)
111 sass-rails (3.2.6)
112 railties (~> 3.2.0)
112 railties (~> 3.2.0)
113 sass (>= 3.1.10)
113 sass (>= 3.1.10)
114 tilt (~> 1.3)
114 tilt (~> 1.3)
115 - sprockets (2.2.2)
115 + sprockets (2.2.3)
116 hike (~> 1.2)
116 hike (~> 1.2)
117 multi_json (~> 1.0)
117 multi_json (~> 1.0)
118 rack (~> 1.0)
118 rack (~> 1.0)
119 tilt (~> 1.1, != 1.3.0)
119 tilt (~> 1.1, != 1.3.0)
120 - test-unit (3.0.1)
120 + test-unit (3.0.9)
121 power_assert
121 power_assert
122 thor (0.19.1)
122 thor (0.19.1)
123 tilt (1.4.1)
123 tilt (1.4.1)
124 treetop (1.4.15)
124 treetop (1.4.15)
125 polyglot
125 polyglot
126 polyglot (>= 0.3.1)
126 polyglot (>= 0.3.1)
127 - tzinfo (0.3.41)
127 + tzinfo (0.3.42)
128 - uglifier (2.5.3)
128 + uglifier (2.6.0)
129 execjs (>= 0.3.0)
129 execjs (>= 0.3.0)
130 json (>= 1.8.0)
130 json (>= 1.8.0)
131 will_paginate (3.0.7)
131 will_paginate (3.0.7)
132
132
133 PLATFORMS
133 PLATFORMS
134 ruby
134 ruby
135
135
136 DEPENDENCIES
136 DEPENDENCIES
137 - coffee-rails (~> 3.2.1)
137 + coffee-rails (~> 3.2.2)
138 dynamic_form
138 dynamic_form
139 haml
139 haml
140 in_place_editing
140 in_place_editing
141 mail
141 mail
142 mysql2
142 mysql2
143 prototype-rails
143 prototype-rails
144 - rails (= 3.2.19)
144 + rails (= 3.2.21)
145 rdiscount
145 rdiscount
146 - rspec-rails (~> 2.0)
146 + rspec-rails (~> 2.99.0)
147 - sass-rails (~> 3.2.3)
147 + sass-rails (~> 3.2.6)
148 test-unit
148 test-unit
149 - uglifier (>= 1.0.3)
149 + uglifier
150 verification!
150 verification!
151 - will_paginate (~> 3.0.0)
151 + will_paginate (~> 3.0.7)
@@ -1,85 +1,86
1 class MessagesController < ApplicationController
1 class MessagesController < ApplicationController
2
2
3 before_filter :authenticate
3 before_filter :authenticate
4
4
5 verify :method => :post, :only => ['create'],
5 verify :method => :post, :only => ['create'],
6 :redirect_to => { :action => 'list' }
6 :redirect_to => { :action => 'list' }
7
7
8 before_filter :admin_authorization, :only => ['console','show',
8 before_filter :admin_authorization, :only => ['console','show',
9 'reply','hide','list_all']
9 'reply','hide','list_all']
10
10
11 def list
11 def list
12 @user = User.find(session[:user_id])
12 @user = User.find(session[:user_id])
13 @messages = Message.find_all_sent_by_user(@user)
13 @messages = Message.find_all_sent_by_user(@user)
14 end
14 end
15
15
16 def console
16 def console
17 @user = User.find(session[:user_id])
17 @user = User.find(session[:user_id])
18 @messages = Message.find_all_system_unreplied_messages
18 @messages = Message.find_all_system_unreplied_messages
19 end
19 end
20
20
21 def show
21 def show
22 @message = Message.find(params[:id])
22 @message = Message.find(params[:id])
23 end
23 end
24
24
25 def list_all
25 def list_all
26 @user = User.find(session[:user_id])
26 @user = User.find(session[:user_id])
27 @messages = Message.where(receiver_id: nil).order(:created_at)
27 @messages = Message.where(receiver_id: nil).order(:created_at)
28 end
28 end
29
29
30 def create
30 def create
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 - redirect_to :action => 'list'
39 end
38 end
39 + redirect_to :action => 'list'
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
51 rep_msg.replied = true
52 rep_msg.replied = true
52 rep_msg.save
53 rep_msg.save
53 redirect_to :action => 'console'
54 redirect_to :action => 'console'
54 end
55 end
55 end
56 end
56
57
57 def hide
58 def hide
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 hided (just marked replied)'
62 + flash[:notice] = 'Message hidden (just marked replied)'
62 redirect_to :action => 'console'
63 redirect_to :action => 'console'
63 end
64 end
64
65
65 protected
66 protected
66 def build_replying_message_hierarchy(user)
67 def build_replying_message_hierarchy(user)
67 @all_messages = {}
68 @all_messages = {}
68
69
69
70
70 # manually build replies hierarchy (to improve efficiency)
71 # manually build replies hierarchy (to improve efficiency)
71 [@messages, @replied_messages].each do |collection|
72 [@messages, @replied_messages].each do |collection|
72 collection.each do |m|
73 collection.each do |m|
73 @all_messages[m.id] = {:msg => m, :replies => []}
74 @all_messages[m.id] = {:msg => m, :replies => []}
74 end
75 end
75 end
76 end
76
77
77 @all_messages.each do |m|
78 @all_messages.each do |m|
78 rep_id = m.replying_message_id
79 rep_id = m.replying_message_id
79 if @all_messages[rep_id]!=nil
80 if @all_messages[rep_id]!=nil
80 @all_messages[rep_id][:replies] << m
81 @all_messages[rep_id][:replies] << m
81 end
82 end
82 end
83 end
83 end
84 end
84
85
85 end
86 end
@@ -1,15 +1,15
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;
6 if(n.style.display == 'none') { n.style.display = 'block'; }
6 if(n.style.display == 'none') { n.style.display = 'block'; }
7 else {n.style.display ='none'; } return false;">
7 else {n.style.display ='none'; } return false;">
8 (click to see)</a>
8 (click to see)</a>
9 </div>
9 </div>
10 <div style="display: none">
10 <div style="display: none">
11 <div class="compilermsgbody" style="border: thin solid grey; margin: 2px">
11 <div class="compilermsgbody" style="border: thin solid grey; margin: 2px">
12 <%=simple_format(compiler_message) %>
12 <%=simple_format(compiler_message) %>
13 </div>
13 </div>
14 </div></div>
14 </div></div>
15 <% end %>
15 <% end %>
@@ -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 - no message
4 + No message
5 - else
5 - else
6 = simple_format(@submission.compiler_message)
6 = simple_format(@submission.compiler_message)
@@ -1,22 +1,22
1 <%= error_messages_for 'user' %>
1 <%= error_messages_for 'user' %>
2
2
3 <!--[form:user]-->
3 <!--[form:user]-->
4 <p><label for="user_name">Login</label><br/>
4 <p><label for="user_name">Login</label><br/>
5 <%= text_field 'user', 'login' %></p>
5 <%= text_field 'user', 'login' %></p>
6
6
7 <p><label for="user_name">Full name</label><br/>
7 <p><label for="user_name">Full name</label><br/>
8 <%= text_field 'user', 'full_name' %></p>
8 <%= text_field 'user', 'full_name' %></p>
9
9
10 <p><label for="password">Password</label><br/>
10 <p><label for="password">Password</label><br/>
11 <%= password_field 'user', 'password' %></p>
11 <%= password_field 'user', 'password' %></p>
12
12
13 <p><label for="password_confirmation">Password (confirm)</label><br/>
13 <p><label for="password_confirmation">Password (confirm)</label><br/>
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 - <%= text_field 'user', 'email' %></p>
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>
21 <!--[eoform:user]-->
21 <!--[eoform:user]-->
22
22
@@ -1,86 +1,86
1 <h1>Listing users</h1>
1 <h1>Listing users</h1>
2
2
3 <div class="submitbox">
3 <div class="submitbox">
4 <b>Quick add</b>
4 <b>Quick add</b>
5 <%= form_tag :action => 'create' do %>
5 <%= form_tag :action => 'create' do %>
6 <table border="0">
6 <table border="0">
7 <tr>
7 <tr>
8 <td><label for="user_login">Login</label></td>
8 <td><label for="user_login">Login</label></td>
9 <td><label for="user_full_name">Full name</label></td>
9 <td><label for="user_full_name">Full name</label></td>
10 <td><label for="user_password">Password</label></td>
10 <td><label for="user_password">Password</label></td>
11 <td><label for="user_password_confirmation">Confirm</label></td>
11 <td><label for="user_password_confirmation">Confirm</label></td>
12 <td><label for="user_email">Email</label></td>
12 <td><label for="user_email">Email</label></td>
13 </tr>
13 </tr>
14 <tr>
14 <tr>
15 <td><%= text_field 'user', 'login', :size => 10 %></td>
15 <td><%= text_field 'user', 'login', :size => 10 %></td>
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><%= text_field 'user', 'email', :size => 15 %></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>
23 <% end %>
23 <% end %>
24 <br/>
24 <br/>
25 <b>Import from site management</b>
25 <b>Import from site management</b>
26 <%= form_tag({:action => 'import'}, :multipart => true) do %>
26 <%= form_tag({:action => 'import'}, :multipart => true) do %>
27 File: <%= file_field_tag 'file' %> <%= submit_tag 'Import' %>
27 File: <%= file_field_tag 'file' %> <%= submit_tag 'Import' %>
28 <% end %>
28 <% end %>
29 <br/>
29 <br/>
30 <b>What else: </b>
30 <b>What else: </b>
31 <%= link_to '[New user]', :action => 'new' %>
31 <%= link_to '[New user]', :action => 'new' %>
32 <%= link_to '[New list of users]', :action => 'new_list' %>
32 <%= link_to '[New list of users]', :action => 'new_list' %>
33 <%= link_to '[View administrators]', :action => 'admin' %>
33 <%= link_to '[View administrators]', :action => 'admin' %>
34 <%= link_to '[Random passwords]', :action => 'random_all_passwords' %>
34 <%= link_to '[Random passwords]', :action => 'random_all_passwords' %>
35 <%= link_to '[View active users]', :action => 'active' %>
35 <%= link_to '[View active users]', :action => 'active' %>
36 <%= link_to '[Mass mailing]', :action => 'mass_mailing' %>
36 <%= link_to '[Mass mailing]', :action => 'mass_mailing' %>
37 <% if GraderConfiguration.multicontests? %>
37 <% if GraderConfiguration.multicontests? %>
38 <br/><b>Multi-contest:</b>
38 <br/><b>Multi-contest:</b>
39 <%= link_to '[Manage bulk users in contests]', :action => 'contest_management' %>
39 <%= link_to '[Manage bulk users in contests]', :action => 'contest_management' %>
40 View users in:
40 View users in:
41 <% @contests.each do |contest| %>
41 <% @contests.each do |contest| %>
42 <%= link_to "[#{contest.name}]", :action => 'contests', :id => contest.id %>
42 <%= link_to "[#{contest.name}]", :action => 'contests', :id => contest.id %>
43 <% end %>
43 <% end %>
44 <%= link_to "[no contest]", :action => 'contests', :id => 'none' %>
44 <%= link_to "[no contest]", :action => 'contests', :id => 'none' %>
45 <% end %>
45 <% end %>
46 </div>
46 </div>
47
47
48 Total <%= @user_count %> users |
48 Total <%= @user_count %> users |
49 <% if !@paginated %>
49 <% if !@paginated %>
50 Display all users.
50 Display all users.
51 <%= link_to '[show in pages]', :action => 'list', :page => '1' %>
51 <%= link_to '[show in pages]', :action => 'list', :page => '1' %>
52 <% else %>
52 <% else %>
53 Display in pages.
53 Display in pages.
54 <%= link_to '[display all]', :action => 'list', :page => 'all' %> |
54 <%= link_to '[display all]', :action => 'list', :page => 'all' %> |
55 <%= will_paginate @users, :container => false %>
55 <%= will_paginate @users, :container => false %>
56 <% end %>
56 <% end %>
57 <table class="info">
57 <table class="info">
58 <tr class="info-head">
58 <tr class="info-head">
59 <% for column in User.content_columns %>
59 <% for column in User.content_columns %>
60 <% if !@hidden_columns.index(column.name) %>
60 <% if !@hidden_columns.index(column.name) %>
61 <th><%= column.human_name %></th>
61 <th><%= column.human_name %></th>
62 <% end %>
62 <% end %>
63 <% end %>
63 <% end %>
64 <th></th>
64 <th></th>
65 <th></th>
65 <th></th>
66 <th></th>
66 <th></th>
67 </tr>
67 </tr>
68
68
69 <% for user in @users %>
69 <% for user in @users %>
70 <tr class="info-<%= cycle("odd","even") %>">
70 <tr class="info-<%= cycle("odd","even") %>">
71 <% for column in User.content_columns %>
71 <% for column in User.content_columns %>
72 <% if !@hidden_columns.index(column.name) %>
72 <% if !@hidden_columns.index(column.name) %>
73 <td><%=h user.send(column.name) %></td>
73 <td><%=h user.send(column.name) %></td>
74 <% end %>
74 <% end %>
75 <% end %>
75 <% end %>
76 <td><%= link_to 'Show', :action => 'show', :id => user %></td>
76 <td><%= link_to 'Show', :action => 'show', :id => user %></td>
77 <td><%= link_to 'Edit', :action => 'edit', :id => user %></td>
77 <td><%= link_to 'Edit', :action => 'edit', :id => user %></td>
78 <td><%= link_to 'Destroy', { :action => 'destroy', :id => user }, :confirm => 'Are you sure?', :method => :post %></td>
78 <td><%= link_to 'Destroy', { :action => 'destroy', :id => user }, :confirm => 'Are you sure?', :method => :post %></td>
79 </tr>
79 </tr>
80 <% end %>
80 <% end %>
81 </table>
81 </table>
82
82
83 <br />
83 <br />
84
84
85 <%= link_to '[New user]', :action => 'new' %>
85 <%= link_to '[New user]', :action => 'new' %>
86 <%= link_to '[New list of users]', :action => 'new_list' %>
86 <%= link_to '[New list of users]', :action => 'new_list' %>
@@ -1,18 +1,19
1 .contest-title
1 .contest-title
2 %h1
2 %h1
3 = "#{GraderConfiguration['contest.name']}: #{t 'registration.password_retrieval.header'}"
3 = "#{GraderConfiguration['contest.name']}: #{t 'registration.password_retrieval.header'}"
4
4
5 - if flash[:notice]
5 - if flash[:notice]
6 %hr/
6 %hr/
7 %b= flash[:notice]
7 %b= flash[:notice]
8 %hr/
8 %hr/
9
9
10 %br/
10 %br/
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
18 = link_to "#{t 'go_back_to'}#{t 'home_page'}", :controller => 'main', :action => 'index'
19 = link_to "#{t 'go_back_to'}#{t 'home_page'}", :controller => 'main', :action => 'index'
@@ -1,39 +1,39
1 .contest-title
1 .contest-title
2 %h1
2 %h1
3 = "#{GraderConfiguration['contest.name']}: #{t 'registration.title'}"
3 = "#{GraderConfiguration['contest.name']}: #{t 'registration.title'}"
4
4
5 .registration-desc
5 .registration-desc
6 =t 'registration.description'
6 =t 'registration.description'
7
7
8 = error_messages_for :user, :header_message => (t 'registration.errors.header')
8 = error_messages_for :user, :header_message => (t 'registration.errors.header')
9
9
10 %table
10 %table
11 = form_for @user, :url => { :action => 'register' } do |f|
11 = form_for @user, :url => { :action => 'register' } do |f|
12 %tr
12 %tr
13 %td{:align => "right"}
13 %td{:align => "right"}
14 = "#{t 'login_label'}:"
14 = "#{t 'login_label'}:"
15 %td= f.text_field :login
15 %td= f.text_field :login
16 %tr
16 %tr
17 %td
17 %td
18 %td
18 %td
19 %small
19 %small
20 =t 'registration.login_guide'
20 =t 'registration.login_guide'
21 %tr
21 %tr
22 %td{:align => "right"}
22 %td{:align => "right"}
23 = "#{t 'full_name_label'}:"
23 = "#{t 'full_name_label'}:"
24 %td= f.text_field :full_name
24 %td= f.text_field :full_name
25 %tr
25 %tr
26 %td{:align => "right"}
26 %td{:align => "right"}
27 = "#{t 'email_label'}:"
27 = "#{t 'email_label'}:"
28 - %td= f.text_field :email
28 + %td= f.email_field :email
29 %tr
29 %tr
30 %td
30 %td
31 %td
31 %td
32 %small
32 %small
33 - =t 'registration.email_guide'
33 + =t('registration.email_guide').html_safe
34 %tr
34 %tr
35 %td/
35 %td/
36 %td
36 %td
37 = submit_tag((t 'registration.register'), :name => 'commit')
37 = submit_tag((t 'registration.register'), :name => 'commit')
38 = submit_tag((t 'cancel'), :name => 'cancel')
38 = submit_tag((t 'cancel'), :name => 'cancel')
39
39
@@ -1,37 +1,40
1 CafeGrader::Application.configure do
1 CafeGrader::Application.configure do
2 # Settings specified here will take precedence over those in config/application.rb
2 # Settings specified here will take precedence over those in config/application.rb
3
3
4 # In the development environment your application's code is reloaded on
4 # In the development environment your application's code is reloaded on
5 # every request. This slows down response time but is perfect for development
5 # every request. This slows down response time but is perfect for development
6 # since you don't have to restart the web server when you make code changes.
6 # since you don't have to restart the web server when you make code changes.
7 config.cache_classes = false
7 config.cache_classes = false
8
8
9 # Log error messages when you accidentally call methods on nil.
9 # Log error messages when you accidentally call methods on nil.
10 config.whiny_nils = true
10 config.whiny_nils = true
11
11
12 # Show full error reports and disable caching
12 # Show full error reports and disable caching
13 config.consider_all_requests_local = true
13 config.consider_all_requests_local = true
14 config.action_controller.perform_caching = false
14 config.action_controller.perform_caching = false
15
15
16 # Don't care if the mailer can't send
16 # Don't care if the mailer can't send
17 config.action_mailer.raise_delivery_errors = false
17 config.action_mailer.raise_delivery_errors = false
18
18
19 # Print deprecation notices to the Rails logger
19 # Print deprecation notices to the Rails logger
20 config.active_support.deprecation = :log
20 config.active_support.deprecation = :log
21
21
22 # Only use best-standards-support built into browsers
22 # Only use best-standards-support built into browsers
23 config.action_dispatch.best_standards_support = :builtin
23 config.action_dispatch.best_standards_support = :builtin
24
24
25 # Raise exception on mass assignment protection for Active Record models
25 # Raise exception on mass assignment protection for Active Record models
26 config.active_record.mass_assignment_sanitizer = :strict
26 config.active_record.mass_assignment_sanitizer = :strict
27
27
28 # Log the query plan for queries taking more than this (works
28 # Log the query plan for queries taking more than this (works
29 # with SQLite, MySQL, and PostgreSQL)
29 # with SQLite, MySQL, and PostgreSQL)
30 config.active_record.auto_explain_threshold_in_seconds = 0.5
30 config.active_record.auto_explain_threshold_in_seconds = 0.5
31
31
32 # Do not compress assets
32 # Do not compress assets
33 config.assets.compress = false
33 config.assets.compress = false
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
@@ -1,158 +1,158
1 # Sample localization file for English. Add more files in this directory for other locales.
1 # Sample localization file for English. Add more files in this directory for other locales.
2 # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
2 # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
3
4 en:
4 en:
5 cancel: 'Cancel'
5 cancel: 'Cancel'
6
6
7 login_label: 'Login'
7 login_label: 'Login'
8 full_name_label: 'Full name'
8 full_name_label: 'Full name'
9 email_label: 'E-mail'
9 email_label: 'E-mail'
10 password_label: 'Password'
10 password_label: 'Password'
11
11
12 - go_ahead_to: "Go ahead to"
12 + go_ahead_to: "Go ahead to "
13 - go_back_to: "Go back to"
13 + go_back_to: "Go back to "
14 login_page: "login page"
14 login_page: "login page"
15 home_page: "home page"
15 home_page: "home page"
16
16
17 menu:
17 menu:
18 main: 'Main'
18 main: 'Main'
19 messages: 'Messages'
19 messages: 'Messages'
20 tasks: 'Tasks'
20 tasks: 'Tasks'
21 submissions: 'Submissions'
21 submissions: 'Submissions'
22 test: 'Test Interface'
22 test: 'Test Interface'
23 help: 'Help'
23 help: 'Help'
24 settings: 'Settings'
24 settings: 'Settings'
25 log_out: 'Log out'
25 log_out: 'Log out'
26
26
27 title_bar:
27 title_bar:
28 current_time: "Current time is"
28 current_time: "Current time is"
29 remaining_time: "Time left: "
29 remaining_time: "Time left: "
30 contest_not_started: "The contest has not started."
30 contest_not_started: "The contest has not started."
31
31
32 login:
32 login:
33 message: 'Please login to see the problem list'
33 message: 'Please login to see the problem list'
34 login_submit: 'Login'
34 login_submit: 'Login'
35 participation: 'Want to participate?'
35 participation: 'Want to participate?'
36 please: 'Please'
36 please: 'Please'
37 register: 'register'
37 register: 'register'
38 forget_password: 'Forget password?'
38 forget_password: 'Forget password?'
39
39
40 main:
40 main:
41 start_soon: "The contest at your site will start soon. Please wait."
41 start_soon: "The contest at your site will start soon. Please wait."
42 specified_in_header: "Specified in header"
42 specified_in_header: "Specified in header"
43
43
44 problem_desc: "desc"
44 problem_desc: "desc"
45 submitted_at: "Submitted at"
45 submitted_at: "Submitted at"
46 graded_at: "Graded at"
46 graded_at: "Graded at"
47 score: "score: "
47 score: "score: "
48 cmp_msg: "compiler msg"
48 cmp_msg: "compiler msg"
49 src_link: "src"
49 src_link: "src"
50 submissions_link: "submissions"
50 submissions_link: "submissions"
51
51
52 confirm_contest_start:
52 confirm_contest_start:
53 box_title: "Contest confirmation"
53 box_title: "Contest confirmation"
54 contest_list: "You will participate in contest:"
54 contest_list: "You will participate in contest:"
55 timer_starts_after_click: "The timer will start after you click the start button."
55 timer_starts_after_click: "The timer will start after you click the start button."
56 start_button: "Start!"
56 start_button: "Start!"
57 start_button_confirm: "Are you sure?"
57 start_button_confirm: "Are you sure?"
58
58
59 test:
59 test:
60 title: "Test Interface"
60 title: "Test Interface"
61 intro: "You can test your submission with your own test data on the grading environment using this test interface."
61 intro: "You can test your submission with your own test data on the grading environment using this test interface."
62 disabled_at_end_announcement: "<b>Note:</b> Test interface will be disabled in the last 30 minutes of the contest time on your site."
62 disabled_at_end_announcement: "<b>Note:</b> Test interface will be disabled in the last 30 minutes of the contest time on your site."
63
63
64 registration:
64 registration:
65 title: "New user registration"
65 title: "New user registration"
66
66
67 description: "Please enter your information below. Please make sure your e-mail is correct, because you will have to confirm the registration through an e-mail we send to that e-mail address."
67 description: "Please enter your information below. Please make sure your e-mail is correct, because you will have to confirm the registration through an e-mail we send to that e-mail address."
68
68
69 successful_title: "Registration successful"
69 successful_title: "Registration successful"
70
70
71 login_guide: "Only a-z, A-Z, 0-9 and _. Can be at most 20 characters long"
71 login_guide: "Only a-z, A-Z, 0-9 and _. Can be at most 20 characters long"
72 email_guide: "Please make sure that your e-mail is correct.<br/>You'll need to verify your account by email."
72 email_guide: "Please make sure that your e-mail is correct.<br/>You'll need to verify your account by email."
73 register: "Register"
73 register: "Register"
74
74
75 email_body: "Hello %{full_name},
75 email_body: "Hello %{full_name},
76
76
77 You have registered for %{contest_name}
77 You have registered for %{contest_name}
78
78
79 Your login is: %{login}
79 Your login is: %{login}
80
80
81 Your password is: %{password}
81 Your password is: %{password}
82
82
83 Please follow the link:
83 Please follow the link:
84
84
85 %{activation_url}
85 %{activation_url}
86
86
87 to activate your user account.
87 to activate your user account.
88
88
89 If you did not register, please ignore this e-mail
89 If you did not register, please ignore this e-mail
90 and report this event to %{admin_email}.
90 and report this event to %{admin_email}.
91
91
92 Thanks!"
92 Thanks!"
93
93
94 email_sent: "We have sent a confimation message to your e-mail. (Please also check the Junk mail box."
94 email_sent: "We have sent a confimation message to your e-mail. (Please also check the Junk mail box."
95 email_verify_at: "Please check at %{email} and confirm."
95 email_verify_at: "Please check at %{email} and confirm."
96
96
97 activation_sucessful_title: "User activated"
97 activation_sucessful_title: "User activated"
98 account_activated: "Your account has been activated."
98 account_activated: "Your account has been activated."
99
99
100 activation_failed_title: "Activation failed"
100 activation_failed_title: "Activation failed"
101
101
102 errors:
102 errors:
103 header: "Errors occured during registration"
103 header: "Errors occured during registration"
104 email:
104 email:
105 title: "Errors in sending registration confirmation"
105 title: "Errors in sending registration confirmation"
106 expl: "<h2>Your user account has been created, but the system cannot send you the confirmation e-mail.</h2>
106 expl: "<h2>Your user account has been created, but the system cannot send you the confirmation e-mail.</h2>
107 Maybe there's a problem in the configuration. Please report the admin at %{email}.<br/>Thank you!"
107 Maybe there's a problem in the configuration. Please report the admin at %{email}.<br/>Thank you!"
108 activation:
108 activation:
109 email_exists: "A user with this E-mail exists."
109 email_exists: "A user with this E-mail exists."
110 invalid: "Your activation code is invalid. Please check again."
110 invalid: "Your activation code is invalid. Please check again."
111
111
112 password_retrieval:
112 password_retrieval:
113 header: "Password retrieval"
113 header: "Password retrieval"
114 instructions: "Please enter the e-mail address that you used to register."
114 instructions: "Please enter the e-mail address that you used to register."
115 button_label: "Request new password"
115 button_label: "Request new password"
116 no_email: "No user with that e-mail address."
116 no_email: "No user with that e-mail address."
117 email_body: "Hello %{full_name},
117 email_body: "Hello %{full_name},
118
118
119 You have requested for new password for %{contest_name}. We have generated it for you:
119 You have requested for new password for %{contest_name}. We have generated it for you:
120
120
121 user name: %{login}
121 user name: %{login}
122 password: %{password}
122 password: %{password}
123
123
124 If you didn't ask for new password or you're not the person who registered,
124 If you didn't ask for new password or you're not the person who registered,
125 please ignore this e-mail and inform %{admin_email} of this mistake.
125 please ignore this e-mail and inform %{admin_email} of this mistake.
126
126
127 Thanks!"
127 Thanks!"
128
128
129 contest:
129 contest:
130 notification:
130 notification:
131 email_subject: "[%{contest_title_name}] You have been upgraded to %{contest_name}"
131 email_subject: "[%{contest_title_name}] You have been upgraded to %{contest_name}"
132 email_body: "Congratulations %{full_name},
132 email_body: "Congratulations %{full_name},
133
133
134 You have advanced to contest %{contest_name} in %{contest_title_name}.
134 You have advanced to contest %{contest_name} in %{contest_title_name}.
135
135
136 You can now log-in and start participating in that contest.
136 You can now log-in and start participating in that contest.
137
137
138 Cheers!
138 Cheers!
139 -%{contest_title_name} Admin"
139 -%{contest_title_name} Admin"
140
140
141 help:
141 help:
142 how_to_submit: "How to submit"
142 how_to_submit: "How to submit"
143 must_specify_language: "You <b>must</b> specify the language you are using in your program header. You can optionally specify the task you are submitting to."
143 must_specify_language: "You <b>must</b> specify the language you are using in your program header. You can optionally specify the task you are submitting to."
144 list_available_language: "The possible language options are <tt>C</tt>, <tt>C++</tt>, and <tt>Pascal</tt>. The follow are examples."
144 list_available_language: "The possible language options are <tt>C</tt>, <tt>C++</tt>, and <tt>Pascal</tt>. The follow are examples."
145 accept_only_language_specified: "The server <b>will not</b> accept your submission, if you do not specify the language."
145 accept_only_language_specified: "The server <b>will not</b> accept your submission, if you do not specify the language."
146 specifying_task: "Optionally, you can also specify the task with <tt>TASK:</tt> <i>taskname</i>. On the first page, the taskname for each task is shown in parentheses."
146 specifying_task: "Optionally, you can also specify the task with <tt>TASK:</tt> <i>taskname</i>. On the first page, the taskname for each task is shown in parentheses."
147 example_cpp: "For example, suppose you are using <tt>C++</tt> to write task <b>mobiles</b>, you put the following on top of your source code."
147 example_cpp: "For example, suppose you are using <tt>C++</tt> to write task <b>mobiles</b>, you put the following on top of your source code."
148 example_pas: "If you are using <tt>Pascal</tt> to write the same task, you'll use"
148 example_pas: "If you are using <tt>Pascal</tt> to write the same task, you'll use"
149 ask_questions_at_messages: "If you have any problems, you can ask at [<a href=\"%{url}\">%{message_link_name}</a>]."
149 ask_questions_at_messages: "If you have any problems, you can ask at [<a href=\"%{url}\">%{message_link_name}</a>]."
150
150
151 activerecord:
151 activerecord:
152 attributes:
152 attributes:
153 user:
153 user:
154 login: "login"
154 login: "login"
155 full_name: "full name"
155 full_name: "full name"
156 email: "e-mail"
156 email: "e-mail"
157 province: "province"
157 province: "province"
158
158
You need to be logged in to leave comments. Login now