From e92a67a206ec2d3086ee7ae179fd597fa56cf79f Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Thu, 18 Jan 2018 21:26:06 -0400 Subject: [PATCH] Simplify filters navbar on Admin::Budget::Investment --- .../admin/budget_investments_controller.rb | 14 +++++++------- config/locales/en/admin.yml | 7 +------ config/locales/es/admin.yml | 7 +------ 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/app/controllers/admin/budget_investments_controller.rb b/app/controllers/admin/budget_investments_controller.rb index 7a57c8814..eb2125aa1 100644 --- a/app/controllers/admin/budget_investments_controller.rb +++ b/app/controllers/admin/budget_investments_controller.rb @@ -3,8 +3,7 @@ class Admin::BudgetInvestmentsController < Admin::BaseController include FeatureFlags feature_flag :budgets - has_filters(%w{valuation_open without_admin managed valuating valuation_finished - valuation_finished_feasible selected winners all}, + has_filters(%w{without_admin valuation_finished all}, only: [:index, :toggle_selection]) before_action :load_budget @@ -60,16 +59,16 @@ class Admin::BudgetInvestmentsController < Admin::BaseController def budget_investment_params params.require(:budget_investment) - .permit(:title, :description, :external_url, :heading_id, :administrator_id, :tag_list, :valuation_tag_list, :incompatible, - :selected, valuator_ids: []) + .permit(:title, :description, :external_url, :heading_id, :administrator_id, :tag_list, :valuation_tag_list, + :incompatible, :selected, valuator_ids: []) end def load_budget - @budget = Budget.includes(:groups).find params[:budget_id] + @budget = Budget.includes(:groups).find(params[:budget_id]) end def load_investment - @investment = Budget::Investment.where(budget_id: @budget.id).find params[:id] + @investment = Budget::Investment.where(budget_id: @budget.id).find(params[:id]) end def load_admins @@ -77,7 +76,7 @@ class Admin::BudgetInvestmentsController < Admin::BaseController end def load_valuators - @valuators = Valuator.includes(:user).all.order("description ASC").order("users.email ASC") + @valuators = Valuator.includes(:user).all.order(description: :asc).order("users.email ASC") end def load_tags @@ -93,4 +92,5 @@ class Admin::BudgetInvestmentsController < Admin::BaseController @investment.set_tag_list_on(:valuation, budget_investment_params[:valuation_tag_list]) params[:budget_investment] = params[:budget_investment].except(:valuation_tag_list) end + end diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index b6918bc8d..d277508c7 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -138,19 +138,14 @@ en: valuator_filter_all: All valuators tags_filter_all: All tags filters: - valuation_open: Open + all: All without_admin: Without assigned admin - managed: Managed - valuating: Under valuation valuation_finished: Valuation finished - valuation_finished_feasible: Val. fin. Feasible feasible: Feasible selected: Selected undecided: Undecided unfeasible: Unfeasible max_per_heading: Max. supports per heading - winners: Winners - all: All button: Filter download_current_selection: "Download current selection" no_budget_investments: "There are no investment projects." diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index c3bc13a0d..ae5abc502 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -138,19 +138,14 @@ es: valuator_filter_all: Todos los evaluadores tags_filter_all: Todas las etiquetas filters: - valuation_open: Abiertas + all: Todos without_admin: Sin administrador - managed: Gestionando - valuating: En evaluación valuation_finished: Evaluación finalizada - valuation_finished_feasible: Viables feasible: Viables selected: Seleccionados undecided: Sin decidir unfeasible: Inviables max_per_heading: Corte por partida - winners: Ganadoras - all: Todas button: Filtrar download_current_selection: "Descargar selección actual" no_budget_investments: "No hay proyectos de gasto."