2006-12-16 15:15:31 +03:00
|
|
|
<div class="contextual">
|
2007-01-08 22:21:59 +03:00
|
|
|
<%= link_to l(:label_user_new), {:action => 'add'}, :class => 'icon icon-add' %>
|
2006-12-16 15:15:31 +03:00
|
|
|
</div>
|
|
|
|
|
2006-07-29 23:54:22 +04:00
|
|
|
<h2><%=l(:label_user_plural)%></h2>
|
2006-06-28 22:11:03 +04:00
|
|
|
|
2006-12-24 19:35:25 +03:00
|
|
|
<table class="list">
|
|
|
|
<thead><tr>
|
2006-07-29 23:54:22 +04:00
|
|
|
<%= sort_header_tag('login', :caption => l(:field_login)) %>
|
|
|
|
<%= sort_header_tag('firstname', :caption => l(:field_firstname)) %>
|
|
|
|
<%= sort_header_tag('lastname', :caption => l(:field_lastname)) %>
|
|
|
|
<th><%=l(:field_mail)%></th>
|
|
|
|
<%= sort_header_tag('admin', :caption => l(:field_admin)) %>
|
|
|
|
<%= sort_header_tag('status', :caption => l(:field_status)) %>
|
|
|
|
<%= sort_header_tag('created_on', :caption => l(:field_created_on)) %>
|
|
|
|
<%= sort_header_tag('last_login_on', :caption => l(:field_last_login_on)) %>
|
2006-12-24 19:35:25 +03:00
|
|
|
<th></th>
|
|
|
|
</tr></thead>
|
|
|
|
<tbody>
|
2006-06-28 22:11:03 +04:00
|
|
|
<% for user in @users %>
|
2006-07-09 20:30:01 +04:00
|
|
|
<tr class="<%= cycle("odd", "even") %>">
|
2006-06-28 22:11:03 +04:00
|
|
|
<td><%= link_to user.login, :action => 'edit', :id => user %></td>
|
|
|
|
<td><%= user.firstname %></td>
|
|
|
|
<td><%= user.lastname %></td>
|
|
|
|
<td><%= user.mail %></td>
|
2007-01-08 22:21:59 +03:00
|
|
|
<td align="center"><%= image_tag 'true.png' if user.admin? %></td>
|
|
|
|
<td align="center"><%= image_tag 'locked.png' if user.locked? %><%= image_tag 'user_new.png' if user.registered? %></td>
|
2006-06-28 22:11:03 +04:00
|
|
|
<td align="center"><%= format_time(user.created_on) %></td>
|
|
|
|
<td align="center"><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td>
|
|
|
|
<td align="center">
|
2007-01-26 22:56:25 +03:00
|
|
|
<% form_tag({:action => 'edit', :id => user}) do %>
|
2006-06-28 22:11:03 +04:00
|
|
|
<% if user.locked? %>
|
2006-07-29 13:32:58 +04:00
|
|
|
<%= hidden_field_tag 'user[status]', User::STATUS_ACTIVE %>
|
2006-07-29 23:54:22 +04:00
|
|
|
<%= submit_tag l(:button_unlock), :class => "button-small" %>
|
2007-01-06 17:22:22 +03:00
|
|
|
<% elsif user.registered? %>
|
|
|
|
<%= hidden_field_tag 'user[status]', User::STATUS_ACTIVE %>
|
|
|
|
<%= submit_tag l(:button_activate), :class => "button-small" %>
|
2006-06-28 22:11:03 +04:00
|
|
|
<% else %>
|
2006-07-29 13:32:58 +04:00
|
|
|
<%= hidden_field_tag 'user[status]', User::STATUS_LOCKED %>
|
2006-07-29 23:54:22 +04:00
|
|
|
<%= submit_tag l(:button_lock), :class => "button-small" %>
|
2006-06-28 22:11:03 +04:00
|
|
|
<% end %>
|
2007-01-26 22:56:25 +03:00
|
|
|
<% end %>
|
2006-06-28 22:11:03 +04:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
2006-12-24 19:35:25 +03:00
|
|
|
</tbody>
|
2006-06-28 22:11:03 +04:00
|
|
|
</table>
|
|
|
|
|
|
|
|
<p><%= pagination_links_full @user_pages %>
|
|
|
|
[ <%= @user_pages.current.first_item %> - <%= @user_pages.current.last_item %> / <%= @user_count %> ]
|
|
|
|
</p>
|