eBooru/app/views/ip_bans/index.html.erb
Earlopain cc379af5eb
[Search] Add custom input type for users
Automatically adds name/id search
2023-08-04 20:46:59 +02:00

43 lines
1.1 KiB
Plaintext

<div id="c-ip-bans">
<div id="a-index">
<h1>IP Bans</h1>
<%= form_search(path: ip_bans_path) do |f| %>
<%= f.input :ip_addr, label: "IP Address" %>
<%= f.user :banner %>
<%= f.input :reason %>
<% end %>
<table class="striped">
<thead>
<tr>
<th>IP Address</th>
<th>Banner</th>
<th>Reason</th>
<th>Created</th>
<th></th>
</tr>
</thead>
<tbody>
<% @ip_bans.each do |ip_ban| %>
<tr>
<td><%= link_to_ip ip_ban.subnetted_ip %></td>
<td><%= link_to_user ip_ban.creator %></td>
<td><%= ip_ban.reason %></td>
<td><%= compact_time ip_ban.created_at %></td>
<td><%= link_to "Unban", ip_ban_path(ip_ban), method: :delete, data: { confirm: "Do your really want to unban #{ip_ban.ip_addr}?" } %></td>
</tr>
<% end %>
</tbody>
</table>
<%= numbered_paginator(@ip_bans) %>
</div>
</div>
<%= render "secondary_links" %>
<% content_for(:page_title) do %>
IP Bans
<% end %>