Skip to content

Commit

Permalink
feat: Override process header steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentinchampenois committed Feb 28, 2024
1 parent e72dca3 commit eec38b4
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions app/views/layouts/decidim/_process_header_steps.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<% if participatory_process.steps.any? %>
<div class="columns mediumlarge-4">
<div class="process-header__phase">
<div class="process-header__progress">
<ol>
<% past_step = true %>
<% participatory_process.steps.each_with_index do |step, index| %>
<% if past_step %>
<li class="phase-item--past"><span></span></li>
<% else %>
<li><span></span></li>
<% end %>
<% past_step = false if step.active? %>
<% end %>
</ol>
<span class="phase-current"><%= t(".step", current: (participatory_process.active_step.position + 1), total: current_participatory_space.steps.count) %></span>
</div>
<div>
<span class="phase-title"><%= translated_attribute participatory_process.active_step.title %></span>
<span class="phase-date">
<%= participatory_space_helpers.step_dates participatory_process.active_step %>
</span>
</div>
<% cta_text = translated_attribute(participatory_process.active_step.cta_text) %>
<% if participatory_process.active_step.cta_path.present? && cta_text.present? %>
<%= link_to t(".view_steps"), decidim_participatory_processes.participatory_process_participatory_process_steps_path(current_participatory_space), class: "clear button secondary tiny" %>
<%= link_to(
cta_text,
step_cta_url(participatory_process),
class: "button small button--sc"
) %>
<% else %>
<%= link_to t(".view_steps"), decidim_participatory_processes.participatory_process_participatory_process_steps_path(current_participatory_space) %>
<% end %>
</div>
</div>
<% end %>

0 comments on commit eec38b4

Please sign in to comment.