Simplify filters navbar on Admin::Budget::Investment
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user