shows fixed bar only in correct heading on voting phase

This commit is contained in:
Alberto Garcia Cabeza
2017-01-17 18:59:12 +01:00
parent c5c686ec74
commit 86360a8719

View File

@@ -21,31 +21,32 @@
<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) %>
<% 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 class="progress-bar-nav" data-fixed-bar>
<h1><%= @heading.name %></h1>
<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 %>
</div>
<% else %>
<h2><%= @budget.formatted_heading_price(@heading) %></h2>
<h1><%= @heading.name %></h1>
<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 %>
</div>
<% else %>
<h1 class="margin-top"><%= @heading.name %></h1>
<h2><%= @budget.formatted_heading_price(@heading) %></h2>
<% end %>
</div>
</div>
</div>