/bans: add search form.

This commit is contained in:
evazion
2017-04-12 23:51:26 -05:00
parent 06f2ed685e
commit 9bf1c89357
2 changed files with 10 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
<%= simple_form_for(:search, method: :get, url: bans_path, defaults: { required: false }, html: { class: "inline-form" }) do |f| %>
<%= f.input :user_name, label: "User", input_html: { value: params[:search][:user_name] } %>
<%= f.input :banner_name, label: "Banner", input_html: { value: params[:search][:banner_name] } %>
<%= f.input :reason_matches, label: "Reason", hint: "Use * for wildcard", input_html: { value: params[:search][:reason_matches] } %>
<%= f.input :expired, label: "Expired?", collection: [["Yes", true], ["No", false]], include_blank: true, selected: params[:search][:expired] %>
<%= f.input :order, include_blank: false, collection: [%w[Created id_desc], %w[Expiration expires_at_desc]], selected: params[:search][:order] %>
<%= f.submit "Search" %>
<% end %>

View File

@@ -2,6 +2,8 @@
<div id="a-index">
<h1>Bans</h1>
<%= render "search" %>
<table class="striped autofit">
<thead>
<tr>