Skip to content

Commit

Permalink
Changed waiting time in stepper design to be more clear.
Browse files Browse the repository at this point in the history
  • Loading branch information
xpavle00 committed Jun 8, 2024
1 parent 0f38ac7 commit 8eacb90
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 8 additions & 0 deletions app/helpers/format_days_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@ def format_remaining_days_count(remaining_days)
"posledný deň"
end
end

def format_past_days_count(past_days)
if past_days == 1
"1 dňom"
else
"#{past_days} dňami"
end
end
end
8 changes: 2 additions & 6 deletions app/views/components/_timeline.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,10 @@
<% if step.waiting_time > 0 && user_step&.status == "waiting" && user_step&.submitted_at %>
<% remaining_time = user_step.remaining_time %>
<% if remaining_time < 0 %>
<strong class="govuk-tag govuk-tag--red">
<% elsif remaining_time < 5 %>
<strong class="govuk-tag govuk-tag--orange">
Lehota vypršala pred: <strong class="govuk-tag govuk-tag--red"><%= format_past_days_count(-1 * remaining_time) %></strong>
<% else %>
<strong class="govuk-tag govuk-tag--green">
Čakacia lehota: <strong class="govuk-tag govuk-tag--blue"><%= format_remaining_days_count(remaining_time) %></strong>
<% end %>
<%= remaining_time %>
</strong>
<% end %>
<% else %>
<%= link_to step.title, [@journey, step], class: 'sdn-timeline__link' %>
Expand Down

0 comments on commit 8eacb90

Please sign in to comment.