Files
nairobi/app/views/budgets/index.html.erb
2021-03-11 19:37:58 +01:00

117 lines
3.9 KiB
Plaintext

<%= render Shared::BannerComponent.new("budgets") %>
<% provide :title do %><%= t("budgets.index.title") %><% end %>
<% content_for :canonical do %>
<%= render "shared/canonical", href: budgets_url %>
<% end %>
<% if current_budget.present? %>
<div class="budget-header">
<div class="row">
<div class="small-12 column">
<h1><%= current_budget.name %></h1>
<div class="description">
<%= auto_link_already_sanitized_html wysiwyg(current_budget.description) %>
</div>
<p>
<%= link_to t("budgets.index.section_header.help"), "#section_help" %>
</p>
</div>
</div>
</div>
<%= render Budgets::SubheaderComponent.new(current_budget) %>
<%= render Budgets::PhasesComponent.new(current_budget) %>
<div id="budget_info" class="budget-info">
<div class="row margin-top">
<div class="small-12 column">
<div id="groups_and_headings" class="groups-and-headings">
<% current_budget.groups.each do |group| %>
<h2 id="<%= group.name.parameterize %>"><%= group.name %></h2>
<ul class="no-bullet" data-equalizer data-equalizer-on="medium">
<% group.headings.sort_by_name.each do |heading| %>
<li class="heading small-12 medium-4 large-2" data-equalizer-watch>
<% unless current_budget.informing? || current_budget.finished? %>
<%= link_to budget_investments_path(current_budget.id,
heading_id: heading.id) do %>
<%= heading_name_and_price_html(heading, current_budget) %>
<% end %>
<% else %>
<div class="heading-name">
<%= heading_name_and_price_html(heading, current_budget) %>
</div>
<% end %>
</li>
<% end %>
</ul>
<% end %>
</div>
<% unless current_budget.informing? %>
<div class="map inline">
<h3><%= t("budgets.index.map") %></h3>
<%= render_map(nil, "budgets", false, nil, @budgets_coordinates) %>
</div>
<ul class="no-bullet margin-top">
<% show_links = show_links_to_budget_investments(current_budget) %>
<% if show_links %>
<li>
<%= link_to budget_path(current_budget) do %>
<small><%= t("budgets.index.investment_proyects") %></small>
<% end %>
</li>
<% end %>
<li>
<%= link_to budget_path(current_budget, filter: "unfeasible") do %>
<small><%= t("budgets.index.unfeasible_investment_proyects") %></small>
<% end %>
</li>
<% if show_links %>
<li>
<%= link_to budget_path(current_budget, filter: "unselected") do %>
<small><%= t("budgets.index.not_selected_investment_proyects") %></small>
<% end %>
</li>
<% end %>
</ul>
<% end %>
</div>
</div>
<% if @finished_budgets.present? %>
<%= render "finished", budgets: @finished_budgets %>
<% end %>
</div>
<% else %>
<div class="budget-header margin-bottom">
<div class="row">
<div class="small-12 medium-9 column">
<h1><%= t("budgets.index.title") %></h1>
</div>
</div>
</div>
<div class="row">
<div class="small-12 column">
<div class="callout primary">
<%= t("budgets.index.empty_budgets") %>
</div>
</div>
</div>
<% end %>
<div class="row">
<div class="small-12 column">
<div id="section_help" class="margin" data-magellan-target="section_help">
<p class="lead">
<strong><%= t("budgets.index.section_footer.title") %></strong>
</p>
<p><%= t("budgets.index.section_footer.description") %></p>
</div>
</div>
</div>