Extract budget phases to a component

This commit is contained in:
Javi Martín
2021-02-17 15:00:34 +01:00
parent 4f4b2643a7
commit 46e80bf430
6 changed files with 69 additions and 61 deletions

View File

@@ -0,0 +1,13 @@
<ul class="no-bullet budget-phases">
<% budget.published_phases.each do |phase| %>
<li class="phase <%= "is-active" if phase == budget.current_phase %>">
<h3><%= t("budgets.phase.#{phase.kind}") %></h3>
<span>
<%= l(phase.starts_at.to_date, format: :long) if phase.starts_at.present? %>
-
<%= l(phase.ends_at.to_date - 1.day, format: :long) if phase.ends_at.present? %>
</span>
<p><%= auto_link_already_sanitized_html(wysiwyg(phase.summary)) %></p>
</li>
<% end %>
</ul>