mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-11-15 17:31:27 +00:00
fd0e681aa2
Add pagination to teams page
51 lines
1.4 KiB
Text
51 lines
1.4 KiB
Text
<h1 class="title">Listing Users</h1>
|
|
|
|
<p>Search for users by name or Steam ID:</p>
|
|
|
|
<%= form_tag(users_path, method: 'get', class: 'square search') do %>
|
|
<%= hidden_field_tag :direction, params[:direction] %>
|
|
<%= hidden_field_tag :sort, params[:sort] %>
|
|
<div class="fields query">
|
|
<%= text_field_tag :search, params[:search] %>
|
|
</div>
|
|
<div class="controls">
|
|
<%= submit_tag "Search", name: nil %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<%= will_paginate @users %>
|
|
|
|
<table id="users" class="striped">
|
|
<tr>
|
|
<th class="country"></th>
|
|
<th class="username">Username</th>
|
|
<th class="name">Name</th>
|
|
<th class="steamid">Steam ID</th>
|
|
<th class="age">Age</th>
|
|
<% if cuser and cuser.admin? %>
|
|
<th class="actions"></th>
|
|
<% end %>
|
|
</tr>
|
|
|
|
<% @users.each do |user| %>
|
|
<tr>
|
|
<td><%= flag user.country %></td>
|
|
<td><%= link_to (h user.username), user %></td>
|
|
<td><%= h user.firstname %> <%=h user.lastname %></td>
|
|
<td><%= h user.steamid %></td>
|
|
<td><%= user.age %></td>
|
|
<% if cuser and cuser.admin? %>
|
|
<td class="actions">
|
|
<%= link_to edit_user_path(user) do %>
|
|
<%= icon 'pencil' %>
|
|
<% end %>
|
|
<%= link_to user, confirm: "Proceed to delete?", method: :delete do %>
|
|
<%= icon 'times' %>
|
|
<% end %>
|
|
</td>
|
|
<% end %>
|
|
</tr>
|
|
<% end %>
|
|
</table>
|
|
|
|
<%= will_paginate @users %>
|