Description:
added contest.name to settings git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@280 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r141:20e2332de433 - - 142 files changed: 49 inserted, 5966 deleted

@@ -0,0 +1,14
1 + class AddContestNameToConfiguration < ActiveRecord::Migration
2 + def self.up
3 + # Configuration['contest.name']:
4 + # it will be shown on the user header bar
5 +
6 + Configuration.create(:key => 'contest.name',
7 + :value_type => 'string',
8 + :value => 'Grader')
9 + end
10 +
11 + def self.down
12 + Configuration.find_by_key('contest.name').destroy
13 + end
14 + end
@@ -81,33 +81,35
81 end
81 end
82
82
83 #
83 #
84 # if the contest is in the anaysis mode
84 # if the contest is in the anaysis mode
85 if Configuration[SYSTEM_MODE_CONF_KEY]=='analysis'
85 if Configuration[SYSTEM_MODE_CONF_KEY]=='analysis'
86 header = <<ANALYSISMODE
86 header = <<ANALYSISMODE
87 <tr><td colspan="2" align="center">
87 <tr><td colspan="2" align="center">
88 <span class="contest-over-msg">ANALYSIS MODE</span>
88 <span class="contest-over-msg">ANALYSIS MODE</span>
89 </td></tr>
89 </td></tr>
90 ANALYSISMODE
90 ANALYSISMODE
91 end
91 end
92
92
93 + contest_name = Configuration['contest.name']
94 +
93 #
95 #
94 # build real title bar
96 # build real title bar
95 <<TITLEBAR
97 <<TITLEBAR
96 <div class="title">
98 <div class="title">
97 <table>
99 <table>
98 #{header}
100 #{header}
99 <tr>
101 <tr>
100 <td class="left-col">
102 <td class="left-col">
101 #{user.full_name}<br/>
103 #{user.full_name}<br/>
102 Current time is #{format_short_time(Time.new.gmtime)} UTC
104 Current time is #{format_short_time(Time.new.gmtime)} UTC
103 #{time_left}
105 #{time_left}
104 <br/>
106 <br/>
105 </td>
107 </td>
106 - <td class="right-col">APIO'08</td>
108 + <td class="right-col">#{contest_name}</td>
107 </tr>
109 </tr>
108 </table>
110 </table>
109 </div>
111 </div>
110 TITLEBAR
112 TITLEBAR
111 end
113 end
112
114
113 end
115 end
@@ -1,20 +1,20
1 # Be sure to restart your web server when you modify this file.
1 # Be sure to restart your web server when you modify this file.
2
2
3 # Uncomment below to force Rails into production mode when
3 # Uncomment below to force Rails into production mode when
4 # you don't control web/app server and can't set it the proper way
4 # you don't control web/app server and can't set it the proper way
5 # ENV['RAILS_ENV'] ||= 'production'
5 # ENV['RAILS_ENV'] ||= 'production'
6
6
7 # Specifies gem version of Rails to use when vendor/rails is not present
7 # Specifies gem version of Rails to use when vendor/rails is not present
8 - RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION
8 + RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION
9
9
10 # Bootstrap the Rails environment, frameworks, and default configuration
10 # Bootstrap the Rails environment, frameworks, and default configuration
11 require File.join(File.dirname(__FILE__), 'boot')
11 require File.join(File.dirname(__FILE__), 'boot')
12
12
13 Rails::Initializer.run do |config|
13 Rails::Initializer.run do |config|
14 # Settings in config/environments/* take precedence over those specified here
14 # Settings in config/environments/* take precedence over those specified here
15
15
16 # Skip frameworks you're not going to use (only works if using vendor/rails)
16 # Skip frameworks you're not going to use (only works if using vendor/rails)
17 # config.frameworks -= [ :action_web_service, :action_mailer ]
17 # config.frameworks -= [ :action_web_service, :action_mailer ]
18
18
19 # Only load the plugins named here, by default all plugins in vendor/plugins are loaded
19 # Only load the plugins named here, by default all plugins in vendor/plugins are loaded
20 # config.plugins = %W( exception_notification ssl_requirement )
20 # config.plugins = %W( exception_notification ssl_requirement )
@@ -33,24 +33,27
33 # Use SQL instead of Active Record's schema dumper when creating the test database.
33 # Use SQL instead of Active Record's schema dumper when creating the test database.
34 # This is necessary if your schema can't be completely dumped by the schema dumper,
34 # This is necessary if your schema can't be completely dumped by the schema dumper,
35 # like if you have constraints or database-specific column types
35 # like if you have constraints or database-specific column types
36 # config.active_record.schema_format = :sql
36 # config.active_record.schema_format = :sql
37
37
38 # Activate observers that should always be running
38 # Activate observers that should always be running
39 # config.active_record.observers = :cacher, :garbage_collector
39 # config.active_record.observers = :cacher, :garbage_collector
40
40
41 # Make Active Record use UTC-base instead of local time
41 # Make Active Record use UTC-base instead of local time
42 config.active_record.default_timezone = :utc
42 config.active_record.default_timezone = :utc
43
43
44 # See Rails::Configuration for more options
44 # See Rails::Configuration for more options
45 +
46 + # This is for rspec
47 + config.gem "rspec-rails", :lib => "spec"
45 end
48 end
46
49
47 # Add new inflection rules using the following format
50 # Add new inflection rules using the following format
48 # (all these examples are active by default):
51 # (all these examples are active by default):
49 # Inflector.inflections do |inflect|
52 # Inflector.inflections do |inflect|
50 # inflect.plural /^(ox)$/i, '\1en'
53 # inflect.plural /^(ox)$/i, '\1en'
51 # inflect.singular /^(ox)en/i, '\1'
54 # inflect.singular /^(ox)en/i, '\1'
52 # inflect.irregular 'person', 'people'
55 # inflect.irregular 'person', 'people'
53 # inflect.uncountable %w( fish sheep )
56 # inflect.uncountable %w( fish sheep )
54 # end
57 # end
55
58
56 # Add new mime types for use in respond_to blocks:
59 # Add new mime types for use in respond_to blocks:
@@ -1,24 +1,24
1 # This file is auto-generated from the current state of the database. Instead of editing this file,
1 # This file is auto-generated from the current state of the database. Instead of editing this file,
2 - # please use the migrations feature of ActiveRecord to incrementally modify your database, and
2 + # please use the migrations feature of Active Record to incrementally modify your database, and
3 # then regenerate this schema definition.
3 # then regenerate this schema definition.
4 #
4 #
5 # Note that this schema.rb definition is the authoritative source for your database schema. If you need
5 # Note that this schema.rb definition is the authoritative source for your database schema. If you need
6 # to create the application database on another system, you should be using db:schema:load, not running
6 # to create the application database on another system, you should be using db:schema:load, not running
7 # all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
7 # all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
8 # you'll amass, the slower it'll run and the greater likelihood for issues).
8 # you'll amass, the slower it'll run and the greater likelihood for issues).
9 #
9 #
10 # It's strongly recommended to check this file into your version control system.
10 # It's strongly recommended to check this file into your version control system.
11
11
12 - ActiveRecord::Schema.define(:version => 36) do
12 + ActiveRecord::Schema.define(:version => 20081012050458) do
13
13
14 create_table "announcements", :force => true do |t|
14 create_table "announcements", :force => true do |t|
15 t.string "author"
15 t.string "author"
16 t.text "body"
16 t.text "body"
17 t.boolean "published"
17 t.boolean "published"
18 t.datetime "created_at"
18 t.datetime "created_at"
19 t.datetime "updated_at"
19 t.datetime "updated_at"
20 end
20 end
21
21
22 create_table "configurations", :force => true do |t|
22 create_table "configurations", :force => true do |t|
23 t.string "key"
23 t.string "key"
24 t.string "value_type"
24 t.string "value_type"
@@ -33,156 +33,156
33 t.datetime "updated_at"
33 t.datetime "updated_at"
34 end
34 end
35
35
36 create_table "descriptions", :force => true do |t|
36 create_table "descriptions", :force => true do |t|
37 t.text "body"
37 t.text "body"
38 t.boolean "markdowned"
38 t.boolean "markdowned"
39 t.datetime "created_at"
39 t.datetime "created_at"
40 t.datetime "updated_at"
40 t.datetime "updated_at"
41 end
41 end
42
42
43 create_table "grader_processes", :force => true do |t|
43 create_table "grader_processes", :force => true do |t|
44 t.string "host", :limit => 20
44 t.string "host", :limit => 20
45 - t.integer "pid"
45 + t.integer "pid", :limit => 11
46 t.string "mode"
46 t.string "mode"
47 t.boolean "active"
47 t.boolean "active"
48 t.datetime "created_at"
48 t.datetime "created_at"
49 t.datetime "updated_at"
49 t.datetime "updated_at"
50 - t.integer "task_id"
50 + t.integer "task_id", :limit => 11
51 t.string "task_type"
51 t.string "task_type"
52 end
52 end
53
53
54 add_index "grader_processes", ["host", "pid"], :name => "index_grader_processes_on_ip_and_pid"
54 add_index "grader_processes", ["host", "pid"], :name => "index_grader_processes_on_ip_and_pid"
55
55
56 create_table "languages", :force => true do |t|
56 create_table "languages", :force => true do |t|
57 t.string "name", :limit => 10
57 t.string "name", :limit => 10
58 t.string "pretty_name"
58 t.string "pretty_name"
59 t.string "ext", :limit => 10
59 t.string "ext", :limit => 10
60 end
60 end
61
61
62 create_table "messages", :force => true do |t|
62 create_table "messages", :force => true do |t|
63 - t.integer "sender_id"
63 + t.integer "sender_id", :limit => 11
64 - t.integer "receiver_id"
64 + t.integer "receiver_id", :limit => 11
65 - t.integer "replying_message_id"
65 + t.integer "replying_message_id", :limit => 11
66 t.text "body"
66 t.text "body"
67 t.boolean "replied"
67 t.boolean "replied"
68 t.datetime "created_at"
68 t.datetime "created_at"
69 t.datetime "updated_at"
69 t.datetime "updated_at"
70 end
70 end
71
71
72 create_table "problems", :force => true do |t|
72 create_table "problems", :force => true do |t|
73 t.string "name", :limit => 30
73 t.string "name", :limit => 30
74 t.string "full_name"
74 t.string "full_name"
75 - t.integer "full_score"
75 + t.integer "full_score", :limit => 11
76 t.date "date_added"
76 t.date "date_added"
77 t.boolean "available"
77 t.boolean "available"
78 t.string "url"
78 t.string "url"
79 - t.integer "description_id"
79 + t.integer "description_id", :limit => 11
80 t.boolean "test_allowed"
80 t.boolean "test_allowed"
81 t.boolean "output_only"
81 t.boolean "output_only"
82 end
82 end
83
83
84 create_table "rights", :force => true do |t|
84 create_table "rights", :force => true do |t|
85 t.string "name"
85 t.string "name"
86 t.string "controller"
86 t.string "controller"
87 t.string "action"
87 t.string "action"
88 end
88 end
89
89
90 create_table "rights_roles", :id => false, :force => true do |t|
90 create_table "rights_roles", :id => false, :force => true do |t|
91 - t.integer "right_id"
91 + t.integer "right_id", :limit => 11
92 - t.integer "role_id"
92 + t.integer "role_id", :limit => 11
93 end
93 end
94
94
95 add_index "rights_roles", ["role_id"], :name => "index_rights_roles_on_role_id"
95 add_index "rights_roles", ["role_id"], :name => "index_rights_roles_on_role_id"
96
96
97 create_table "roles", :force => true do |t|
97 create_table "roles", :force => true do |t|
98 t.string "name"
98 t.string "name"
99 end
99 end
100
100
101 create_table "roles_users", :id => false, :force => true do |t|
101 create_table "roles_users", :id => false, :force => true do |t|
102 - t.integer "role_id"
102 + t.integer "role_id", :limit => 11
103 - t.integer "user_id"
103 + t.integer "user_id", :limit => 11
104 end
104 end
105
105
106 add_index "roles_users", ["user_id"], :name => "index_roles_users_on_user_id"
106 add_index "roles_users", ["user_id"], :name => "index_roles_users_on_user_id"
107
107
108 create_table "sessions", :force => true do |t|
108 create_table "sessions", :force => true do |t|
109 t.string "session_id"
109 t.string "session_id"
110 t.text "data"
110 t.text "data"
111 t.datetime "updated_at"
111 t.datetime "updated_at"
112 end
112 end
113
113
114 add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
114 add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
115 add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
115 add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
116
116
117 create_table "sites", :force => true do |t|
117 create_table "sites", :force => true do |t|
118 t.string "name"
118 t.string "name"
119 t.boolean "started"
119 t.boolean "started"
120 t.datetime "start_time"
120 t.datetime "start_time"
121 t.datetime "created_at"
121 t.datetime "created_at"
122 t.datetime "updated_at"
122 t.datetime "updated_at"
123 - t.integer "country_id"
123 + t.integer "country_id", :limit => 11
124 t.string "password"
124 t.string "password"
125 end
125 end
126
126
127 create_table "submissions", :force => true do |t|
127 create_table "submissions", :force => true do |t|
128 - t.integer "user_id"
128 + t.integer "user_id", :limit => 11
129 - t.integer "problem_id"
129 + t.integer "problem_id", :limit => 11
130 - t.integer "language_id"
130 + t.integer "language_id", :limit => 11
131 t.text "source"
131 t.text "source"
132 t.binary "binary"
132 t.binary "binary"
133 t.datetime "submitted_at"
133 t.datetime "submitted_at"
134 t.datetime "compiled_at"
134 t.datetime "compiled_at"
135 t.text "compiler_message"
135 t.text "compiler_message"
136 t.datetime "graded_at"
136 t.datetime "graded_at"
137 - t.integer "points"
137 + t.integer "points", :limit => 11
138 t.text "grader_comment"
138 t.text "grader_comment"
139 - t.integer "number"
139 + t.integer "number", :limit => 11
140 t.string "source_filename"
140 t.string "source_filename"
141 end
141 end
142
142
143 add_index "submissions", ["user_id", "problem_id", "number"], :name => "index_submissions_on_user_id_and_problem_id_and_number", :unique => true
143 add_index "submissions", ["user_id", "problem_id", "number"], :name => "index_submissions_on_user_id_and_problem_id_and_number", :unique => true
144 add_index "submissions", ["user_id", "problem_id"], :name => "index_submissions_on_user_id_and_problem_id"
144 add_index "submissions", ["user_id", "problem_id"], :name => "index_submissions_on_user_id_and_problem_id"
145
145
146 create_table "tasks", :force => true do |t|
146 create_table "tasks", :force => true do |t|
147 - t.integer "submission_id"
147 + t.integer "submission_id", :limit => 11
148 t.datetime "created_at"
148 t.datetime "created_at"
149 - t.integer "status"
149 + t.integer "status", :limit => 11
150 t.datetime "updated_at"
150 t.datetime "updated_at"
151 end
151 end
152
152
153 create_table "test_requests", :force => true do |t|
153 create_table "test_requests", :force => true do |t|
154 - t.integer "user_id"
154 + t.integer "user_id", :limit => 11
155 - t.integer "problem_id"
155 + t.integer "problem_id", :limit => 11
156 - t.integer "submission_id"
156 + t.integer "submission_id", :limit => 11
157 t.string "input_file_name"
157 t.string "input_file_name"
158 t.string "output_file_name"
158 t.string "output_file_name"
159 t.string "running_stat"
159 t.string "running_stat"
160 - t.integer "status"
160 + t.integer "status", :limit => 11
161 t.datetime "updated_at"
161 t.datetime "updated_at"
162 t.datetime "submitted_at"
162 t.datetime "submitted_at"
163 t.datetime "compiled_at"
163 t.datetime "compiled_at"
164 t.text "compiler_message"
164 t.text "compiler_message"
165 t.datetime "graded_at"
165 t.datetime "graded_at"
166 t.string "grader_comment"
166 t.string "grader_comment"
167 t.datetime "created_at"
167 t.datetime "created_at"
168 t.float "running_time"
168 t.float "running_time"
169 t.string "exit_status"
169 t.string "exit_status"
170 - t.integer "memory_usage"
170 + t.integer "memory_usage", :limit => 11
171 end
171 end
172
172
173 add_index "test_requests", ["user_id", "problem_id"], :name => "index_test_requests_on_user_id_and_problem_id"
173 add_index "test_requests", ["user_id", "problem_id"], :name => "index_test_requests_on_user_id_and_problem_id"
174
174
175 create_table "users", :force => true do |t|
175 create_table "users", :force => true do |t|
176 t.string "login", :limit => 10
176 t.string "login", :limit => 10
177 t.string "full_name"
177 t.string "full_name"
178 t.string "hashed_password"
178 t.string "hashed_password"
179 t.string "salt", :limit => 5
179 t.string "salt", :limit => 5
180 t.string "alias"
180 t.string "alias"
181 t.string "email"
181 t.string "email"
182 - t.integer "site_id"
182 + t.integer "site_id", :limit => 11
183 - t.integer "country_id"
183 + t.integer "country_id", :limit => 11
184 end
184 end
185
185
186 add_index "users", ["login"], :name => "index_users_on_login", :unique => true
186 add_index "users", ["login"], :name => "index_users_on_login", :unique => true
187
187
188 end
188 end
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
This diff has been collapsed as it changes many lines, (783 lines changed) Show them Hide them
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
deleted file
You need to be logged in to leave comments. Login now