<% content_for :canonical do %> <%= render "shared/canonical", href: budget_url(@budget, filter: @current_filter) %> <% end %>
<%= back_link_to budgets_path %>

<%= @budget.name %>

<%= safe_html_with_links @budget.description %>

<%= t('budgets.show.phase') %>

<%= t("budgets.phase.#{@budget.phase}") %>

<% if @budget.accepting? %> <% if current_user %> <% if current_user.level_two_or_three_verified? %> <%= link_to t("budgets.investments.index.sidebar.create"), new_budget_investment_path(@budget), class: "button margin-top expanded" %> <% else %>
<%= t("budgets.investments.index.sidebar.verified_only", verify: link_to(t("budgets.investments.index.sidebar.verify_account"), verification_path)).html_safe %>
<% end %> <% else %>
<%= t("budgets.investments.index.sidebar.not_logged_in", sign_in: link_to(t("budgets.investments.index.sidebar.sign_in"), new_user_session_path), sign_up: link_to(t("budgets.investments.index.sidebar.sign_up"), new_user_registration_path)).html_safe %>
<% end %> <% end %> <% if @budget.finished? %> <%= link_to t("budgets.show.see_results"), budget_results_path(@budget, heading_id: @budget.headings.first), class: "button margin-top expanded" %> <% end %>
<% if @current_filter == "unfeasible" %>

<%= t("budgets.show.unfeasible_title") %>

<% elsif @current_filter == "unselected" %>

<%= t("budgets.show.unselected_title") %>

<% end %> <% @budget.groups.each do |group| %> <% end %>
<%= t('budgets.show.group') %>
<% if group.headings.count == 1 %> <%= link_to group.name, budget_investments_path(@budget, heading_id: group.headings.first.id, filter: @current_filter), data: { no_turbolink: true } %> <% else %> <%= link_to group.name, budget_group_path(@budget, group, filter: @current_filter) %> <% end %>
<% if @budget.balloting_or_later? %> <% unless @current_filter == "unfeasible" %>
<%= link_to t("budgets.show.unfeasible"), budget_path(@budget, filter: "unfeasible") %>
<% end %> <% unless @current_filter == "unselected" %>
<%= link_to t("budgets.show.unselected"), budget_path(@budget, filter: "unselected") %>
<% end %> <% end %>