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">
<% @budget.phases.published.each do |phase| %>
<% @budget.published_phases.each do |phase| %>
<li class="phase <%= 'active' if phase == @budget.current_phase %>">
<h3><%= t("budgets.phase.#{phase.kind}") %></h3>
<span>
<% if phase.starts_at.to_date.present? %>
<%= format_date(phase.starts_at) %>
<% end %>
<%= format_date(phase.starts_at) if phase.starts_at.present? %>
-
<% if phase.ends_at.to_date.present? %>
<%= format_date(phase.ends_at) %>
<% end %>
<%= format_date(phase.ends_at - 1.day) if phase.ends_at.present? %>
</span>
<p><%= phase.summary %></p>
</li>