]> source.dussan.org Git - redmine.git/commitdiff
Adds user count in status drop down on admin user list.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 11 Aug 2008 21:10:24 +0000 (21:10 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 11 Aug 2008 21:10:24 +0000 (21:10 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1735 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/users_helper.rb
app/views/users/list.rhtml

index 32b29526a3ac00c243ba118d0c26ebd8967be9df..5b113e8808b06e360eac9d6ce2f411be57b3d4e6 100644 (file)
 # 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
index 0ef6b8aa4a63002fefb6e973fa8654d7c12caf51..77d45a6bb3ab6b9cc31cb422db6e8d4b4f32adce 100644 (file)
@@ -7,7 +7,7 @@
 <% 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 %>
 &nbsp;