Added logic to not show invetment links is the budget phase isn't reviewing_ballots or finished

This commit is contained in:
Raúl Fuentes
2018-01-25 17:10:39 +01:00
committed by Bertocq
parent 90636daf87
commit 5b16d395e7
2 changed files with 14 additions and 5 deletions

View File

@@ -1,5 +1,9 @@
module BudgetsHelper
def show_links_to_budget_investments(budget)
['reviewing_ballots', 'finished'].include? budget.phase
end
def heading_name_and_price_html(heading, budget)
content_tag :div do
concat(heading.name + ' ')

View File

@@ -89,15 +89,20 @@
</div>
<p>
<% show_links = show_links_to_budget_investments(current_budget) %>
<% if show_links %>
<%= link_to budget_investments_path(current_budget.id) do %>
<small><%= t("budgets.index.investment_proyects") %></small>
<% end %><br>
<% end %>
<%= link_to budget_investments_path(budget_id: current_budget.id, filter: 'unfeasible') do %>
<small><%= t("budgets.index.unfeasible_investment_proyects") %></small>
<% end %><br>
<% if show_links %>
<%= link_to budget_investments_path(budget_id: current_budget.id, filter: 'unselected') do %>
<small><%= t("budgets.index.not_selected_investment_proyects") %></small>
<% end %>
<% end %>
</p>
<% end %>