add search form on admin booths
This commit is contained in:
@@ -2,6 +2,7 @@ class Admin::Poll::BoothsController < Admin::Poll::BaseController
|
||||
load_and_authorize_resource class: "Poll::Booth"
|
||||
|
||||
def index
|
||||
@booths = @booths.search params[:search].strip if params[:search]
|
||||
@booths = @booths.order(name: :asc).page(params[:page])
|
||||
end
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
<% end %>
|
||||
|
||||
<% if @booths.any? %>
|
||||
<%= render "/admin/shared/booth_search", url: admin_booths_path %>
|
||||
|
||||
<h3><%= page_entries_info @booths %></h3>
|
||||
<table>
|
||||
<thead>
|
||||
|
||||
10
app/views/admin/shared/_booth_search.html.erb
Normal file
10
app/views/admin/shared/_booth_search.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<%= form_for(Poll::Booth.new, url: url, as: :booth, method: :get) do |f| %>
|
||||
<div class="small-12 medium-6">
|
||||
<div class="input-group">
|
||||
<%= text_field_tag :search, "", placeholder: t("admin.shared.booths_search.placeholder") %>
|
||||
<div class="input-group-button">
|
||||
<%= f.submit t("admin.shared.proposal_search.button"), class: "button" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -1330,7 +1330,7 @@ en:
|
||||
false_value: "No"
|
||||
booths_search:
|
||||
button: Search
|
||||
placeholder: Search booth by name
|
||||
placeholder: Search booth by name or location
|
||||
poll_officers_search:
|
||||
button: Search
|
||||
placeholder: Search poll officers
|
||||
|
||||
Reference in New Issue
Block a user