Merge pull request #9373 from demarches-simplifiees/show-blocked-user-in-manager

Avertit dans le manager si l'utilisateur est bloqué
This commit is contained in:
krichtof 2023-07-31 10:31:34 +00:00 committed by GitHub
commit 50e7090b9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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>