adds search and filter for poll questions

This commit is contained in:
rgarcia
2016-11-29 11:44:51 +01:00
parent 66f4289e9c
commit 20cb044015
10 changed files with 93 additions and 6 deletions

View 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>

View File

@@ -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 %>

View 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 %>

View File

@@ -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') %>