From 2dd30804b62f750c2780b7043318cbe00d137429 Mon Sep 17 00:00:00 2001
From: Eugen Rochko <eugen@zeonfederated.com>
Date: Sat, 26 Mar 2022 02:53:13 +0100
Subject: [PATCH] Change how unconfirmed accounts are displayed in admin UI
(#17874)
Fix #17815
---
app/models/account.rb | 2 +-
app/models/user.rb | 6 +++++-
app/views/admin/accounts/_account.html.haml | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/app/models/account.rb b/app/models/account.rb
index 1717f16055..a8c5df2089 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -128,13 +128,13 @@ class Account < ApplicationRecord
:approved?,
:pending?,
:disabled?,
+ :unconfirmed?,
:unconfirmed_or_pending?,
:role,
:admin?,
:moderator?,
:staff?,
:locale,
- :hides_network?,
:shows_application?,
to: :user,
prefix: true,
diff --git a/app/models/user.rb b/app/models/user.rb
index 146bdcd2a9..f2d9c49eb9 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -208,8 +208,12 @@ class User < ApplicationRecord
confirmed? && approved? && !disabled? && !account.suspended? && !account.memorial? && account.moved_to_account_id.nil?
end
+ def unconfirmed?
+ !confirmed?
+ end
+
def unconfirmed_or_pending?
- !(confirmed? && approved?)
+ unconfirmed? || pending?
end
def inactive_message
diff --git a/app/views/admin/accounts/_account.html.haml b/app/views/admin/accounts/_account.html.haml
index 2df91301ed..82dd8dfb2b 100644
--- a/app/views/admin/accounts/_account.html.haml
+++ b/app/views/admin/accounts/_account.html.haml
@@ -1,4 +1,4 @@
-.batch-table__row{ class: [!account.suspended? && account.user_pending? && 'batch-table__row--attention', account.suspended? && 'batch-table__row--muted'] }
+.batch-table__row{ class: [!account.suspended? && account.user_pending? && 'batch-table__row--attention', (account.suspended? || account.user_unconfirmed?) && 'batch-table__row--muted'] }
%label.batch-table__row__select.batch-table__row__select--aligned.batch-checkbox
= f.check_box :account_ids, { multiple: true, include_hidden: false }, account.id
.batch-table__row__content.batch-table__row__content--unpadded
--
GitLab