Description:
resets contest start time when changing users' contest
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r289:bafc73878f35 - - 2 files changed: 9 inserted, 3 deleted
@@ -205,12 +205,15 | |||
|
205 | 205 | user.contests << contest |
|
206 | 206 | elsif operation=='remove' |
|
207 | 207 | user.contests.delete(contest) |
|
208 | 208 | else |
|
209 | 209 | user.contests = [contest] |
|
210 | 210 | end |
|
211 | + | |
|
212 | + user.contest_stat.destroy if params[:reset_timer] | |
|
213 | + | |
|
211 | 214 | note << user.login |
|
212 | 215 | end |
|
213 | 216 | end |
|
214 | 217 | flash[:notice] = 'User(s) ' + note.join(', ') + |
|
215 | 218 | ' were successfully modified. ' |
|
216 | 219 | redirect_to :action => 'contest_management' |
@@ -1,16 +1,19 | |||
|
1 | 1 | %h1 Bulk edit users in contests |
|
2 | 2 | |
|
3 | 3 | - form_tag :action => 'manage_contest' do |
|
4 | 4 | List users' login below; one per line. |
|
5 | 5 | %br/ |
|
6 |
- = text_area_tag 'login_list', nil, :rows => 2 |
|
|
6 | + = text_area_tag 'login_list', nil, :rows => 23, :cols => 80 | |
|
7 | 7 | %br/ |
|
8 | 8 | You want to |
|
9 | 9 | = select(nil,"operation",[['assign users to','assign'],['add users to','add'],['remove users from','remove']]) |
|
10 | 10 | contest |
|
11 | 11 | = select("contest","id",Contest.all.collect {|c| [c.title, c.id]}) |
|
12 | - | |
|
13 | - = submit_tag "Perform action", :confirm => 'Are you sure?' | |
|
12 | + = check_box_tag 'reset_timer' | |
|
13 | + Auto-reset current contest timer. | |
|
14 | + %br/ | |
|
15 | + | |
|
16 | + = submit_tag "Perform action!", :confirm => 'Are you sure?' | |
|
14 | 17 | |
|
15 | 18 | %hr/ |
|
16 | 19 | = link_to '[go back to index]', :action => 'index' |
You need to be logged in to leave comments.
Login now