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

123 lines
5.5 KiB

<%#-- copyright
OpenProject is a project management system.
Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 3.
OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
Copyright (C) 2006-2013 Jean-Philippe Lang
Copyright (C) 2010-2013 the ChiliProject Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= toolbar title: l(:label_user_plural) do %>
<%= link_to new_user_path, class: 'button -alt-highlight' do %>
<i class="button--icon icon-add"></i>
<span class="button--text"><%= l(:label_user_new) %></span>
<% end %>
<%= call_hook(:user_admin_action_menu) %>
<% end %>
<%= form_tag({}, method: :get) do %>
<fieldset class="simple-filters--container">
<legend><%= l(:label_filter_plural) %></legend>
<ul class="simple-filters--filters <%= @groups.present? ? "-columns-3" : '' %>">
<li class="simple-filters--filter">
<label class='simple-filters--filter-name' for='status'><%= User.human_attribute_name(:status) %>:</label>
<%= select_tag 'status', users_status_options_for_select(@status), onchange: "this.form.submit(); return false;", class: 'simple-filters--filter-value' %>
</li>
<% if @groups.present? %>
<li class="simple-filters--filter">
<label class='simple-filters--filter-name' 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;",
class: 'simple-filters--filter-value' } %>
</li>
<% end %>
<li class="simple-filters--filter">
<label class='simple-filters--filter-name' for='name'><%= User.human_attribute_name :name %>:</label>
<%= text_field_tag 'name', params[:name], class: 'simple-filters--filter-value' %>
</li>
<li class="simple-filters--controls">
<%= submit_tag l(:button_apply), class: 'button -highlight -small', name: nil %>
<%= link_to l(:button_clear), users_path, class: 'button -small -with-icon icon-undo' %>
</li>
</ul>
</fieldset>
<% end %>
&nbsp;
<div class="generic-table--container">
<div class="generic-table--results-container">
<table interactive-table role="grid" class="generic-table">
<colgroup>
<col highlight-col>
<col highlight-col>
<col highlight-col>
<col highlight-col>
<col highlight-col>
<col highlight-col>
<col highlight-col>
<col highlight-col>
<col>
</colgroup>
<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></th>
</tr>
</thead>
<tbody>
<% for user in @users -%>
<tr class="user <%= %w(anon active registered locked)[user.status] %> <%= 'blocked' if user.failed_too_many_recent_login_attempts? %>">
<td class="username"><%= avatar(user, class: 'avatar-mini') %><%= 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><%= checked_image user.admin? %></td>
<td class="created_on"><%= format_time(user.created_on) %></td>
<td class="last_login_on">
<%= format_time(user.last_login_on) unless user.last_login_on.nil? %>
</td>
<td class="status"><%= full_user_status(user) %></td>
<td>
<%= change_user_status_links(user) unless user.id == current_user.id %>
</td>
</tr>
<% end -%>
</tbody>
</table>
<div class="generic-table--header-background"></div>
</div>
</div>
<%= pagination_links_full @users %>
<% html_title(l(:label_user_plural)) -%>