-
Notifications
You must be signed in to change notification settings - Fork 2
/
_process_header_steps.html.erb
37 lines (37 loc) · 1.74 KB
/
_process_header_steps.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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: 'button small button--sc' %>
<%= link_to(
cta_text,
step_cta_url(participatory_process),
class: "button small button--sc show-for-medium"
) %>
<% else %>
<%= link_to t(".view_steps"), decidim_participatory_processes.participatory_process_participatory_process_steps_path(current_participatory_space), class: 'button small button--sc' %>
<% end %>
</div>
</div>
<% end %>