Simplify filters navbar on Admin::Budget::Investment

This commit is contained in:
Angel Perez
2018-01-18 21:26:06 -04:00
parent e5c73d8f02
commit e92a67a206
3 changed files with 9 additions and 19 deletions

View File

@@ -3,8 +3,7 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
include FeatureFlags include FeatureFlags
feature_flag :budgets feature_flag :budgets
has_filters(%w{valuation_open without_admin managed valuating valuation_finished has_filters(%w{without_admin valuation_finished all},
valuation_finished_feasible selected winners all},
only: [:index, :toggle_selection]) only: [:index, :toggle_selection])
before_action :load_budget before_action :load_budget
@@ -60,16 +59,16 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
def budget_investment_params def budget_investment_params
params.require(:budget_investment) params.require(:budget_investment)
.permit(:title, :description, :external_url, :heading_id, :administrator_id, :tag_list, :valuation_tag_list, :incompatible, .permit(:title, :description, :external_url, :heading_id, :administrator_id, :tag_list, :valuation_tag_list,
:selected, valuator_ids: []) :incompatible, :selected, valuator_ids: [])
end end
def load_budget def load_budget
@budget = Budget.includes(:groups).find params[:budget_id] @budget = Budget.includes(:groups).find(params[:budget_id])
end end
def load_investment 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 end
def load_admins def load_admins
@@ -77,7 +76,7 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
end end
def load_valuators 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 end
def load_tags def load_tags
@@ -93,4 +92,5 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
@investment.set_tag_list_on(:valuation, budget_investment_params[:valuation_tag_list]) @investment.set_tag_list_on(:valuation, budget_investment_params[:valuation_tag_list])
params[:budget_investment] = params[:budget_investment].except(:valuation_tag_list) params[:budget_investment] = params[:budget_investment].except(:valuation_tag_list)
end end
end end

View File

@@ -138,19 +138,14 @@ en:
valuator_filter_all: All valuators valuator_filter_all: All valuators
tags_filter_all: All tags tags_filter_all: All tags
filters: filters:
valuation_open: Open all: All
without_admin: Without assigned admin without_admin: Without assigned admin
managed: Managed
valuating: Under valuation
valuation_finished: Valuation finished valuation_finished: Valuation finished
valuation_finished_feasible: Val. fin. Feasible
feasible: Feasible feasible: Feasible
selected: Selected selected: Selected
undecided: Undecided undecided: Undecided
unfeasible: Unfeasible unfeasible: Unfeasible
max_per_heading: Max. supports per heading max_per_heading: Max. supports per heading
winners: Winners
all: All
button: Filter button: Filter
download_current_selection: "Download current selection" download_current_selection: "Download current selection"
no_budget_investments: "There are no investment projects." no_budget_investments: "There are no investment projects."

View File

@@ -138,19 +138,14 @@ es:
valuator_filter_all: Todos los evaluadores valuator_filter_all: Todos los evaluadores
tags_filter_all: Todas las etiquetas tags_filter_all: Todas las etiquetas
filters: filters:
valuation_open: Abiertas all: Todos
without_admin: Sin administrador without_admin: Sin administrador
managed: Gestionando
valuating: En evaluación
valuation_finished: Evaluación finalizada valuation_finished: Evaluación finalizada
valuation_finished_feasible: Viables
feasible: Viables feasible: Viables
selected: Seleccionados selected: Seleccionados
undecided: Sin decidir undecided: Sin decidir
unfeasible: Inviables unfeasible: Inviables
max_per_heading: Corte por partida max_per_heading: Corte por partida
winners: Ganadoras
all: Todas
button: Filtrar button: Filtrar
download_current_selection: "Descargar selección actual" download_current_selection: "Descargar selección actual"
no_budget_investments: "No hay proyectos de gasto." no_budget_investments: "No hay proyectos de gasto."