diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /app/helpers/users_helper.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) | |
download | gitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'app/helpers/users_helper.rb')
-rw-r--r-- | app/helpers/users_helper.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index c1bca6b4c41..f47937e6d57 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -84,7 +84,7 @@ module UsersHelper def user_badges_in_admin_section(user) [].tap do |badges| - badges << { text: s_('AdminUsers|Blocked'), variant: 'danger' } if user.blocked? + badges << blocked_user_badge(user) if user.blocked? badges << { text: s_('AdminUsers|Admin'), variant: 'success' } if user.admin? badges << { text: s_('AdminUsers|External'), variant: 'secondary' } if user.external? badges << { text: s_("AdminUsers|It's you!"), variant: nil } if current_user == user @@ -106,8 +106,19 @@ module UsersHelper end end + def can_force_email_confirmation?(user) + !user.confirmed? + end + private + def blocked_user_badge(user) + pending_approval_badge = { text: s_('AdminUsers|Pending approval'), variant: 'info' } + return pending_approval_badge if user.blocked_pending_approval? + + { text: s_('AdminUsers|Blocked'), variant: 'danger' } + end + def get_profile_tabs tabs = [] |