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

<%= l(:label_user_plural)%>

<%= form_tag(users_path, :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(users_path, :method => :get) do %>
 
<% for user in @users -%>
<%= content_tag "p", "#{format_date(user.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %> <%= link_to image_tag(url_to_avatar(user), :class => 'avatar'), user_path(user) %> <%= content_tag "div", link_to_user(user), :class => "nomargin avatar_name" %> <%= content_tag "div", content_tag("p", user.firstname), :class => "clear avatar_name" %>

<% unless user.memberships.empty? %> <%= l(:label_contribute_to, :project_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_total_commit, :total_commit => user.changesets.count)}" %>

<% end -%>
<% html_title(l(:label_user_plural)) -%> <% end -%>