merge budget helpers in a single file
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
module BudgetHelper
|
||||
|
||||
def heading_name(heading)
|
||||
heading.present? ? heading.name : t("budget.headings.none")
|
||||
end
|
||||
|
||||
def namespaced_budget_investment_path(investment, options={})
|
||||
case namespace
|
||||
when "management::budgets"
|
||||
management_budget_investment_path(investment, options)
|
||||
else
|
||||
budget_investment_path(investment, options.merge(budget_id: investment.budget_id))
|
||||
end
|
||||
end
|
||||
|
||||
def display_budget_countdown?(budget)
|
||||
budget.balloting?
|
||||
end
|
||||
|
||||
def css_for_ballot_heading(heading)
|
||||
return '' unless current_ballot.present?
|
||||
current_ballot.has_lines_in_heading?(heading) ? 'active' : ''
|
||||
end
|
||||
|
||||
def current_ballot
|
||||
Budget::Ballot.where(user: current_user, budget: @budget).first
|
||||
end
|
||||
end
|
||||
@@ -8,4 +8,29 @@ module BudgetsHelper
|
||||
Budget::CURRENCY_SYMBOLS.map { |cs| [ cs, cs ] }
|
||||
end
|
||||
|
||||
end
|
||||
def heading_name(heading)
|
||||
heading.present? ? heading.name : t("budget.headings.none")
|
||||
end
|
||||
|
||||
def namespaced_budget_investment_path(investment, options={})
|
||||
case namespace
|
||||
when "management::budgets"
|
||||
management_budget_investment_path(investment.budget, investment, options)
|
||||
else
|
||||
budget_investment_path(investment.budget, investment, options.merge(budget_id: investment.budget_id))
|
||||
end
|
||||
end
|
||||
|
||||
def display_budget_countdown?(budget)
|
||||
budget.balloting?
|
||||
end
|
||||
|
||||
def css_for_ballot_heading(heading)
|
||||
return '' unless current_ballot.present?
|
||||
current_ballot.has_lines_in_heading?(heading) ? 'active' : ''
|
||||
end
|
||||
|
||||
def current_ballot
|
||||
Budget::Ballot.where(user: current_user, budget: @budget).first
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user