Move admin budget investments tabs filters to advanced filters component

This commit is contained in:
lalo
2019-04-03 22:27:48 +02:00
parent 12bccf3fd0
commit 237a03552f
10 changed files with 331 additions and 51 deletions

View File

@@ -4,10 +4,8 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
feature_flag :budgets
has_orders %w{oldest}, only: [:show, :edit]
has_filters(%w{all without_admin without_valuator under_valuation
valuation_finished winners},
only: [:index, :toggle_selection])
has_orders %w[oldest], only: [:show, :edit]
has_filters %w[all], only: [:index, :toggle_selection]
before_action :load_budget
before_action :load_investment, only: [:show, :edit, :update, :toggle_selection]

View File

@@ -23,7 +23,9 @@ class Admin::BudgetsController < Admin::BaseController
def calculate_winners
return unless @budget.balloting_process?
@budget.headings.each { |heading| Budget::Result.new(@budget, heading).delay.calculate_winners }
redirect_to admin_budget_budget_investments_path(budget_id: @budget.id, filter: "winners"),
redirect_to admin_budget_budget_investments_path(
budget_id: @budget.id,
advanced_filters: ["winners"]),
notice: I18n.t("admin.budgets.winners.calculated")
end