ensl.org/app/views/users/index.html.erb

49 lines
1.3 KiB
Text
Raw Normal View History

2014-04-13 11:16:51 +00:00
<h1>Listing Users</h1>
<p>Search for users by name or Steam ID:</p>
2014-04-13 11:16:51 +00:00
<%= form_tag(users_path, method: 'get', class: 'square search') do %>
<%= hidden_field_tag :direction, params[:direction] %>
<%= hidden_field_tag :sort, params[:sort] %>
2014-04-13 11:16:51 +00:00
<div class="fields query">
<%= text_field_tag :search, params[:search] %>
2014-04-13 11:16:51 +00:00
</div>
<div class="controls">
<%= submit_tag "Search", name: nil %>
</div>
<% end %>
<table id="users" class="striped">
<tr>
2014-04-13 11:16:51 +00:00
<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? %>
2014-04-13 11:16:51 +00:00
<th class="actions"></th>
<% end %>
</tr>
<% @users.each do |user| %>
2014-04-13 11:16:51 +00:00
<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? %>
2014-04-13 11:16:51 +00:00
<td class="actions">
<%= link_to edit_user_path(user) do %>
<%= icon 'pencil' %>
2014-04-13 11:16:51 +00:00
<% end %>
<%= link_to user, confirm: "Proceed to delete?", method: :delete do %>
<%= icon 'times' %>
2014-04-13 11:16:51 +00:00
<% end %>
</td>
<% end %>
</tr>
<% end %>
</table>
2014-04-13 11:16:51 +00:00
<%= will_paginate @users %>