Description:
also shows users in all (without pagination)
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r300:5e2d8fe98a1a - - 2 files changed: 16 inserted, 2 deleted
@@ -14,13 +14,19 | |||||
|
14 | :create, :create_from_list, |
|
14 | :create, :create_from_list, |
|
15 | :update ], |
|
15 | :update ], |
|
16 | :redirect_to => { :action => :list } |
|
16 | :redirect_to => { :action => :list } |
|
17 |
|
17 | ||
|
18 | def list |
|
18 | def list |
|
19 | @user_count = User.count |
|
19 | @user_count = User.count |
|
20 | - @users = User.paginate :page => params[:page] |
|
20 | + if params[:page] == 'all' |
|
|
21 | + @users = User.all | ||
|
|
22 | + @paginated = false | ||
|
|
23 | + else | ||
|
|
24 | + @users = User.paginate :page => params[:page] | ||
|
|
25 | + @paginated = true | ||
|
|
26 | + end | ||
|
21 | @hidden_columns = ['hashed_password', 'salt', 'created_at', 'updated_at'] |
|
27 | @hidden_columns = ['hashed_password', 'salt', 'created_at', 'updated_at'] |
|
22 | @contests = Contest.enabled |
|
28 | @contests = Contest.enabled |
|
23 | end |
|
29 | end |
|
24 |
|
30 | ||
|
25 | def active |
|
31 | def active |
|
26 | sessions = ActiveRecord::SessionStore::Session.find(:all, :conditions => ["updated_at >= ?", 60.minutes.ago]) |
|
32 | sessions = ActiveRecord::SessionStore::Session.find(:all, :conditions => ["updated_at >= ?", 60.minutes.ago]) |
@@ -41,13 +41,21 | |||||
|
41 | <%= link_to "[#{contest.name}]", :action => 'contests', :id => contest.id %> |
|
41 | <%= link_to "[#{contest.name}]", :action => 'contests', :id => contest.id %> |
|
42 | <% end %> |
|
42 | <% end %> |
|
43 | <%= link_to "[no contest]", :action => 'contests', :id => 'none' %> |
|
43 | <%= link_to "[no contest]", :action => 'contests', :id => 'none' %> |
|
44 | <% end %> |
|
44 | <% end %> |
|
45 | </div> |
|
45 | </div> |
|
46 |
|
46 | ||
|
47 | - Total <%= @user_count %> users | <%= will_paginate @users, :container => false %> |
|
47 | + Total <%= @user_count %> users | |
|
|
48 | + <% if !@paginated %> | ||
|
|
49 | + Display all users. | ||
|
|
50 | + <%= link_to '[show in pages]', :action => 'list', :page => '1' %> | ||
|
|
51 | + <% else %> | ||
|
|
52 | + Display in pages. | ||
|
|
53 | + <%= link_to '[display all]', :action => 'list', :page => 'all' %> | | ||
|
|
54 | + <%= will_paginate @users, :container => false %> | ||
|
|
55 | + <% end %> | ||
|
48 | <table class="info"> |
|
56 | <table class="info"> |
|
49 | <tr class="info-head"> |
|
57 | <tr class="info-head"> |
|
50 | <% for column in User.content_columns %> |
|
58 | <% for column in User.content_columns %> |
|
51 | <% if !@hidden_columns.index(column.name) %> |
|
59 | <% if !@hidden_columns.index(column.name) %> |
|
52 | <th><%= column.human_name %></th> |
|
60 | <th><%= column.human_name %></th> |
|
53 | <% end %> |
|
61 | <% end %> |
You need to be logged in to leave comments.
Login now