Description:
modernize java-bm, merge with algo-bm,master
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r522:dd2e569af6cb - - 40 files changed: 205 inserted, 316 deleted
@@ -0,0 +1,11 | |||
|
1 | + %h1 Editing user | |
|
2 | + | |
|
3 | + = form_tag :action => 'update', :id => @user do | |
|
4 | + = error_messages_for 'user' | |
|
5 | + = render partial: "form" | |
|
6 | + = submit_tag "Edit" | |
|
7 | + | |
|
8 | + | |
|
9 | + = link_to 'Show', :action => 'show', :id => @user | |
|
10 | + | | |
|
11 | + = link_to 'Back', :action => 'list' |
@@ -0,0 +1,6 | |||
|
1 | + class AddMoreToUsers < ActiveRecord::Migration | |
|
2 | + def change | |
|
3 | + add_column :users, :enabled, :boolean, default: 1 | |
|
4 | + add_column :users, :remark, :string | |
|
5 | + end | |
|
6 | + end |
@@ -1,6 +1,6 | |||
|
1 | 1 | source 'https://rubygems.org' |
|
2 | 2 | |
|
3 |
- gem 'rails', '3.2.1 |
|
|
3 | + gem 'rails', '3.2.21' | |
|
4 | 4 | |
|
5 | 5 | # Bundle edge Rails instead: |
|
6 | 6 | # gem 'rails', :git => 'git://github.com/rails/rails.git' |
@@ -10,13 +10,13 | |||
|
10 | 10 | # Gems used only for assets and not required |
|
11 | 11 | # in production environments by default. |
|
12 | 12 | group :assets do |
|
13 |
- gem 'sass-rails', '~> 3.2. |
|
|
14 |
- gem 'coffee-rails', '~> 3.2. |
|
|
13 | + gem 'sass-rails', '~> 3.2.6' | |
|
14 | + gem 'coffee-rails', '~> 3.2.2' | |
|
15 | 15 | |
|
16 | 16 | # See https://github.com/sstephenson/execjs#readme for more supported runtimes |
|
17 | 17 | # gem 'therubyracer', :platforms => :ruby |
|
18 | 18 | |
|
19 |
- gem 'uglifier' |
|
|
19 | + gem 'uglifier' | |
|
20 | 20 | end |
|
21 | 21 | |
|
22 | 22 | gem 'prototype-rails' |
@@ -37,6 +37,9 | |||
|
37 | 37 | # gem 'debugger' |
|
38 | 38 | # |
|
39 | 39 | |
|
40 | + #in-place editor | |
|
41 | + gem 'best_in_place', '~> 3.0.1' | |
|
42 | + | |
|
40 | 43 | # jquery addition |
|
41 | 44 | gem 'jquery-rails' |
|
42 | 45 | gem 'jquery-ui-sass-rails' |
@@ -46,15 +49,15 | |||
|
46 | 49 | #syntax highlighter |
|
47 | 50 | gem 'rouge' |
|
48 | 51 | |
|
49 |
- gem |
|
|
50 |
- gem |
|
|
51 |
- gem |
|
|
52 |
- gem |
|
|
53 |
- gem 'will_paginate', '~> 3.0. |
|
|
52 | + gem 'haml' | |
|
53 | + gem 'mail' | |
|
54 | + gem 'rdiscount' | |
|
55 | + gem 'test-unit' | |
|
56 | + gem 'will_paginate', '~> 3.0.7' | |
|
54 | 57 | gem 'dynamic_form' |
|
55 | 58 | gem 'in_place_editing' |
|
56 |
- gem 'verification', :git => ' |
|
|
59 | + gem 'verification', :git => 'https://github.com/sikachu/verification.git' | |
|
57 | 60 | |
|
58 | 61 | group :test, :development do |
|
59 |
- gem |
|
|
62 | + gem 'rspec-rails', '~> 2.99.0' | |
|
60 | 63 | end |
@@ -1,5 +1,5 | |||
|
1 | 1 | GIT |
|
2 |
- remote: |
|
|
2 | + remote: https://github.com/sikachu/verification.git | |
|
3 | 3 | revision: 76eaf51b13276ecae54bd9cd115832595d2ff56d |
|
4 | 4 | specs: |
|
5 | 5 | verification (1.0.3) |
@@ -9,12 +9,12 | |||
|
9 | 9 | GEM |
|
10 | 10 | remote: https://rubygems.org/ |
|
11 | 11 | specs: |
|
12 |
- actionmailer (3.2.1 |
|
|
13 |
- actionpack (= 3.2.1 |
|
|
12 | + actionmailer (3.2.21) | |
|
13 | + actionpack (= 3.2.21) | |
|
14 | 14 | mail (~> 2.5.4) |
|
15 |
- actionpack (3.2.1 |
|
|
16 |
- activemodel (= 3.2.1 |
|
|
17 |
- activesupport (= 3.2.1 |
|
|
15 | + actionpack (3.2.21) | |
|
16 | + activemodel (= 3.2.21) | |
|
17 | + activesupport (= 3.2.21) | |
|
18 | 18 | builder (~> 3.0.0) |
|
19 | 19 | erubis (~> 2.7.0) |
|
20 | 20 | journey (~> 1.0.4) |
@@ -22,21 +22,24 | |||
|
22 | 22 | rack-cache (~> 1.2) |
|
23 | 23 | rack-test (~> 0.6.1) |
|
24 | 24 | sprockets (~> 2.2.1) |
|
25 |
- activemodel (3.2.1 |
|
|
26 |
- activesupport (= 3.2.1 |
|
|
25 | + activemodel (3.2.21) | |
|
26 | + activesupport (= 3.2.21) | |
|
27 | 27 | builder (~> 3.0.0) |
|
28 |
- activerecord (3.2.1 |
|
|
29 |
- activemodel (= 3.2.1 |
|
|
30 |
- activesupport (= 3.2.1 |
|
|
28 | + activerecord (3.2.21) | |
|
29 | + activemodel (= 3.2.21) | |
|
30 | + activesupport (= 3.2.21) | |
|
31 | 31 | arel (~> 3.0.2) |
|
32 | 32 | tzinfo (~> 0.3.29) |
|
33 |
- activeresource (3.2.1 |
|
|
34 |
- activemodel (= 3.2.1 |
|
|
35 |
- activesupport (= 3.2.1 |
|
|
36 |
- activesupport (3.2.1 |
|
|
33 | + activeresource (3.2.21) | |
|
34 | + activemodel (= 3.2.21) | |
|
35 | + activesupport (= 3.2.21) | |
|
36 | + activesupport (3.2.21) | |
|
37 | 37 | i18n (~> 0.6, >= 0.6.4) |
|
38 | 38 | multi_json (~> 1.0) |
|
39 | 39 | arel (3.0.3) |
|
40 | + best_in_place (3.0.3) | |
|
41 | + actionpack (>= 3.2) | |
|
42 | + railties (>= 3.2) | |
|
40 | 43 | builder (3.0.4) |
|
41 | 44 | coffee-rails (3.2.2) |
|
42 | 45 | coffee-script (>= 2.2.0) |
@@ -44,21 +47,21 | |||
|
44 | 47 | coffee-script (2.3.0) |
|
45 | 48 | coffee-script-source |
|
46 | 49 | execjs |
|
47 |
- coffee-script-source (1. |
|
|
50 | + coffee-script-source (1.9.0) | |
|
48 | 51 | diff-lcs (1.2.5) |
|
49 | 52 | dynamic_form (1.1.4) |
|
50 | 53 | erubis (2.7.0) |
|
51 |
- execjs (2. |
|
|
52 |
- haml (4.0. |
|
|
54 | + execjs (2.3.0) | |
|
55 | + haml (4.0.6) | |
|
53 | 56 | tilt |
|
54 | 57 | hike (1.2.3) |
|
55 |
- i18n (0. |
|
|
58 | + i18n (0.7.0) | |
|
56 | 59 | in_place_editing (1.2.0) |
|
57 | 60 | journey (1.0.4) |
|
58 |
- jquery-rails (3.1. |
|
|
61 | + jquery-rails (3.1.2) | |
|
59 | 62 | railties (>= 3.0, < 5.0) |
|
60 | 63 | thor (>= 0.14, < 2.0) |
|
61 |
- jquery-tablesorter (1.1 |
|
|
64 | + jquery-tablesorter (1.13.4) | |
|
62 | 65 | railties (>= 3.1, < 5) |
|
63 | 66 | jquery-timepicker-addon-rails (1.4.1) |
|
64 | 67 | railties (>= 3.1) |
@@ -69,15 +72,15 | |||
|
69 | 72 | jquery-rails |
|
70 | 73 | jquery-ui-rails (= 4.0.3) |
|
71 | 74 | railties (>= 3.1.0) |
|
72 |
- json (1.8. |
|
|
75 | + json (1.8.2) | |
|
73 | 76 | mail (2.5.4) |
|
74 | 77 | mime-types (~> 1.16) |
|
75 | 78 | treetop (~> 1.4.8) |
|
76 | 79 | mime-types (1.25.1) |
|
77 | 80 | multi_json (1.10.1) |
|
78 |
- mysql2 (0.3.1 |
|
|
81 | + mysql2 (0.3.17) | |
|
79 | 82 | polyglot (0.3.5) |
|
80 |
- power_assert (0. |
|
|
83 | + power_assert (0.2.2) | |
|
81 | 84 | prototype-rails (3.2.1) |
|
82 | 85 | rails (~> 3.2) |
|
83 | 86 | rack (1.4.5) |
@@ -85,34 +88,34 | |||
|
85 | 88 | rack (>= 0.4) |
|
86 | 89 | rack-ssl (1.3.4) |
|
87 | 90 | rack |
|
88 |
- rack-test (0.6. |
|
|
91 | + rack-test (0.6.3) | |
|
89 | 92 | rack (>= 1.0) |
|
90 |
- rails (3.2.1 |
|
|
91 |
- actionmailer (= 3.2.1 |
|
|
92 |
- actionpack (= 3.2.1 |
|
|
93 |
- activerecord (= 3.2.1 |
|
|
94 |
- activeresource (= 3.2.1 |
|
|
95 |
- activesupport (= 3.2.1 |
|
|
93 | + rails (3.2.21) | |
|
94 | + actionmailer (= 3.2.21) | |
|
95 | + actionpack (= 3.2.21) | |
|
96 | + activerecord (= 3.2.21) | |
|
97 | + activeresource (= 3.2.21) | |
|
98 | + activesupport (= 3.2.21) | |
|
96 | 99 | bundler (~> 1.0) |
|
97 |
- railties (= 3.2.1 |
|
|
98 |
- railties (3.2.1 |
|
|
99 |
- actionpack (= 3.2.1 |
|
|
100 |
- activesupport (= 3.2.1 |
|
|
100 | + railties (= 3.2.21) | |
|
101 | + railties (3.2.21) | |
|
102 | + actionpack (= 3.2.21) | |
|
103 | + activesupport (= 3.2.21) | |
|
101 | 104 | rack-ssl (~> 1.3.2) |
|
102 | 105 | rake (>= 0.8.7) |
|
103 | 106 | rdoc (~> 3.4) |
|
104 | 107 | thor (>= 0.14.6, < 2.0) |
|
105 |
- rake (10. |
|
|
106 |
- rdiscount (2.1. |
|
|
108 | + rake (10.4.2) | |
|
109 | + rdiscount (2.1.8) | |
|
107 | 110 | rdoc (3.12.2) |
|
108 | 111 | json (~> 1.4) |
|
109 |
- rouge (1. |
|
|
110 |
- rspec-collection_matchers (1. |
|
|
112 | + rouge (1.8.0) | |
|
113 | + rspec-collection_matchers (1.1.2) | |
|
111 | 114 | rspec-expectations (>= 2.99.0.beta1) |
|
112 | 115 | rspec-core (2.99.2) |
|
113 | 116 | rspec-expectations (2.99.2) |
|
114 | 117 | diff-lcs (>= 1.1.3, < 2.0) |
|
115 |
- rspec-mocks (2.99. |
|
|
118 | + rspec-mocks (2.99.3) | |
|
116 | 119 | rspec-rails (2.99.0) |
|
117 | 120 | actionpack (>= 3.0) |
|
118 | 121 | activemodel (>= 3.0) |
@@ -122,25 +125,25 | |||
|
122 | 125 | rspec-core (~> 2.99.0) |
|
123 | 126 | rspec-expectations (~> 2.99.0) |
|
124 | 127 | rspec-mocks (~> 2.99.0) |
|
125 | - sass (3.4.1) | |
|
128 | + sass (3.4.11) | |
|
126 | 129 | sass-rails (3.2.6) |
|
127 | 130 | railties (~> 3.2.0) |
|
128 | 131 | sass (>= 3.1.10) |
|
129 | 132 | tilt (~> 1.3) |
|
130 |
- sprockets (2.2. |
|
|
133 | + sprockets (2.2.3) | |
|
131 | 134 | hike (~> 1.2) |
|
132 | 135 | multi_json (~> 1.0) |
|
133 | 136 | rack (~> 1.0) |
|
134 | 137 | tilt (~> 1.1, != 1.3.0) |
|
135 |
- test-unit (3.0. |
|
|
138 | + test-unit (3.0.9) | |
|
136 | 139 | power_assert |
|
137 | 140 | thor (0.19.1) |
|
138 | 141 | tilt (1.4.1) |
|
139 | 142 | treetop (1.4.15) |
|
140 | 143 | polyglot |
|
141 | 144 | polyglot (>= 0.3.1) |
|
142 |
- tzinfo (0.3.4 |
|
|
143 |
- uglifier (2. |
|
|
145 | + tzinfo (0.3.43) | |
|
146 | + uglifier (2.7.0) | |
|
144 | 147 | execjs (>= 0.3.0) |
|
145 | 148 | json (>= 1.8.0) |
|
146 | 149 | will_paginate (3.0.7) |
@@ -149,7 +152,8 | |||
|
149 | 152 | ruby |
|
150 | 153 | |
|
151 | 154 | DEPENDENCIES |
|
152 | - coffee-rails (~> 3.2.1) | |
|
155 | + best_in_place (~> 3.0.1) | |
|
156 | + coffee-rails (~> 3.2.2) | |
|
153 | 157 | dynamic_form |
|
154 | 158 | haml |
|
155 | 159 | in_place_editing |
@@ -160,12 +164,12 | |||
|
160 | 164 | |
|
161 | 165 | mysql2 |
|
162 | 166 | prototype-rails |
|
163 |
- rails (= 3.2.1 |
|
|
167 | + rails (= 3.2.21) | |
|
164 | 168 | rdiscount |
|
165 | 169 | rouge |
|
166 | - rspec-rails (~> 2.0) | |
|
167 |
- sass-rails (~> 3.2. |
|
|
170 | + rspec-rails (~> 2.99.0) | |
|
171 | + sass-rails (~> 3.2.6) | |
|
168 | 172 | test-unit |
|
169 |
- uglifier |
|
|
173 | + uglifier | |
|
170 | 174 | verification! |
|
171 |
- will_paginate (~> 3.0. |
|
|
175 | + will_paginate (~> 3.0.7) |
@@ -1,182 +1,10 | |||
|
1 | - == Welcome to Rails | |
|
2 | - | |
|
3 | - Rails is a web-application and persistence framework that includes everything | |
|
4 | - needed to create database-backed web-applications according to the | |
|
5 | - Model-View-Control pattern of separation. This pattern splits the view (also | |
|
6 | - called the presentation) into "dumb" templates that are primarily responsible | |
|
7 | - for inserting pre-built data in between HTML tags. The model contains the | |
|
8 | - "smart" domain objects (such as Account, Product, Person, Post) that holds all | |
|
9 | - the business logic and knows how to persist themselves to a database. The | |
|
10 | - controller handles the incoming requests (such as Save New Account, Update | |
|
11 | - Product, Show Post) by manipulating the model and directing data to the view. | |
|
12 | - | |
|
13 | - In Rails, the model is handled by what's called an object-relational mapping | |
|
14 | - layer entitled Active Record. This layer allows you to present the data from | |
|
15 | - database rows as objects and embellish these data objects with business logic | |
|
16 | - methods. You can read more about Active Record in | |
|
17 | - link:files/vendor/rails/activerecord/README.html. | |
|
18 | - | |
|
19 | - The controller and view are handled by the Action Pack, which handles both | |
|
20 | - layers by its two parts: Action View and Action Controller. These two layers | |
|
21 | - are bundled in a single package due to their heavy interdependence. This is | |
|
22 | - unlike the relationship between the Active Record and Action Pack that is much | |
|
23 | - more separate. Each of these packages can be used independently outside of | |
|
24 | - Rails. You can read more about Action Pack in | |
|
25 | - link:files/vendor/rails/actionpack/README.html. | |
|
26 | - | |
|
27 | - | |
|
28 | - == Getting started | |
|
29 | - | |
|
30 | - 1. At the command prompt, start a new rails application using the rails command | |
|
31 | - and your application name. Ex: rails myapp | |
|
32 | - (If you've downloaded rails in a complete tgz or zip, this step is already done) | |
|
33 | - 2. Change directory into myapp and start the web server: <tt>script/server</tt> (run with --help for options) | |
|
34 | - 3. Go to http://localhost:3000/ and get "Welcome aboard: You’re riding the Rails!" | |
|
35 | - 4. Follow the guidelines to start developing your application | |
|
36 | - | |
|
37 | - | |
|
38 | - == Web Servers | |
|
39 | - | |
|
40 | - By default, Rails will try to use Mongrel and lighttpd if they are installed, otherwise | |
|
41 | - Rails will use the WEBrick, the webserver that ships with Ruby. When you run script/server, | |
|
42 | - Rails will check if Mongrel exists, then lighttpd and finally fall back to WEBrick. This ensures | |
|
43 | - that you can always get up and running quickly. | |
|
1 | + == cafe grader | |
|
44 | 2 | |
|
45 | - Mongrel is a Ruby-based webserver with a C-component (which requires compilation) that is | |
|
46 | - suitable for development and deployment of Rails applications. If you have Ruby Gems installed, | |
|
47 | - getting up and running with mongrel is as easy as: <tt>gem install mongrel</tt>. | |
|
48 | - More info at: http://mongrel.rubyforge.org | |
|
49 | - | |
|
50 | - If Mongrel is not installed, Rails will look for lighttpd. It's considerably faster than | |
|
51 | - Mongrel and WEBrick and also suited for production use, but requires additional | |
|
52 | - installation and currently only works well on OS X/Unix (Windows users are encouraged | |
|
53 | - to start with Mongrel). We recommend version 1.4.11 and higher. You can download it from | |
|
54 | - http://www.lighttpd.net. | |
|
55 | - | |
|
56 | - And finally, if neither Mongrel or lighttpd are installed, Rails will use the built-in Ruby | |
|
57 | - web server, WEBrick. WEBrick is a small Ruby web server suitable for development, but not | |
|
58 | - for production. | |
|
59 | - | |
|
60 | - But of course its also possible to run Rails on any platform that supports FCGI. | |
|
61 | - Apache, LiteSpeed, IIS are just a few. For more information on FCGI, | |
|
62 | - please visit: http://wiki.rubyonrails.com/rails/pages/FastCGI | |
|
63 | - | |
|
64 | - | |
|
65 | - == Debugging Rails | |
|
66 | - | |
|
67 | - Have "tail -f" commands running on the server.log and development.log. Rails will | |
|
68 | - automatically display debugging and runtime information to these files. Debugging | |
|
69 | - info will also be shown in the browser on requests from 127.0.0.1. | |
|
70 | - | |
|
71 | - | |
|
72 | - == Breakpoints | |
|
73 | - | |
|
74 | - Breakpoint support is available through the script/breakpointer client. This | |
|
75 | - means that you can break out of execution at any point in the code, investigate | |
|
76 | - and change the model, AND then resume execution! Example: | |
|
77 | - | |
|
78 | - class WeblogController < ActionController::Base | |
|
79 | - def index | |
|
80 | - @posts = Post.find(:all) | |
|
81 | - breakpoint "Breaking out from the list" | |
|
82 | - end | |
|
83 | - end | |
|
84 | - | |
|
85 | - So the controller will accept the action, run the first line, then present you | |
|
86 | - with a IRB prompt in the breakpointer window. Here you can do things like: | |
|
87 | - | |
|
88 | - Executing breakpoint "Breaking out from the list" at .../webrick_server.rb:16 in 'breakpoint' | |
|
3 | + cafe grader is a programming contest platform used in Thailand IOI training. | |
|
4 | + The package includes 2 repositories, jittat/cafe-grader-web and jittat/cafe-grader-judge-scripts. | |
|
89 | 5 | |
|
90 | - >> @posts.inspect | |
|
91 | - => "[#<Post:0x14a6be8 @attributes={\"title\"=>nil, \"body\"=>nil, \"id\"=>\"1\"}>, | |
|
92 | - #<Post:0x14a6620 @attributes={\"title\"=>\"Rails you know!\", \"body\"=>\"Only ten..\", \"id\"=>\"2\"}>]" | |
|
93 | - >> @posts.first.title = "hello from a breakpoint" | |
|
94 | - => "hello from a breakpoint" | |
|
95 | - | |
|
96 | - ...and even better is that you can examine how your runtime objects actually work: | |
|
97 | - | |
|
98 | - >> f = @posts.first | |
|
99 | - => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}> | |
|
100 | - >> f. | |
|
101 | - Display all 152 possibilities? (y or n) | |
|
102 | - | |
|
103 | - Finally, when you're ready to resume execution, you press CTRL-D | |
|
104 | - | |
|
105 | - | |
|
106 | - == Console | |
|
107 | - | |
|
108 | - You can interact with the domain model by starting the console through <tt>script/console</tt>. | |
|
109 | - Here you'll have all parts of the application configured, just like it is when the | |
|
110 | - application is running. You can inspect domain models, change values, and save to the | |
|
111 | - database. Starting the script without arguments will launch it in the development environment. | |
|
112 | - Passing an argument will specify a different environment, like <tt>script/console production</tt>. | |
|
113 | - | |
|
114 | - To reload your controllers and models after launching the console run <tt>reload!</tt> | |
|
115 | - | |
|
116 | - To reload your controllers and models after launching the console run <tt>reload!</tt> | |
|
117 | - | |
|
118 | - | |
|
119 | - | |
|
120 | - == Description of contents | |
|
121 | - | |
|
122 | - app | |
|
123 | - Holds all the code that's specific to this particular application. | |
|
124 | - | |
|
125 | - app/controllers | |
|
126 | - Holds controllers that should be named like weblogs_controller.rb for | |
|
127 | - automated URL mapping. All controllers should descend from ApplicationController | |
|
128 | - which itself descends from ActionController::Base. | |
|
129 | - | |
|
130 | - app/models | |
|
131 | - Holds models that should be named like post.rb. | |
|
132 | - Most models will descend from ActiveRecord::Base. | |
|
6 | + === Installation | |
|
133 | 7 | |
|
134 | - app/views | |
|
135 | - Holds the template files for the view that should be named like | |
|
136 | - weblogs/index.rhtml for the WeblogsController#index action. All views use eRuby | |
|
137 | - syntax. | |
|
138 | - | |
|
139 | - app/views/layouts | |
|
140 | - Holds the template files for layouts to be used with views. This models the common | |
|
141 | - header/footer method of wrapping views. In your views, define a layout using the | |
|
142 | - <tt>layout :default</tt> and create a file named default.rhtml. Inside default.rhtml, | |
|
143 | - call <% yield %> to render the view using this layout. | |
|
144 | - | |
|
145 | - app/helpers | |
|
146 | - Holds view helpers that should be named like weblogs_helper.rb. These are generated | |
|
147 | - for you automatically when using script/generate for controllers. Helpers can be used to | |
|
148 | - wrap functionality for your views into methods. | |
|
149 | - | |
|
150 | - config | |
|
151 | - Configuration files for the Rails environment, the routing map, the database, and other dependencies. | |
|
152 | - | |
|
153 | - components | |
|
154 | - Self-contained mini-applications that can bundle together controllers, models, and views. | |
|
8 | + The system is tested on ubuntu 14.04 LTS. Use the installation script in | |
|
9 | + cafe-grader-judge-scripts/installer/install.sh . See http://theory.cpe.ku.ac.th/wiki/index.php/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%95%E0%B8%B4%E0%B8%94%E0%B8%95%E0%B8%B1%E0%B9%89%E0%B8%87_Cafe_grader for the detail. | |
|
155 | 10 | |
|
156 | - db | |
|
157 | - Contains the database schema in schema.rb. db/migrate contains all | |
|
158 | - the sequence of Migrations for your schema. | |
|
159 | - | |
|
160 | - doc | |
|
161 | - This directory is where your application documentation will be stored when generated | |
|
162 | - using <tt>rake doc:app</tt> | |
|
163 | - | |
|
164 | - lib | |
|
165 | - Application specific libraries. Basically, any kind of custom code that doesn't | |
|
166 | - belong under controllers, models, or helpers. This directory is in the load path. | |
|
167 | - | |
|
168 | - public | |
|
169 | - The directory available for the web server. Contains subdirectories for images, stylesheets, | |
|
170 | - and javascripts. Also contains the dispatchers and the default HTML files. This should be | |
|
171 | - set as the DOCUMENT_ROOT of your web server. | |
|
172 | - | |
|
173 | - script | |
|
174 | - Helper scripts for automation and generation. | |
|
175 | - | |
|
176 | - test | |
|
177 | - Unit and functional tests along with fixtures. When using the script/generate scripts, template | |
|
178 | - test files will be generated for you and placed in this directory. | |
|
179 | - | |
|
180 | - vendor | |
|
181 | - External libraries that the application depends on. Also includes the plugins subdirectory. | |
|
182 | - This directory is in the load path. |
@@ -5,3 +5,10 | |||
|
5 | 5 | //= require jquery.ui.slider |
|
6 | 6 | //= require jquery-ui-timepicker-addon |
|
7 | 7 | //= require jquery-tablesorter |
|
8 | + //= require best_in_place | |
|
9 | + //= require best_in_place.jquery-ui | |
|
10 | + | |
|
11 | + $(document).ready(function() { | |
|
12 | + /* Activating Best In Place */ | |
|
13 | + jQuery(".best_in_place").best_in_place(); | |
|
14 | + }); |
@@ -3,9 +3,6 | |||
|
3 | 3 | before_filter :authenticate |
|
4 | 4 | before_filter { |controller| controller.authorization_by_roles(['admin'])} |
|
5 | 5 | |
|
6 | - in_place_edit_for :grader_configuration, :key | |
|
7 | - in_place_edit_for :grader_configuration, :type | |
|
8 | - in_place_edit_for :grader_configuration, :value | |
|
9 | 6 | |
|
10 | 7 | def index |
|
11 | 8 | @configurations = GraderConfiguration.find(:all, |
@@ -17,4 +14,15 | |||
|
17 | 14 | redirect_to :action => 'index' |
|
18 | 15 | end |
|
19 | 16 | |
|
17 | + def update | |
|
18 | + @config = GraderConfiguration.find(params[:id]) | |
|
19 | + respond_to do |format| | |
|
20 | + if @config.update_attributes(params[:grader_configuration]) | |
|
21 | + format.json { head :ok } | |
|
22 | + else | |
|
23 | + format.json { respond_with_bip(@config) } | |
|
24 | + end | |
|
25 | + end | |
|
26 | + end | |
|
27 | + | |
|
20 | 28 | end |
@@ -37,7 +37,7 | |||
|
37 | 37 | end |
|
38 | 38 | |
|
39 | 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 | 41 | config = GraderConfiguration.find_by_key('system.mode') |
|
42 | 42 | config.value = params[:id] |
|
43 | 43 | config.save |
@@ -71,7 +71,7 | |||
|
71 | 71 | @submission.ip_address = request.remote_ip |
|
72 | 72 | |
|
73 | 73 | if GraderConfiguration.time_limit_mode? and user.contest_finished? |
|
74 |
- @submission.errors.add |
|
|
74 | + @submission.errors.add(:base,"The contest is over.") | |
|
75 | 75 | prepare_list_information |
|
76 | 76 | render :action => 'list' and return |
|
77 | 77 | end |
@@ -194,7 +194,7 | |||
|
194 | 194 | |
|
195 | 195 | def confirm_contest_start |
|
196 | 196 | user = User.find(session[:user_id]) |
|
197 |
- if request.method == |
|
|
197 | + if request.method == 'POST' | |
|
198 | 198 | user.update_start_time |
|
199 | 199 | redirect_to :action => 'list' |
|
200 | 200 | else |
@@ -31,20 +31,21 | |||
|
31 | 31 | user = User.find(session[:user_id]) |
|
32 | 32 | @message = Message.new(params[:message]) |
|
33 | 33 | @message.sender = user |
|
34 | - if !@message.save | |
|
35 | - render :action => 'list' and return | |
|
34 | + if @message.body == '' or !@message.save | |
|
35 | + flash[:notice] = 'An error occurred' | |
|
36 | 36 | else |
|
37 | 37 | flash[:notice] = 'New message posted' |
|
38 | - redirect_to :action => 'list' | |
|
39 | 38 | end |
|
39 | + redirect_to :action => 'list' | |
|
40 | 40 | end |
|
41 | 41 | |
|
42 | 42 | def reply |
|
43 | 43 | user = User.find(session[:user_id]) |
|
44 | 44 | @message = Message.new(params[:r_message]) |
|
45 | 45 | @message.sender = user |
|
46 | - if !@message.save | |
|
47 | - render :action => 'show' and return | |
|
46 | + if @message.body == '' or !@message.save | |
|
47 | + flash[:notice] = 'An error occurred' | |
|
48 | + redirect_to :action => 'show', :id => @message.replying_message_id | |
|
48 | 49 | else |
|
49 | 50 | flash[:notice] = 'Message replied' |
|
50 | 51 | rep_msg = @message.replying_message |
@@ -58,7 +59,7 | |||
|
58 | 59 | message = Message.find(params[:id]) |
|
59 | 60 | message.replied = true |
|
60 | 61 | message.save |
|
61 |
- flash[:notice] = 'Message hid |
|
|
62 | + flash[:notice] = 'Message hidden (just marked replied)' | |
|
62 | 63 | redirect_to :action => 'console' |
|
63 | 64 | end |
|
64 | 65 |
@@ -1,6 +1,6 | |||
|
1 | 1 | class ReportController < ApplicationController |
|
2 | 2 | |
|
3 | - before_filter :admin_authorization, only: [:login_stat,:submission_stat] | |
|
3 | + before_filter :admin_authorization, only: [:login_stat,:submission_stat, :stuck] | |
|
4 | 4 | before_filter(only: [:problem_hof]) { |c| |
|
5 | 5 | return false unless authenticate |
|
6 | 6 | |
@@ -118,6 +118,7 | |||
|
118 | 118 | d = (DateTime.now.in_time_zone - sub.submitted_at) / 24 / 60 / 60 |
|
119 | 119 | @histogram[:data][d.to_i] += 1 if d < range |
|
120 | 120 | |
|
121 | + next unless sub.points | |
|
121 | 122 | @summary[:count] += 1 |
|
122 | 123 | user[sub.user_id] = [user[sub.user_id], (sub.points >= @problem.full_score) ? 1 : 0].max |
|
123 | 124 | |
@@ -196,7 +197,7 | |||
|
196 | 197 | @struggle = Array.new |
|
197 | 198 | record = {} |
|
198 | 199 | Submission.includes(:problem,:user).order(:problem_id,:user_id).find_each do |sub| |
|
199 |
- next unless sub. |
|
|
200 | + next unless sub.problem and sub.user | |
|
200 | 201 | if user != sub.user_id or problem != sub.problem_id |
|
201 | 202 | @struggle << { user: record[:user], problem: record[:problem], tries: tries } unless solve |
|
202 | 203 | record = {user: sub.user, problem: sub.problem} |
@@ -26,7 +26,7 | |||
|
26 | 26 | |
|
27 | 27 | if GraderConfiguration.time_limit_mode? |
|
28 | 28 | if @user.contest_finished? |
|
29 |
- @submitted_test_request.errors.add |
|
|
29 | + @submitted_test_request.errors.add(:base,'Contest is over.') | |
|
30 | 30 | prepare_index_information |
|
31 | 31 | render :action => 'index' and return |
|
32 | 32 | end |
@@ -2,7 +2,6 | |||
|
2 | 2 | |
|
3 | 3 | class UserAdminController < ApplicationController |
|
4 | 4 | |
|
5 | - | |
|
6 | 5 | include MailHelperMethods |
|
7 | 6 | |
|
8 | 7 | before_filter :admin_authorization |
@@ -85,7 +84,8 | |||
|
85 | 84 | end |
|
86 | 85 | |
|
87 | 86 | user = User.find_by_login(login) |
|
88 | - if user | |
|
87 | + if (user) | |
|
88 | + user.full_name = full_name | |
|
89 | 89 | user.password = password |
|
90 | 90 | else |
|
91 | 91 | user = User.new({:login => login, |
@@ -150,7 +150,6 | |||
|
150 | 150 | end |
|
151 | 151 | @scorearray << ustat |
|
152 | 152 | end |
|
153 | - | |
|
154 | 153 | if params[:commit] == 'download csv' then |
|
155 | 154 | csv = gen_csv_from_scorearray(@scorearray,@problems) |
|
156 | 155 | send_data csv, filename: 'last_score.csv' |
@@ -63,7 +63,7 | |||
|
63 | 63 | render :action => 'email_error', :layout => 'empty' |
|
64 | 64 | end |
|
65 | 65 | else |
|
66 |
- @user.errors.add |
|
|
66 | + @user.errors.add(:base,"Email cannot be blank") if @user.email=='' | |
|
67 | 67 | render :action => 'new', :layout => 'empty' |
|
68 | 68 | end |
|
69 | 69 | end |
@@ -154,7 +154,7 | |||
|
154 | 154 | :login => user.login, |
|
155 | 155 | :password => user.password, |
|
156 | 156 | :activation_url => activation_url, |
|
157 | - :admin_email => admin_email | |
|
157 | + :admin_email => GraderConfiguration['system.admin_email'] | |
|
158 | 158 | }) |
|
159 | 159 | |
|
160 | 160 | logger.info mail_body |
@@ -170,7 +170,7 | |||
|
170 | 170 | :contest_name => contest_name, |
|
171 | 171 | :login => user.login, |
|
172 | 172 | :password => user.password, |
|
173 | - :admin_email => admin_email | |
|
173 | + :admin_email => GraderConfiguration['system.admin_email'] | |
|
174 | 174 | }) |
|
175 | 175 | |
|
176 | 176 | logger.info mail_body |
@@ -118,7 +118,7 | |||
|
118 | 118 | <tr> |
|
119 | 119 | <td class="left-col"> |
|
120 | 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 | 122 | #{time_left} |
|
123 | 123 | <br/> |
|
124 | 124 | </td> |
@@ -45,7 +45,7 | |||
|
45 | 45 | import_params[:memory_limit], |
|
46 | 46 | import_params[:checker_name], |
|
47 | 47 | import_to_db) |
|
48 |
- problem.errors.add |
|
|
48 | + problem.errors.add(:base,'Import error.') | |
|
49 | 49 | end |
|
50 | 50 | |
|
51 | 51 | return problem, importer.log_msg |
@@ -85,17 +85,17 | |||
|
85 | 85 | DEFAULT_MEMORY_LIMIT) |
|
86 | 86 | |
|
87 | 87 | if time_limit<=0 or time_limit >60 |
|
88 |
- problem.errors.add |
|
|
88 | + problem.errors.add(:base,'Time limit out of range.') | |
|
89 | 89 | end |
|
90 | 90 | |
|
91 | 91 | if memory_limit==0 and params[:memory_limit]!='0' |
|
92 |
- problem.errors.add |
|
|
92 | + problem.errors.add(:base,'Memory limit format errors.') | |
|
93 | 93 | elsif memory_limit<=0 or memory_limit >512 |
|
94 |
- problem.errors.add |
|
|
94 | + problem.errors.add(:base,'Memory limit out of range.') | |
|
95 | 95 | end |
|
96 | 96 | |
|
97 | 97 | if params[:file]==nil or params[:file]=='' |
|
98 |
- problem.errors.add |
|
|
98 | + problem.errors.add(:base,'No testdata file.') | |
|
99 | 99 | end |
|
100 | 100 | |
|
101 | 101 | checker_name = 'text' |
@@ -70,12 +70,12 | |||
|
70 | 70 | |
|
71 | 71 | # checks if the user submits any input file |
|
72 | 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 | 74 | test_request.input_file_name = nil |
|
75 | 75 | else |
|
76 | 76 | test_request.input_file_name = save_input_file(params[:input_file], user, problem) |
|
77 | 77 | if test_request.input_file_name == nil |
|
78 |
- test_request.errors.add |
|
|
78 | + test_request.errors.adds(:base,"No input submitted.") | |
|
79 | 79 | end |
|
80 | 80 | if params[:additional_file]!=nil and params[:additional_file]!="" |
|
81 | 81 | save_additional_file(params[:additional_file], |
@@ -67,11 +67,11 | |||
|
67 | 67 | user = find_by_login(login) |
|
68 | 68 | if user |
|
69 | 69 | return user if user.authenticated?(password) |
|
70 |
- |
|
|
71 |
- |
|
|
72 |
- |
|
|
73 |
- |
|
|
74 |
- |
|
|
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 | 75 | end |
|
76 | 76 | end |
|
77 | 77 | |
@@ -351,7 +351,7 | |||
|
351 | 351 | def uniqueness_of_email_from_activated_users |
|
352 | 352 | user = User.activated_users.find_by_email(self.email) |
|
353 | 353 | if user and (user.login != self.login) |
|
354 |
- self.errors.add |
|
|
354 | + self.errors.add(:base,"Email has already been taken") | |
|
355 | 355 | end |
|
356 | 356 | end |
|
357 | 357 | |
@@ -362,7 +362,7 | |||
|
362 | 362 | :order => 'created_at DESC') |
|
363 | 363 | if open_user and open_user.created_at and |
|
364 | 364 | (open_user.created_at > Time.now.gmtime - 5.minutes) |
|
365 |
- self.errors.add |
|
|
365 | + self.errors.add(:base,"There are already unactivated registrations with this e-mail address (please wait for 5 minutes)") | |
|
366 | 366 | end |
|
367 | 367 | end |
|
368 | 368 |
@@ -1,3 +1,6 | |||
|
1 | + - content_for :header do | |
|
2 | + = javascript_include_tag 'local_jquery' | |
|
3 | + | |
|
1 | 4 | %h1 System configuration |
|
2 | 5 | |
|
3 | 6 | %table.info |
@@ -14,7 +17,7 | |||
|
14 | 17 | %td |
|
15 | 18 | = in_place_editor_field :grader_configuration, :value_type, {}, :rows=>1 |
|
16 | 19 | %td |
|
17 |
- = in_place |
|
|
20 | + = best_in_place @grader_configuration, :value, ok_button: "ok", cancel_button: "cancel" | |
|
18 | 21 | %td= conf.description |
|
19 | 22 | |
|
20 | 23 | - if GraderConfiguration.config_cached? |
@@ -11,18 +11,21 | |||
|
11 | 11 | |
|
12 | 12 | .infobox |
|
13 | 13 | %b Web interface mode: |
|
14 | - - if (not GraderConfiguration.contest_mode?) and (not GraderConfiguration.indv_contest_mode?) | |
|
15 | - standard mode | |
|
14 | + - if GraderConfiguration.analysis_mode? | |
|
15 | + Analysis Mode | |
|
16 | + - elsif (not GraderConfiguration.contest_mode?) and (not GraderConfiguration.indv_contest_mode?) | |
|
17 | + Standard Mode | |
|
16 | 18 | - elsif GraderConfiguration.contest_mode? |
|
17 |
- |
|
|
19 | + Normal Contest Mode | |
|
18 | 20 | - else |
|
19 |
- |
|
|
21 | + Individual Contest Mode | |
|
20 | 22 | |
|
21 | 23 | %br/ |
|
22 | 24 | Change mode to: |
|
23 |
- =raw "[#{link_to ' |
|
|
24 |
- =raw "[#{link_to ' |
|
|
25 |
- =raw "[#{link_to ' |
|
|
25 | + =raw "[#{link_to 'Standard', :action => 'change_contest_mode', :id => 'standard'}]" | |
|
26 | + =raw "[#{link_to 'Contest', :action => 'change_contest_mode', :id => 'contest'}]" | |
|
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 | 30 | - if GraderConfiguration.indv_contest_mode? |
|
28 | 31 | = render :partial => 'indv_contest_mode_index' |
@@ -1,5 +1,6 | |||
|
1 | 1 | - content_for :head do |
|
2 | 2 | = stylesheet_link_tag 'graders' |
|
3 | + = javascript_include_tag 'local_jquery' | |
|
3 | 4 | <meta http-equiv ="refresh" content="60"/> |
|
4 | 5 | |
|
5 | 6 | %h1 Grader information |
@@ -66,7 +67,7 | |||
|
66 | 67 | %td= sub.try(:user).try(:full_name) |
|
67 | 68 | %td= sub.try(:problem).try(:full_name) |
|
68 | 69 | %td= "#{time_ago_in_words(sub.submitted_at)} ago" |
|
69 |
- %td= |
|
|
70 | + %td= sub.graded_at ? "#{time_ago_in_words(sub.graded_at)} ago" : " " | |
|
70 | 71 | %td= sub.grader_comment |
|
71 | 72 | |
|
72 | 73 |
@@ -25,7 +25,7 | |||
|
25 | 25 | - if @test_request.compiler_message!=nil and @test_request.compiler_message!='' |
|
26 | 26 | %b Compiler Message |
|
27 | 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 | 30 | %b Input (first 2kb) |
|
31 | 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 | 3 | No message |
|
4 | 4 | <% else %> |
|
5 | 5 | <div><div><a href="#" onClick="n = this.parentNode.parentNode.lastChild; |
@@ -4,8 +4,12 | |||
|
4 | 4 | = submission_counter+1 |
|
5 | 5 | %td.info{:align => "center"} |
|
6 | 6 | = link_to "##{submission.id}", controller: :graders, action: :submission, id: submission.id |
|
7 | - %td.info= format_short_time(submission.submitted_at) | |
|
7 | + %td.info | |
|
8 | + = l submission.submitted_at, format: :long | |
|
9 | + = "( #{time_ago_in_words(submission.submitted_at)} ago)" | |
|
8 | 10 | %td.info{:align => "center"} |
|
11 | + = submission.source_filename | |
|
12 | + = " (#{submission.language.pretty_name}) " | |
|
9 | 13 | = link_to('[load]',{:action => 'source', :id => submission.id}) |
|
10 | 14 | %td.info |
|
11 | 15 | - if submission.graded_at!=nil |
@@ -1,6 +1,6 | |||
|
1 | 1 | %h2= "Compiler message for submission \##{@submission.number}, task: #{@submission.problem.name}" |
|
2 | 2 | %p |
|
3 | - - if @submission.compiler_message.chomp == '' | |
|
4 |
- |
|
|
3 | + - if @submission.compiler_message == nil or @submission.compiler_message.chomp == '' | |
|
4 | + No message | |
|
5 | 5 | - else |
|
6 | 6 | = simple_format(@submission.compiler_message) |
@@ -12,5 +12,5 | |||
|
12 | 12 | |
|
13 | 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 | 16 | = submit_tag t('main.confirm_contest_start.start_button'), :confirm => t('main.confirm_contest_start.start_button_confirm') |
@@ -7,8 +7,7 | |||
|
7 | 7 | %b Problem: |
|
8 | 8 | = "#{@problem.full_name} (#{@problem.name})" |
|
9 | 9 | %br/ |
|
10 |
- Note that the full score has be |
|
|
11 | - You should change it to the correct full score. | |
|
10 | + = "Note that the full score has been set to #{@problem.full_score}." | |
|
12 | 11 | |
|
13 | 12 | %p |
|
14 | 13 | = link_to '[Back to problem list]', :action => 'list' |
@@ -9,7 +9,6 | |||
|
9 | 9 | $("#mem_remark_box").hide(); |
|
10 | 10 | }); |
|
11 | 11 | }); |
|
12 | - alert("hahaha"); | |
|
13 | 12 | :css |
|
14 | 13 | .hof_user { color: orangered; font-style: italic; } |
|
15 | 14 | .hof_language { color: green; font-style: italic; } |
@@ -14,9 +14,12 | |||
|
14 | 14 | <%= password_field 'user', 'password_confirmation' %></p> |
|
15 | 15 | |
|
16 | 16 | <p><label for="user_email">E-mail</label><br/> |
|
17 |
- <%= |
|
|
17 | + <%= email_field 'user', 'email' %></p> | |
|
18 | 18 | |
|
19 | 19 | <p><label for="user_alias">Alias</label><br/> |
|
20 | 20 | <%= text_field 'user', 'alias' %></p> |
|
21 | + | |
|
22 | + <p><label for="user_remark">Remark</label><br/> | |
|
23 | + <%= text_field 'user', 'remark' %></p> | |
|
21 | 24 | <!--[eoform:user]--> |
|
22 | 25 |
@@ -16,7 +16,7 | |||
|
16 | 16 | <td><%= text_field 'user', 'full_name', :size => 30 %></td> |
|
17 | 17 | <td><%= password_field 'user', 'password', :size => 10 %></td> |
|
18 | 18 | <td><%= password_field 'user', 'password_confirmation', :size => 10 %></td> |
|
19 |
- <td><%= |
|
|
19 | + <td><%= email_field 'user', 'email', :size => 15 %></td> | |
|
20 | 20 | <td><%= submit_tag "Create" %></td> |
|
21 | 21 | </tr> |
|
22 | 22 | </table> |
@@ -34,7 +34,7 | |||
|
34 | 34 | %th Activated? |
|
35 | 35 | %th Logged in |
|
36 | 36 | %th Contest(s) |
|
37 |
- %th |
|
|
37 | + %th Remark | |
|
38 | 38 | - @problems.each do |p| |
|
39 | 39 | %th= p.name |
|
40 | 40 | %th Total |
@@ -50,7 +50,7 | |||
|
50 | 50 | %td= sc[i].activated |
|
51 | 51 | %td= sc[i].try(:contest_stat).try(:started_at)!=nil ? 'yes' : 'no' |
|
52 | 52 | %td= sc[i].contests.collect {|c| c.name}.join(', ') |
|
53 |
- %td= sc[i]. |
|
|
53 | + %td= sc[i].remark | |
|
54 | 54 | - else |
|
55 | 55 | %td= sc[i][0] |
|
56 | 56 | - total += sc[i][0] |
@@ -11,7 +11,8 | |||
|
11 | 11 | |
|
12 | 12 | = form_tag :action => 'retrieve_password' do |
|
13 | 13 | =t 'registration.password_retrieval.instructions' |
|
14 | - = text_field 'email', nil, :size => 20 | |
|
14 | + %br/ | |
|
15 | + = email_field 'email', nil, :size => 20 | |
|
15 | 16 | %br/ |
|
16 | 17 | = submit_tag(t 'registration.password_retrieval.button_label') |
|
17 | 18 |
@@ -25,12 +25,12 | |||
|
25 | 25 | %tr |
|
26 | 26 | %td{:align => "right"} |
|
27 | 27 | = "#{t 'email_label'}:" |
|
28 |
- %td= f. |
|
|
28 | + %td= f.email_field :email | |
|
29 | 29 | %tr |
|
30 | 30 | %td |
|
31 | 31 | %td |
|
32 | 32 | %small |
|
33 |
- =t |
|
|
33 | + =t('registration.email_guide').html_safe | |
|
34 | 34 | %tr |
|
35 | 35 | %td/ |
|
36 | 36 | %td |
@@ -34,4 +34,7 | |||
|
34 | 34 | |
|
35 | 35 | # Expands the lines which load the assets |
|
36 | 36 | config.assets.debug = true |
|
37 | + | |
|
38 | + # Prevents assets from rendering twice | |
|
39 | + config.serve_static_assets = false | |
|
37 | 40 | end |
@@ -9,8 +9,8 | |||
|
9 | 9 | email_label: 'E-mail' |
|
10 | 10 | password_label: 'Password' |
|
11 | 11 | |
|
12 | - go_ahead_to: "Go ahead to" | |
|
13 | - go_back_to: "Go back to" | |
|
12 | + go_ahead_to: "Go ahead to " | |
|
13 | + go_back_to: "Go back to " | |
|
14 | 14 | login_page: "login page" |
|
15 | 15 | home_page: "home page" |
|
16 | 16 |
@@ -6,6 +6,8 | |||
|
6 | 6 | resources :announcements |
|
7 | 7 | resources :sites |
|
8 | 8 | |
|
9 | + resources :grader_configuration, controller: 'configurations' | |
|
10 | + | |
|
9 | 11 | # The priority is based upon order of creation: |
|
10 | 12 | # first created -> highest priority. |
|
11 | 13 |
@@ -11,7 +11,7 | |||
|
11 | 11 | # |
|
12 | 12 | # It's strongly recommended to check this file into your version control system. |
|
13 | 13 | |
|
14 |
- ActiveRecord::Schema.define(:version => 201 |
|
|
14 | + ActiveRecord::Schema.define(:version => 20150203153534) do | |
|
15 | 15 | |
|
16 | 16 | create_table "announcements", :force => true do |t| |
|
17 | 17 | t.string "author" |
@@ -239,7 +239,8 | |||
|
239 | 239 | t.boolean "activated", :default => false |
|
240 | 240 | t.datetime "created_at" |
|
241 | 241 | t.datetime "updated_at" |
|
242 | - t.string "section" | |
|
242 | + t.boolean "enabled", :default => true | |
|
243 | + t.string "remark" | |
|
243 | 244 | end |
|
244 | 245 | |
|
245 | 246 | add_index "users", ["login"], :name => "index_users_on_login", :unique => true |
@@ -100,7 +100,7 | |||
|
100 | 100 | :value_type => 'boolean', |
|
101 | 101 | :default_value => 'true', |
|
102 | 102 | :description => 'If this option is true, users can change their settings' |
|
103 | - } | |
|
103 | + }, | |
|
104 | 104 | |
|
105 | 105 | # If Configuration['contest.test_request.early_timeout'] is true |
|
106 | 106 | # the user will not be able to use test request at 30 minutes |
@@ -22,7 +22,18 | |||
|
22 | 22 | body mail_body |
|
23 | 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 | 37 | mail.deliver |
|
27 | 38 | end |
|
28 | 39 |
deleted file |
You need to be logged in to leave comments.
Login now