Description:
Fixed Individual Contest confirmation
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r371:6d2e9920049d - - 2 files changed: 2 inserted, 2 deleted
@@ -171,49 +171,49 | |||
|
171 | 171 | else |
|
172 | 172 | send_file out_filename, :stream => false, :filename => "output-#{case_num}.txt", :type => "text/plain" |
|
173 | 173 | end |
|
174 | 174 | end |
|
175 | 175 | |
|
176 | 176 | def error |
|
177 | 177 | @user = User.find(session[:user_id]) |
|
178 | 178 | end |
|
179 | 179 | |
|
180 | 180 | # announcement refreshing and hiding methods |
|
181 | 181 | |
|
182 | 182 | def announcements |
|
183 | 183 | if params.has_key? 'recent' |
|
184 | 184 | prepare_announcements(params[:recent]) |
|
185 | 185 | else |
|
186 | 186 | prepare_announcements |
|
187 | 187 | end |
|
188 | 188 | render(:partial => 'announcement', |
|
189 | 189 | :collection => @announcements, |
|
190 | 190 | :locals => {:announcement_effect => true}) |
|
191 | 191 | end |
|
192 | 192 | |
|
193 | 193 | def confirm_contest_start |
|
194 | 194 | user = User.find(session[:user_id]) |
|
195 |
- if request.method == |
|
|
195 | + if request.method == 'POST' | |
|
196 | 196 | user.update_start_time |
|
197 | 197 | redirect_to :action => 'list' |
|
198 | 198 | else |
|
199 | 199 | @contests = user.contests |
|
200 | 200 | @user = user |
|
201 | 201 | end |
|
202 | 202 | end |
|
203 | 203 | |
|
204 | 204 | protected |
|
205 | 205 | |
|
206 | 206 | def prepare_announcements(recent=nil) |
|
207 | 207 | if GraderConfiguration.show_tasks_to?(@user) |
|
208 | 208 | @announcements = Announcement.find_published(true) |
|
209 | 209 | else |
|
210 | 210 | @announcements = Announcement.find_published |
|
211 | 211 | end |
|
212 | 212 | if recent!=nil |
|
213 | 213 | recent_id = recent.to_i |
|
214 | 214 | @announcements = @announcements.find_all { |a| a.id > recent_id } |
|
215 | 215 | end |
|
216 | 216 | end |
|
217 | 217 | |
|
218 | 218 | def prepare_list_information |
|
219 | 219 | @user = User.find(session[:user_id]) |
@@ -1,16 +1,16 | |||
|
1 | 1 | = user_title_bar(@user) |
|
2 | 2 | |
|
3 | 3 | .announcementbox |
|
4 | 4 | %span{:class => 'title'} |
|
5 | 5 | =t 'main.confirm_contest_start.box_title' |
|
6 | 6 | .announcement |
|
7 | 7 | %center |
|
8 | 8 | =t 'main.confirm_contest_start.contest_list' |
|
9 | 9 | - @contests.each do |contest| |
|
10 | 10 | = contest.title |
|
11 | 11 | %br |
|
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') |
You need to be logged in to leave comments.
Login now