##// END OF EJS Templates
Adds user count in status drop down on admin user list....
Jean-Philippe Lang -
r1734:41d44c5285a7
parent child
Show More
@@ -16,11 +16,12
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 module UsersHelper
18 module UsersHelper
19 def status_options_for_select(selected)
19 def users_status_options_for_select(selected)
20 user_count_by_status = User.count(:group => 'status').to_hash
20 options_for_select([[l(:label_all), ''],
21 options_for_select([[l(:label_all), ''],
21 [l(:status_active), 1],
22 ["#{l(:status_active)} (#{user_count_by_status[1].to_i})", 1],
22 [l(:status_registered), 2],
23 ["#{l(:status_registered)} (#{user_count_by_status[2].to_i})", 2],
23 [l(:status_locked), 3]], selected)
24 ["#{l(:status_locked)} (#{user_count_by_status[3].to_i})", 3]], selected)
24 end
25 end
25
26
26 # Options for the new membership projects combo-box
27 # Options for the new membership projects combo-box
@@ -7,7 +7,7
7 <% form_tag({}, :method => :get) do %>
7 <% form_tag({}, :method => :get) do %>
8 <fieldset><legend><%= l(:label_filter_plural) %></legend>
8 <fieldset><legend><%= l(:label_filter_plural) %></legend>
9 <label><%= l(:field_status) %> :</label>
9 <label><%= l(:field_status) %> :</label>
10 <%= select_tag 'status', status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
10 <%= select_tag 'status', users_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
11 </fieldset>
11 </fieldset>
12 <% end %>
12 <% end %>
13 &nbsp;
13 &nbsp;
General Comments 0
You need to be logged in to leave comments. Login now