Browse Source

feat: use status tags to show user active status

pull/2307/head
natdeanlewissoftwire 2 years ago
parent
commit
c18dc4725c
  1. 2
      app/views/users/_user_list.html.erb
  2. 8
      app/views/users/show.html.erb

2
app/views/users/_user_list.html.erb

@ -50,7 +50,7 @@
<% end %>
<% end %>
<% row.with_cell(text: simple_format(org_cell(user), {}, wrapper_tag: "div")) %>
<% row.with_cell(text: user.active? ? user.last_sign_in_at&.to_formatted_s(:govuk_date) : "Deactivated") %>
<% row.with_cell(text: user.active? ? user.last_sign_in_at&.to_formatted_s(:govuk_date) : status_tag(:deactivated)) %>
<%= govuk_link_to users_path(user) do %>
<span class="govuk-visually-hidden">User </span><%= user.id %>
<% end %>

8
app/views/users/show.html.erb

@ -112,6 +112,12 @@
row.with_action
end
end %>
<%= summary_list.with_row do |row|
row.with_key { "Status" }
row.with_value { status_tag(@user.active? ? :active : :deactivated) }
row.with_action
end %>
<% end %>
<div class="govuk-button-group">
@ -123,7 +129,7 @@
<% end %>
<% else %>
<span class="app-!-colour-muted govuk-!-margin-right-2">
This user has been deactivated. <%= govuk_button_link_to "Reactivate user", reactivate_user_path(@user) %>
<%= govuk_button_link_to "Reactivate user", reactivate_user_path(@user) %>
</span>
<% end %>
<% end %>

Loading…
Cancel
Save