adds search and filter for poll questions
This commit is contained in:
8
app/views/admin/poll/questions/_filter.html.erb
Normal file
8
app/views/admin/poll/questions/_filter.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="small-12 medium-6">
|
||||
<%= form_tag '', method: :get do %>
|
||||
<%= select_tag "poll_id",
|
||||
poll_select_options(true),
|
||||
prompt: t("admin.booths.index.select_poll"),
|
||||
class: "js-location-changer" %>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -7,6 +7,12 @@
|
||||
<div class="row">
|
||||
|
||||
<div class="small-12 column">
|
||||
<div class="small-12 medium-6">
|
||||
<%= f.select :poll_id,
|
||||
options_for_select(Poll.pluck(:name, :id)),
|
||||
prompt: t("admin.booths.index.select_poll") %>
|
||||
</div>
|
||||
|
||||
<%= f.text_field :title, maxlength: Poll::Question.title_max_length %>
|
||||
|
||||
<%= f.text_field :valid_answers %>
|
||||
|
||||
12
app/views/admin/poll/questions/_search.html.erb
Normal file
12
app/views/admin/poll/questions/_search.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<%= form_tag(admin_questions_path, method: :get) do |f| %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= text_field_tag :search,
|
||||
@search,
|
||||
placeholder: t("admin.shared.spending_proposal_search.placeholder") %>
|
||||
</div>
|
||||
<div class="form-inline small-12 medium-3 column end">
|
||||
<%= submit_tag t("admin.shared.spending_proposal_search.button"), class: "button" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -3,6 +3,9 @@
|
||||
<%= link_to t('admin.questions.index.create'), new_admin_question_path,
|
||||
class: "button success float-right" %>
|
||||
|
||||
<%= render 'filter' %>
|
||||
<%= render 'search' %>
|
||||
|
||||
<% if @questions.count == 0 %>
|
||||
<div class="callout primary">
|
||||
<%= t('admin.questions.index.no_questions') %>
|
||||
|
||||
Reference in New Issue
Block a user