Use budget published_phases's method to get them ordered, and decrease final date

This commit is contained in:
Bertocq
2018-01-18 17:15:21 +01:00
parent 7599eb4c35
commit 872e7ceb02

View File

@@ -1,15 +1,11 @@
<ul class="no-bullet budget-timeline"> <ul class="no-bullet budget-timeline">
<% @budget.phases.published.each do |phase| %> <% @budget.published_phases.each do |phase| %>
<li class="phase <%= 'active' if phase == @budget.current_phase %>"> <li class="phase <%= 'active' if phase == @budget.current_phase %>">
<h3><%= t("budgets.phase.#{phase.kind}") %></h3> <h3><%= t("budgets.phase.#{phase.kind}") %></h3>
<span> <span>
<% if phase.starts_at.to_date.present? %> <%= format_date(phase.starts_at) if phase.starts_at.present? %>
<%= format_date(phase.starts_at) %>
<% end %>
- -
<% if phase.ends_at.to_date.present? %> <%= format_date(phase.ends_at - 1.day) if phase.ends_at.present? %>
<%= format_date(phase.ends_at) %>
<% end %>
</span> </span>
<p><%= phase.summary %></p> <p><%= phase.summary %></p>
</li> </li>