This commit is contained in:
rgarcia
2018-02-09 22:08:52 +01:00
parent 2d3c4e1fbd
commit 00c965b715
31 changed files with 206 additions and 158 deletions

View File

@@ -7,11 +7,12 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
has_orders %w{oldest}, only: [:show, :edit]
has_filters(%w{all without_admin without_valuator under_valuation
valuation_finished winners},
only: [:index, :toggle_selection])
only: [:index, :toggle_selection])
before_action :load_budget
before_action :load_investment, only: [:show, :edit, :update, :toggle_selection]
before_action :load_ballot, only: [:show, :index]
before_action :parse_valuation_filters
before_action :load_investments, only: [:index, :toggle_selection]
def index
@@ -46,6 +47,7 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
else
load_admins
load_valuators
load_valuator_groups
load_tags
render :edit
end
@@ -131,4 +133,16 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
params[:budget_investment] = params[:budget_investment].except(:valuation_tag_list)
end
def parse_valuation_filters
if params[:valuator_or_group_id]
model, id = params[:valuator_or_group_id].split("_")
if model == "group"
params[:valuator_group_id] = id
else
params[:valuator_id] = id
end
end
end
end