shows investment price info only if phase is balloting or later

This commit is contained in:
Juanjo Bazán
2017-04-17 13:15:17 +02:00
parent 83e7911c11
commit 61e5c187da
3 changed files with 41 additions and 1 deletions

View File

@@ -245,6 +245,12 @@ class Budget
budget.balloting?
end
def should_show_price_info?
feasible? &&
price_explanation.present? &&
(budget.balloting? || budget.reviewing_ballots? || budget.finished?)
end
def formatted_price
budget.formatted_amount(price)
end

View File

@@ -47,7 +47,7 @@
<p><%= investment.unfeasibility_explanation %></p>
<% end %>
<% if investment.feasible? && investment.price_explanation.present? %>
<% if investment.should_show_price_info? %>
<h2><%= t('budgets.investments.show.price_explanation') %></h2>
<p><%= investment.price_explanation %></p>
<% end %>