Description:
removed admin from score board
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r256:7dba57af2448 - - 1 file changed: 1 inserted, 1 deleted
@@ -1,38 +1,38 | |||||
|
1 | class StatusesController < ApplicationController |
|
1 | class StatusesController < ApplicationController |
|
2 |
|
2 | ||
|
3 | def index |
|
3 | def index |
|
4 | if not SHOW_CONTEST_STATUS |
|
4 | if not SHOW_CONTEST_STATUS |
|
5 | render :status => 403 and return |
|
5 | render :status => 403 and return |
|
6 | end |
|
6 | end |
|
7 |
|
7 | ||
|
8 | problem_count = Problem.available_problem_count |
|
8 | problem_count = Problem.available_problem_count |
|
9 |
|
9 | ||
|
10 | @dead_users = [] |
|
10 | @dead_users = [] |
|
11 | @level_users = {} |
|
11 | @level_users = {} |
|
12 | @levels = (0..CODEJOM_MAX_ALIVE_LEVEL) |
|
12 | @levels = (0..CODEJOM_MAX_ALIVE_LEVEL) |
|
13 | @levels.each { |l| @level_users[l] = [] } |
|
13 | @levels.each { |l| @level_users[l] = [] } |
|
14 | - User.find(:all).each do |user| |
|
14 | + User.find(:all).find_all{|user| not user.admin? }.each do |user| |
|
15 | if user.codejom_status==nil |
|
15 | if user.codejom_status==nil |
|
16 | user.update_codejom_status |
|
16 | user.update_codejom_status |
|
17 | user.codejom_status(true) # reload |
|
17 | user.codejom_status(true) # reload |
|
18 | end |
|
18 | end |
|
19 |
|
19 | ||
|
20 | if not user.codejom_status.alive |
|
20 | if not user.codejom_status.alive |
|
21 | @dead_users << user |
|
21 | @dead_users << user |
|
22 | else |
|
22 | else |
|
23 | @level_users[user.codejom_level] << user |
|
23 | @level_users[user.codejom_level] << user |
|
24 | end |
|
24 | end |
|
25 | end |
|
25 | end |
|
26 |
|
26 | ||
|
27 | respond_to do |format| |
|
27 | respond_to do |format| |
|
28 | format.html |
|
28 | format.html |
|
29 | format.xml do |
|
29 | format.xml do |
|
30 | render :xml => { |
|
30 | render :xml => { |
|
31 | :levels => @level_users, |
|
31 | :levels => @level_users, |
|
32 | :dead_users => @dead_users |
|
32 | :dead_users => @dead_users |
|
33 | } |
|
33 | } |
|
34 | end |
|
34 | end |
|
35 | end |
|
35 | end |
|
36 | end |
|
36 | end |
|
37 |
|
37 | ||
|
38 | end |
|
38 | end |
You need to be logged in to leave comments.
Login now