list.rhtml
59 lines
| 2.4 KiB
| text/html+ruby
|
RhtmlLexer
|
r90 | <div class="contextual"> | |
|
r154 | <%= link_to l(:label_user_new), {:action => 'add'}, :class => 'icon icon-add' %> | |
|
r90 | </div> | |
|
r12 | <h2><%=l(:label_user_plural)%></h2> | |
|
r330 | ||
|
r344 | <% form_tag() do %> | |
<fieldset><legend><%= l(:label_filter_plural) %></legend> | |||
<label><%= l(:field_status) %> :</label> | |||
<%= select_tag 'status', status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %> | |||
<%= submit_tag l(:button_apply), :class => "small" %> | |||
</fieldset> | |||
<% end %> | |||
| |||
|
r330 | <table class="list"> | |
|
r105 | <thead><tr> | |
|
r330 | <%= 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)) %> | |||
<th></th> | |||
|
r105 | </tr></thead> | |
<tbody> | |||
|
r2 | <% for user in @users %> | |
|
r330 | <tr class="<%= cycle("odd", "even") %>"> | |
<td><%= link_to user.login, :action => 'edit', :id => user %></td> | |||
<td><%= user.firstname %></td> | |||
<td><%= user.lastname %></td> | |||
<td><%= user.mail %></td> | |||
<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> | |||
<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"> | |||
<% form_tag({:action => 'edit', :id => user}) do %> | |||
<% if user.locked? %> | |||
<%= hidden_field_tag 'user[status]', User::STATUS_ACTIVE %> | |||
<%= submit_tag l(:button_unlock), :class => "button-small" %> | |||
|
r152 | <% elsif user.registered? %> | |
<%= hidden_field_tag 'user[status]', User::STATUS_ACTIVE %> | |||
<%= submit_tag l(:button_activate), :class => "button-small" %> | |||
|
r330 | <% else %> | |
<%= hidden_field_tag 'user[status]', User::STATUS_LOCKED %> | |||
<%= submit_tag l(:button_lock), :class => "button-small" %> | |||
<% end %> | |||
<% end %> | |||
|
r2 | </td> | |
</tr> | |||
<% end %> | |||
|
r105 | </tbody> | |
|
r2 | </table> | |
|
r330 | ||
|
r406 | <p><%= pagination_links_full @user_pages, :status => @status %> | |
|
r330 | [ <%= @user_pages.current.first_item %> - <%= @user_pages.current.last_item %> / <%= @user_count %> ] | |
|
r2 | </p> |