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

View File

@@ -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."

View File

@@ -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."