# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module UsersHelper
- def status_options_for_select(selected)
+ def users_status_options_for_select(selected)
+ user_count_by_status = User.count(:group => 'status').to_hash
options_for_select([[l(:label_all), ''],
- [l(:status_active), 1],
- [l(:status_registered), 2],
- [l(:status_locked), 3]], selected)
+ ["#{l(:status_active)} (#{user_count_by_status[1].to_i})", 1],
+ ["#{l(:status_registered)} (#{user_count_by_status[2].to_i})", 2],
+ ["#{l(:status_locked)} (#{user_count_by_status[3].to_i})", 3]], selected)
end
# Options for the new membership projects combo-box
<% form_tag({}, :method => :get) do %>
<fieldset><legend><%= l(:label_filter_plural) %></legend>
<label><%= l(:field_status) %> :</label>
-<%= select_tag 'status', status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
+<%= select_tag 'status', users_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
</fieldset>
<% end %>