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

55 lines
1.6 KiB
Text
Raw Normal View History

2014-04-27 02:14:17 +00:00
<h1 class="title">Listing Users</h1>
<p><%= User.lately.count %> players have signed in within the past 30 days.</p>
2020-03-17 02:31:59 +00:00
<% # FIXME: check this %>
<%= link_to 'Show them', params.to_enum.to_h.merge(filter: 'lately'), class: 'button' %><br><br><br>
2014-04-27 02:14:17 +00:00
<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 %>
<%= will_paginate @users %>
<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 %>
2020-03-17 00:13:57 +00:00
<%= icon 'pencil' %>
2014-04-13 11:16:51 +00:00
<% end %>
<%= link_to user, confirm: "Proceed to delete?", method: :delete do %>
2020-03-17 00:13:57 +00:00
<%= 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 %>