Added logic to not show invetment links is the budget phase isn't reviewing_ballots or finished
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
module BudgetsHelper
|
module BudgetsHelper
|
||||||
|
|
||||||
|
def show_links_to_budget_investments(budget)
|
||||||
|
['reviewing_ballots', 'finished'].include? budget.phase
|
||||||
|
end
|
||||||
|
|
||||||
def heading_name_and_price_html(heading, budget)
|
def heading_name_and_price_html(heading, budget)
|
||||||
content_tag :div do
|
content_tag :div do
|
||||||
concat(heading.name + ' ')
|
concat(heading.name + ' ')
|
||||||
|
|||||||
@@ -89,15 +89,20 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
<% show_links = show_links_to_budget_investments(current_budget) %>
|
||||||
|
<% if show_links %>
|
||||||
<%= link_to budget_investments_path(current_budget.id) do %>
|
<%= link_to budget_investments_path(current_budget.id) do %>
|
||||||
<small><%= t("budgets.index.investment_proyects") %></small>
|
<small><%= t("budgets.index.investment_proyects") %></small>
|
||||||
<% end %><br>
|
<% end %><br>
|
||||||
|
<% end %>
|
||||||
<%= link_to budget_investments_path(budget_id: current_budget.id, filter: 'unfeasible') do %>
|
<%= link_to budget_investments_path(budget_id: current_budget.id, filter: 'unfeasible') do %>
|
||||||
<small><%= t("budgets.index.unfeasible_investment_proyects") %></small>
|
<small><%= t("budgets.index.unfeasible_investment_proyects") %></small>
|
||||||
<% end %><br>
|
<% end %><br>
|
||||||
|
<% if show_links %>
|
||||||
<%= link_to budget_investments_path(budget_id: current_budget.id, filter: 'unselected') do %>
|
<%= link_to budget_investments_path(budget_id: current_budget.id, filter: 'unselected') do %>
|
||||||
<small><%= t("budgets.index.not_selected_investment_proyects") %></small>
|
<small><%= t("budgets.index.not_selected_investment_proyects") %></small>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user