Extract budget phases to a component
This commit is contained in:
13
app/components/budgets/phases_component.html.erb
Normal file
13
app/components/budgets/phases_component.html.erb
Normal 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>
|
||||
Reference in New Issue
Block a user