diff --git a/app/helpers/budgets_helper.rb b/app/helpers/budgets_helper.rb index 4c73f52da..90e986dad 100644 --- a/app/helpers/budgets_helper.rb +++ b/app/helpers/budgets_helper.rb @@ -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 + ' ') diff --git a/app/views/budgets/index.html.erb b/app/views/budgets/index.html.erb index 810c505ae..dffa56e1d 100644 --- a/app/views/budgets/index.html.erb +++ b/app/views/budgets/index.html.erb @@ -89,14 +89,19 @@

- <%= link_to budget_investments_path(current_budget.id) do %> - <%= t("budgets.index.investment_proyects") %> - <% end %>
+ <% show_links = show_links_to_budget_investments(current_budget) %> + <% if show_links %> + <%= link_to budget_investments_path(current_budget.id) do %> + <%= t("budgets.index.investment_proyects") %> + <% end %>
+ <% end %> <%= link_to budget_investments_path(budget_id: current_budget.id, filter: 'unfeasible') do %> <%= t("budgets.index.unfeasible_investment_proyects") %> <% end %>
- <%= link_to budget_investments_path(budget_id: current_budget.id, filter: 'unselected') do %> - <%= t("budgets.index.not_selected_investment_proyects") %> + <% if show_links %> + <%= link_to budget_investments_path(budget_id: current_budget.id, filter: 'unselected') do %> + <%= t("budgets.index.not_selected_investment_proyects") %> + <% end %> <% end %>

<% end %>