socialforge/app/views/admin/users.html.erb

79 lines
4.1 KiB
Plaintext
Raw Normal View History

<% if User.current.admin? %>
<div class="contextual">
<%= link_to l(:label_user_new), new_user_path, :class => 'icon icon-add' %>
</div>
<h3><%= l(:label_user_plural)%></h3>
<%= form_tag(:controller => 'admin', :action => 'search') do %>
<fieldset>
<legend>
<%= l(:label_filter_plural) %>
</legend>
<label for='status'><%= l(:field_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'><%= l(:label_group) %>:</label>
<%= 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 %>
<label for='name'><%= l(:label_user) %>:</label>
<%= text_field_tag 'name', params[:name], :size => 30 %>
<%= submit_tag l(:label_search), :class => "small", :name => nil %><!--Modified by young-->
</fieldset>
<% end %>
&nbsp;
<div class="autoscroll">
2014-08-02 15:16:51 +08:00
<table class="list" style="width: 100%;table-layout: fixed">
<thead>
2014-08-02 15:16:51 +08:00
<tr >
<%= 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') %>
<th></th>
</tr>
</thead>
2014-08-02 15:16:51 +08:00
<col style="width: 10%" />
<col style="width: 5%" />
<col style="width: 5%" />
<col style="width: 10%" />
<col style="width: 5%" />
<col style="width: 10%" />
<col style="width: 10%" />
2014-08-02 15:16:51 +08:00
<col style="width: 5%" />
<col style="width: 5%" />
<tbody>
<% for user in @users -%>
<tr class="<%= user.css_classes %> <%= cycle("odd", "even") %>">
2014-08-02 15:16:51 +08:00
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="username" title='<%=user.login%>'> <%= avatar(user, :size => "14") %><%= link_to h(user.login), edit_user_path(user) %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="firstname" align="center" title='<%=user.firstname%>'><%= h(user.firstname) %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="lastname" align="center" title='<%=user.lastname%>'><%= h(user.lastname) %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="email" align="center" title='<%=user.mail%>'><%= mail_to(h(user.mail)) %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" align="center" align="center"><%= checked_image user.admin? %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="created_on" align="center" title='<%=format_time(user.created_on)%>'><%= format_time(user.created_on) %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="last_login_on" align="center" title='<%= format_time(user.last_login_on)%>'><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td>
<td class="buttons"> <%= change_status_link(user) %>
<%= delete_link user_path(user, :back_url => admin_users_path(params)) unless User.current == user %> </td>
</tr>
<% end -%>
</tbody>
</table>
</div>
<div class="pagination">
<ul>
<%= pagination_links_full @user_pages, @user_count %>
</ul>
</div>
<% html_title(l(:label_user_plural)) -%>
<%else %>
<% end%>