Files
grecia/app/views/budgets/investments/_header.html.erb
2017-01-16 03:09:08 +01:00

59 lines
2.1 KiB
Plaintext

<% if @heading.present? %>
<section class="no-margin-top margin-bottom">
<div class="expanded jumbo-budget budget-heading padding">
<div class="row">
<div class="small-12 column">
<%= back_link_to budget_group_path(@budget, @heading.group, unfeasible: params[:unfeasible]) %>
<% if can? :show, @ballot %>
<%= link_to t("budgets.investments.header.check_ballot"),
budget_ballot_path(@budget),
class: "button float-right" %>
<% end %>
</div>
</div>
<div class="row progress-votes">
<div class="small-12 column">
<div class="progress-bar-nav" data-fixed-bar>
<h1 class="inline-block margin-top"><%= @heading.name %></h1>
<% if can? :show, @ballot %>
<div id="check-ballot" style="display: none;">
<%= link_to t("budgets.investments.header.check_ballot"),
budget_ballot_path(@budget) %>
</div>
<% if @ballot.valid_heading?(@heading) %>
<div id="progress_bar" class="no-margin-top">
<%= render 'budgets/ballot/progress_bar' %>
</div>
<% else %>
<br>
<p class="callout warning inline-block">
<%= t("budgets.investments.header.different_heading_assigned_html",
heading_link: link_to(
@assigned_heading.name,
budget_investments_path(@budget, heading: @assigned_heading))
) %>
</p>
<% end %>
<% else %>
<h2><%= @budget.formatted_heading_price(@heading) %></h2>
<% end %>
</div>
</div>
</div>
</div>
</section>
<% else %>
<div class="expanded jumbo-budget padding no-margin-top margin-bottom">
<div class="row">
<div class="small-12 column">
<%= back_link_to budget_path(@budget) %>
<h1><%= t('budgets.investments.index.title') %></h1>
</div>
</div>
</div>
<% end %>