show in manager when user blocked

This commit is contained in:
Christophe Robillard 2023-07-28 14:13:33 +02:00
parent d331c479e4
commit 2c4679e08b
3 changed files with 9 additions and 3 deletions

View file

@ -13,6 +13,8 @@ class UserDashboard < Administrate::BaseDashboard
confirmed?: Field::Boolean,
created_at: Field::DateTime,
updated_at: Field::DateTime,
blocked_at: Field::DateTime,
blocked_reason: Field::String,
current_sign_in_at: Field::DateTime,
dossiers: Field::HasMany
}.freeze
@ -36,7 +38,9 @@ class UserDashboard < Administrate::BaseDashboard
:email,
:confirmed?,
:current_sign_in_at,
:created_at
:created_at,
:blocked_at,
:blocked_reason
].freeze
# FORM_ATTRIBUTES

View file

@ -11,7 +11,8 @@
Usager
</dt>
<dd class="attribute-data attribute-data--meta-usager">
<%= link_to('Voir son compte utilisateur', manager_user_path(user)) %>
<% style = "background-color: red;color: white;" if user.blocked_at %>
<%= link_to('Voir son compte utilisateur', manager_user_path(user), style: style) %>
</dd>
</dl>

View file

@ -20,8 +20,9 @@ as well as a link to its edit page.
<% user = page.resource %>
<header class="main-content__header" role="banner">
<h1 class="main-content__page-title">
<h1 class="main-content__page-title" style="<%= "background-color: red;color: white;" if user.blocked_at %>">
<%= content_for(:title) %>
<%= "Bloqué" if user.blocked_at %>
</h1>
<div>