OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/app/views/users/index.html.erb

86 lines
3.5 KiB

<%#-- copyright
OpenProject is a project management system.
Copyright (C) 2012-2013 the OpenProject Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 3.
See doc/COPYRIGHT.rdoc for more details.
++#%>
<div class="contextual">
<%= link_to l(:label_user_new), {:action => 'new'}, :class => 'icon icon-add' %>
</div>
<h2><%=l(:label_user_plural)%></h2>
<%= form_tag({}, :method => :get) do %>
<fieldset><legend><%= l(:label_filter_plural) %></legend>
<label for='status'><%= User.human_attribute_name(:status) %>:</label>
<%= select_tag 'status', users_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
<% if @groups.present? %>
<label for='group_id'><%= Group.model_name.human %>:</label>
<%= collection_select :group,
:id,
@groups,
:id,
:name,
{ :include_blank => true,
:selected => params[:group_id].to_i },
{ :name => "group_id",
:onchange => "this.form.submit(); return false;" } %>
<% end %>
<label for='name'><%= User.model_name.human %>:</label>
<%= text_field_tag 'name', params[:name], :size => 30 %>
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
<%= link_to l(:button_clear), users_path, :class => 'icon icon-reload' %>
</fieldset>
<% end %>
&nbsp;
<div class="autoscroll">
<table class="list">
<thead>
<tr>
<%= sort_header_tag('login', :caption => User.human_attribute_name(:login)) %>
<%= sort_header_tag('firstname', :caption => User.human_attribute_name(:firstname)) %>
<%= sort_header_tag('lastname', :caption => User.human_attribute_name(:lastname)) %>
<%= sort_header_tag('mail', :caption => User.human_attribute_name(:mail)) %>
<%= sort_header_tag('admin', :caption => User.human_attribute_name(:admin), :default_order => 'desc') %>
<%= sort_header_tag('created_on', :caption => User.human_attribute_name(:created_on), :default_order => 'desc') %>
<%= sort_header_tag('last_login_on', :caption => User.human_attribute_name(:last_login_on), :default_order => 'desc') %>
<th><%= User.human_attribute_name(:status) %></th>
<th></th>
</tr>
</thead>
<tbody>
<% for user in @users -%>
<tr class="user <%= cycle("odd", "even") %> <%= %w(anon active registered locked)[user.status] %> <%= 'blocked' if user.failed_too_many_recent_login_attempts? %>">
<td class="username"><%= avatar(user, :size => "14") %><%= link_to h(user.login), edit_user_path(user) %></td>
<td class="firstname"><%= h(user.firstname) %></td>
<td class="lastname"><%= h(user.lastname) %></td>
<td class="email"><%= mail_to(h(user.mail)) %></td>
<td align="center"><%= checked_image user.admin? %></td>
<td class="created_on" align="center"><%= format_time(user.created_on) %></td>
<td class="last_login_on" align="center">
<%= format_time(user.last_login_on) unless user.last_login_on.nil? %>
</td>
<td class="status"><%= full_user_status(user) %></td>
<td>
<small>
<%= change_user_status_links(user) unless user.id == current_user.id %>
</small>
</td>
</tr>
<% end -%>
</tbody>
</table>
</div>
<%= pagination_links_full @users %>
<% html_title(l(:label_user_plural)) -%>