<% if User.current.admin? %>
<%= link_to l(:label_user_new), new_user_path, :class => 'icon icon-add' %>

<%= l(:label_user_plural)%>

<%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
<%= l(:label_filter_plural) %> <%= select_tag 'status', users_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %> <% if @groups.present? %> <%= select_tag 'group_id', content_tag('option') + options_from_collection_for_select(@groups, :id, :name, params[:group_id].to_i), :onchange => "this.form.submit(); return false;" %> <% end %> <%= text_field_tag 'name', params[:name], :size => 30 %> <%= submit_tag l(:label_search), :class => "small", :name => nil %>
<% end %>  
<%= sort_header_tag('login', :caption => l(:field_login)) %> <%= sort_header_tag('firstname', :caption => l(:field_firstname)) %> <%= sort_header_tag('lastname', :caption => l(:field_lastname)) %> <%= sort_header_tag('mail', :caption => l(:field_mail)) %> <%= sort_header_tag('admin', :caption => l(:field_admin), :default_order => 'desc') %> <%= sort_header_tag('created_on', :caption => l(:field_created_on), :default_order => 'desc') %> <%= sort_header_tag('last_login_on', :caption => l(:field_last_login_on), :default_order => 'desc') %> <% for user in @users -%> "> <% end -%>
<%= avatar(user, :size => "14") %><%= link_to h(user.login), edit_user_path(user) %> <%= h(user.firstname) %> <%= h(user.lastname) %> <%= checked_image user.admin? %> <%= format_time(user.created_on) %> <%= change_status_link(user) %> <%= delete_link user_path(user, :back_url => users_path(params)) unless User.current == user %>
<% html_title(l(:label_user_plural)) -%> <% else %>
<%= l(:label_user_plural)%> <%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
<%= sort_user(@s_type, @project_type)%>
<% for user in @users -%> <% unless user.id == 1%>
<%= content_tag "p", "#{format_date(user.created_on)} #{l(:label_member_since)}", :class => "float_right member_since" %> <%= image_tag "/images/time_member.png", :class => "img_member_time"%>
<%= link_to image_tag(url_to_avatar(user), :class => 'avatar'), user_path(user) %> <%= content_tag "span", link_to_user(user), :class => "nomargin avatar_name" %>
<%= l(:label_user_grade) %>: <%= user.user_status.grade %>
<%= l(:label_x_has_fans,:count=>user.watcher_users.count)%> <%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %>
<% unless user.memberships.empty? %> <%= l(:label_x_contribute_to, :count => user.memberships.count) %> <% for member in user.memberships %> <%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : ',' %> <% end %> <% end %> <%= user.changesets.count == 0 ? '' : ",#{l(:label_x_total_commit, :count => user.changesets.count)}" %>
<% end -%> <% end -%>
<% html_title(l(:label_user_plural)) -%> <% end -%>