+<%= link_to "#advanced_filters_content",
+ data: {toggle: "advanced_filters"},
+ class: "advanced-filters float-right" do %>
+ <%= t("admin.budget_investments.index.advanced_filters") %>
+<% end %>
+
+
<%= form_tag(admin_budget_budget_investments_path(budget: @budget,
filter: params[:filter],
second_filter: params[:second_filter],
max_per_heading: params[:max_per_heading],
page: 1), method: :get, remote: true, enforce_utf8: false) do %>
+
+
+ <%= check_box_tag :second_filter, "feasible" %>
+ <%= t("#{i18n_namespace}.filters.feasible") %>
+
- <%= check_box_tag :second_filter, "feasible" %>
- <%= t("#{i18n_namespace}.filters.feasible") %>
+
+ <%= check_box_tag :second_filter, "selected" %>
+ <%= t("#{i18n_namespace}.filters.selected") %>
+
- <%= check_box_tag :second_filter, "selected" %>
- <%= t("#{i18n_namespace}.filters.selected") %>
+
+ <%= check_box_tag :second_filter, "undecided" %>
+ <%= t("#{i18n_namespace}.filters.undecided") %>
+
- <%= check_box_tag :second_filter, "undecided" %>
- <%= t("#{i18n_namespace}.filters.undecided") %>
+
+ <%= check_box_tag :second_filter, "unfeasible" %>
+ <%= t("#{i18n_namespace}.filters.unfeasible") %>
+
- <%= check_box_tag :second_filter, "unfeasible" %>
- <%= t("#{i18n_namespace}.filters.unfeasible") %>
-
-
- <%= text_field_tag :max_per_heading %>
- <%= t("#{i18n_namespace}.filters.max_per_heading") %>
+
+ <%= t("#{i18n_namespace}.filters.max_per_heading") %>
+ <%= text_field_tag :max_per_heading %>
+
- <%= submit_tag t("#{i18n_namespace}.filters.button"), class: "button small float-right" %>
+
+ <%= submit_tag t("#{i18n_namespace}.filters.button"), class: "button expanded" %>
+
<% end %>
diff --git a/app/views/admin/budget_investments/index.html.erb b/app/views/admin/budget_investments/index.html.erb
index 6deafed19..b0eed56aa 100644
--- a/app/views/admin/budget_investments/index.html.erb
+++ b/app/views/admin/budget_investments/index.html.erb
@@ -1,40 +1,38 @@
<%= @budget.name %> - <%= t("admin.budget_investments.index.title") %>
-
- <%= form_tag(admin_budget_budget_investments_path(budget: @budget), method: :get, enforce_utf8: false) do %>
-
- <%= select_tag :administrator_id,
- options_for_select(admin_select_options, params[:administrator_id]),
- { prompt: t("admin.budget_investments.index.administrator_filter_all"),
- label: false,
- class: "js-submit-on-change" } %>
-
+<%= form_tag(admin_budget_budget_investments_path(budget: @budget), method: :get, enforce_utf8: false) do %>
+
+ <%= select_tag :administrator_id,
+ options_for_select(admin_select_options, params[:administrator_id]),
+ { prompt: t("admin.budget_investments.index.administrator_filter_all"),
+ label: false,
+ class: "js-submit-on-change" } %>
+
-
- <%= select_tag :valuator_id,
- options_for_select(valuator_select_options, params[:valuator_id]),
- { prompt: t("admin.budget_investments.index.valuator_filter_all"),
- label: false,
- class: "js-submit-on-change" } %>
-
+
+ <%= select_tag :valuator_id,
+ options_for_select(valuator_select_options, params[:valuator_id]),
+ { prompt: t("admin.budget_investments.index.valuator_filter_all"),
+ label: false,
+ class: "js-submit-on-change" } %>
+
-
- <%= select_tag :heading_id,
- options_for_select(budget_heading_select_options(@budget), params[:heading_id]),
- { prompt: t("admin.budget_investments.index.heading_filter_all"),
- label: false,
- class: "js-submit-on-change" } %>
-
+
+ <%= select_tag :heading_id,
+ options_for_select(budget_heading_select_options(@budget), params[:heading_id]),
+ { prompt: t("admin.budget_investments.index.heading_filter_all"),
+ label: false,
+ class: "js-submit-on-change" } %>
+
-
- <%= select_tag :tag_name,
- options_for_select(investment_tags_select_options, params[:tag_name]),
- { prompt: t("admin.budget_investments.index.tags_filter_all"),
- label: false,
- class: "js-submit-on-change" } %>
-
- <% end %>
-
+
+ <%= select_tag :tag_name,
+ options_for_select(investment_tags_select_options, params[:tag_name]),
+ { prompt: t("admin.budget_investments.index.tags_filter_all"),
+ label: false,
+ class: "js-submit-on-change" } %>
+
+<% end %>
<%= render "advanced_filters", i18n_namespace: "admin.budget_investments.index" %>
diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml
index ea30543d9..98a4b7fb6 100644
--- a/config/locales/en/admin.yml
+++ b/config/locales/en/admin.yml
@@ -137,6 +137,7 @@ en:
administrator_filter_all: All administrators
valuator_filter_all: All valuators
tags_filter_all: All tags
+ advanced_filters: Advanced filters
filters:
all: All
without_admin: Without assigned admin
diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml
index 36dfb6be6..03b945d5a 100644
--- a/config/locales/es/admin.yml
+++ b/config/locales/es/admin.yml
@@ -137,6 +137,7 @@ es:
administrator_filter_all: Todos los administradores
valuator_filter_all: Todos los evaluadores
tags_filter_all: Todas las etiquetas
+ advanced_filters: Filtros avanzados
filters:
all: Todos
without_admin: Sin administrador
diff --git a/spec/features/admin/budget_investments_spec.rb b/spec/features/admin/budget_investments_spec.rb
index 05e3f905d..14de19dfe 100644
--- a/spec/features/admin/budget_investments_spec.rb
+++ b/spec/features/admin/budget_investments_spec.rb
@@ -314,6 +314,7 @@ feature 'Admin budget investments' do
expect(page).to have_link("Street with #{n} supports")
end
+ click_link 'Advanced filters'
fill_in "max_per_heading", with: 5
click_button 'Filter'
@@ -628,7 +629,8 @@ feature 'Admin budget investments' do
expect(page).to have_content(selected_bi.title)
expect(page).to have_content(winner_bi.title)
- within('#advanced-filters') { find(:css, "#second_filter[value='feasible']").set(true) }
+ click_link 'Advanced filters'
+ within('#advanced_filters') { find(:css, "#second_filter[value='feasible']").set(true) }
click_button 'Filter'
expect(page).not_to have_content(unfeasible_bi.title)
@@ -637,7 +639,7 @@ feature 'Admin budget investments' do
expect(page).to have_content(selected_bi.title)
expect(page).to have_content(winner_bi.title)
- within('#advanced-filters') { find(:css, "#second_filter[value='selected']").set(true) }
+ within('#advanced_filters') { find(:css, "#second_filter[value='selected']").set(true) }
click_button 'Filter'
expect(page).not_to have_content(unfeasible_bi.title)
@@ -686,7 +688,8 @@ feature 'Admin budget investments' do
expect(page).to have_link('Selected')
end
- within('#advanced-filters') { find(:css, "#second_filter[value='selected']").set(true) }
+ click_link 'Advanced filters'
+ within('#advanced_filters') { find(:css, "#second_filter[value='selected']").set(true) }
click_button 'Filter'
within("#budget_investment_#{feasible_vf_bi.id}") do
@@ -697,7 +700,8 @@ feature 'Admin budget investments' do
scenario "Unselecting an investment", :js do
visit admin_budget_budget_investments_path(@budget)
- within('#advanced-filters') { find(:css, "#second_filter[value='selected']").set(true) }
+ click_link 'Advanced filters'
+ within('#advanced_filters') { find(:css, "#second_filter[value='selected']").set(true) }
click_button 'Filter'
expect(page).to have_content('There are 2 investments')