diff --git a/app/assets/javascripts/discourse/app/components/about-page-users.hbs b/app/assets/javascripts/discourse/app/components/about-page-users.hbs index ebf8c28367c..c3883485fc6 100644 --- a/app/assets/javascripts/discourse/app/components/about-page-users.hbs +++ b/app/assets/javascripts/discourse/app/components/about-page-users.hbs @@ -1,15 +1,16 @@ {{#each this.usersTemplates as |userTemplate|}} - -
+
+
- {{html-safe userTemplate.avatar}} -
@@ -27,6 +28,6 @@
{{userTemplate.title}}
-
- + + {{/each}} \ No newline at end of file diff --git a/app/assets/javascripts/discourse/app/components/about-page-users.js b/app/assets/javascripts/discourse/app/components/about-page-users.js index 1c1b109ae5d..3ef57cf10a2 100644 --- a/app/assets/javascripts/discourse/app/components/about-page-users.js +++ b/app/assets/javascripts/discourse/app/components/about-page-users.js @@ -5,6 +5,7 @@ import { renderAvatar } from "discourse/helpers/user-avatar"; import { userPath } from "discourse/lib/url"; export default Component.extend({ + tagName: "", usersTemplates: computed("users.[]", function () { return (this.users || []).map((user) => { const { name, username } = user; diff --git a/app/assets/javascripts/discourse/app/components/user-info.hbs b/app/assets/javascripts/discourse/app/components/user-info.hbs index bca19c789a2..0432aa97e05 100644 --- a/app/assets/javascripts/discourse/app/components/user-info.hbs +++ b/app/assets/javascripts/discourse/app/components/user-info.hbs @@ -1,63 +1,55 @@ -{{#if this.includeAvatar}} -
-
- {{avatar - @user - imageSize="large" - }} - -
-
-{{/if}} - -
-
- - {{#if this.includeLink}} - - {{if this.nameFirst @user.name (format-username @user.username)}} - - {{else}} - {{if this.nameFirst @user.name (format-username @user.username)}} - {{/if}} - - - {{#if this.includeLink}} - - {{if this.nameFirst (format-username @user.username) @user.name}} - - {{else}} - {{if this.nameFirst (format-username @user.username) @user.name}} - {{/if}} - - {{#if (and @showStatus @user.status)}} - - {{/if}} - - - -
-
{{@user.title}}
- - {{#if (has-block)}} -
- {{yield}} + + {{#if this.includeAvatar}} +
+
+ {{avatar @user imageSize="large"}} + +
{{/if}} +
+
+ + {{if this.nameFirst @user.name (format-username @user.username)}} + + + {{if this.nameFirst (format-username @user.username) @user.name}} + + {{#if (and @showStatus @user.status)}} + + {{/if}} + + + +
+
{{@user.title}}
+ {{#if (has-block)}} +
+ {{yield}} +
+ {{/if}} +
-
+ + + - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/assets/javascripts/discourse/app/templates/about.hbs b/app/assets/javascripts/discourse/app/templates/about.hbs index 3c8c86756e1..15ddc95a9ed 100644 --- a/app/assets/javascripts/discourse/app/templates/about.hbs +++ b/app/assets/javascripts/discourse/app/templates/about.hbs @@ -46,9 +46,9 @@ {{#if this.model.admins}}

{{d-icon "users"}} {{i18n "about.our_admins"}}

- - -
+
+ +
{{/if}} @@ -63,11 +63,9 @@ {{#if this.model.moderators}}

{{d-icon "users"}} {{i18n "about.our_moderators"}}

-
-
{{/if}} @@ -95,7 +93,6 @@ {{#if this.model.can_see_about_stats}}

{{d-icon "far-chart-bar"}} {{i18n "about.stats"}}

- diff --git a/app/assets/javascripts/discourse/tests/integration/components/user-info-test.js b/app/assets/javascripts/discourse/tests/integration/components/user-info-test.js index f44601c14bd..c0c0a2c4123 100644 --- a/app/assets/javascripts/discourse/tests/integration/components/user-info-test.js +++ b/app/assets/javascripts/discourse/tests/integration/components/user-info-test.js @@ -13,8 +13,8 @@ module("Integration | Component | user-info", function (hooks) { await render(hbs``); - assert.strictEqual(query(".name.bold").innerText.trim(), "Evil Trout"); - assert.strictEqual(query(".username.margin").innerText.trim(), "eviltrout"); + assert.strictEqual(query(".name").innerText.trim(), "Evil Trout"); + assert.strictEqual(query(".username").innerText.trim(), "eviltrout"); }); test("prioritized username", async function (assert) { @@ -23,8 +23,8 @@ module("Integration | Component | user-info", function (hooks) { await render(hbs``); - assert.strictEqual(query(".username.bold").innerText.trim(), "eviltrout"); - assert.strictEqual(query(".name.margin").innerText.trim(), "Evil Trout"); + assert.strictEqual(query(".username").innerText.trim(), "eviltrout"); + assert.strictEqual(query(".name").innerText.trim(), "Evil Trout"); }); test("includeLink", async function (assert) { @@ -33,10 +33,10 @@ module("Integration | Component | user-info", function (hooks) { ); this.set("includeLink", true); - assert.ok(exists(`.username a[href="/u/${this.currentUser.username}"]`)); + assert.ok(exists(`a[href="/u/${this.currentUser.username}"]`)); this.set("includeLink", false); - assert.notOk(exists(`.username a[href="/u/${this.currentUser.username}"]`)); + assert.notOk(exists(`a[href="/u/${this.currentUser.username}"]`)); }); test("includeAvatar", async function (assert) { diff --git a/app/assets/stylesheets/common/base/about.scss b/app/assets/stylesheets/common/base/about.scss index ee517804d50..4b19fc6d139 100644 --- a/app/assets/stylesheets/common/base/about.scss +++ b/app/assets/stylesheets/common/base/about.scss @@ -1,6 +1,12 @@ section.about { margin-bottom: 3em; + .users { + display: grid; + gap: 1em; + grid-template-columns: repeat(auto-fit, minmax(20em, 1fr)); + } + h3 { margin-bottom: 1em; display: flex; diff --git a/app/assets/stylesheets/common/base/directory.scss b/app/assets/stylesheets/common/base/directory.scss index 0b678e22a66..539f476b6f5 100644 --- a/app/assets/stylesheets/common/base/directory.scss +++ b/app/assets/stylesheets/common/base/directory.scss @@ -191,16 +191,11 @@ .user-info { display: flex; min-width: 0; - margin: 0; width: 100%; - .user-image { - padding-right: 0.5em; - margin-right: 0.5em; - } .user-detail { padding: 0; width: 100%; - @media screen and (max-width: 600px) { + @include breakpoint(tablet) { // overrides existing media query font-size: var(--font-0); } diff --git a/app/assets/stylesheets/common/components/user-info.scss b/app/assets/stylesheets/common/components/user-info.scss index f08d96df2c7..61fbf1bbc68 100644 --- a/app/assets/stylesheets/common/components/user-info.scss +++ b/app/assets/stylesheets/common/components/user-info.scss @@ -1,13 +1,9 @@ // Common styles for "user-info" component .user-info { - display: inline-block; - clear: both; - margin-bottom: 1em; - - .user-image { - float: left; - padding-right: 4px; - margin-right: 10px; + > a { + display: flex; + gap: 1em; + min-width: 0; } .user-image-inner { @@ -16,39 +12,39 @@ } .user-detail { - float: left; - width: 70%; - padding-left: 5px; - @media screen and (max-width: 600px) { + min-width: 0; + @include breakpoint(tablet) { font-size: var(--font-down-1); } .name-line { - @include ellipsis; + display: flex; + gap: 0.5em; color: var(--primary-high); + .name, + .username { + @include ellipsis; + } span:first-child { - color: var(--primary); + flex: 0 0 auto; + font-weight: bold; + } + } + + .details { + color: var(--primary); + .d-icon-reply { + color: var(--primary-medium); } } .title { - margin-top: 3px; + margin-top: 0.25em; color: var(--primary-medium); } } - &.small { - width: 333px; - @media screen and (max-width: $small-width) { - width: auto; - display: flex; - } - @media screen and (max-width: 600px) { - width: 100%; - } - } - &.medium { min-height: 60px;