Manage the render of the price field on public investment section

This commit is contained in:
decabeza
2022-02-02 14:52:48 +01:00
committed by taitus
parent 40bdd1f03a
commit abc4e9dca1
6 changed files with 28 additions and 3 deletions

View File

@@ -17,10 +17,14 @@ class Budgets::Investments::NewComponent < ApplicationComponent
end
def subtitle
if budget.single_heading?
return unless budget.single_heading?
if budget.show_money?
tag.span t("budgets.investments.form.subtitle",
heading: budget.headings.first.name,
price: budget.formatted_heading_price(budget.headings.first))
else
tag.span t("budgets.investments.form.subtitle_without_price", heading: budget.headings.first.name)
end
end
end