From 541a15e3575725b1dd5bcd8830185af7f12d1de7 Mon Sep 17 00:00:00 2001 From: Joe <33972521+hnb-ku@users.noreply.github.com> Date: Mon, 1 Apr 2019 16:50:48 +0800 Subject: [PATCH] UX: user-card adjustments for users with hidden profiles (#7293) * adds styles for profile hidden message * Disable profile links for hidden profiles and add message to indicate the profile is hidden --- .../components/user-card-contents.hbs | 33 +++++++++++++++---- .../common/components/user-card.scss | 4 +++ 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/discourse/templates/components/user-card-contents.hbs b/app/assets/javascripts/discourse/templates/components/user-card-contents.hbs index d2b2e096c56..71f0adbf8cc 100644 --- a/app/assets/javascripts/discourse/templates/components/user-card-contents.hbs +++ b/app/assets/javascripts/discourse/templates/components/user-card-contents.hbs @@ -3,7 +3,11 @@
- {{bound-avatar user "huge"}} + {{#if user.profile_hidden}} + {{bound-avatar user "huge"}} + {{else}} + {{bound-avatar user "huge"}} + {{/if}} {{#if user.primary_group_name}} {{avatar-flair flairURL=user.primary_group_flair_url @@ -16,10 +20,17 @@

- + {{#if user.profile_hidden}} + + {{if nameFirst user.name (format-username username)}} + {{user-status user currentUser=currentUser}} + + {{else}} + + {{/if}}

{{plugin-outlet name="user-card-after-username" args=(hash user=user showUser=(action "showUser" user)) tagName=''}} {{#unless nameFirst}} @@ -82,6 +93,14 @@ tagName=""}}
+ {{#if user.profile_hidden}} +
+
+ {{i18n "user.profile_hidden"}} +
+
+ {{/if}} + {{#if isSuspendedOrHasBio}}
{{#if user.suspend_reason}} @@ -126,7 +145,7 @@
{{/if}} - {{#if user}} + {{#if user.time_read}}
{{#unless user.profile_hidden}} -{{/if}} +{{/if}} \ No newline at end of file diff --git a/app/assets/stylesheets/common/components/user-card.scss b/app/assets/stylesheets/common/components/user-card.scss index 27f5226a2c5..49af4a792ab 100644 --- a/app/assets/stylesheets/common/components/user-card.scss +++ b/app/assets/stylesheets/common/components/user-card.scss @@ -136,6 +136,10 @@ $avatar_margin: -50px; // negative margin makes avatars extend above cards font-weight: bold; } } + .profile-hidden { + font-size: $font-up-1; + margin-top: 0.5em; + } } // location and website .third-row {