From 4f588a0569d0c286b2e5c65160653c8ac1162254 Mon Sep 17 00:00:00 2001 From: Kris Date: Wed, 3 Feb 2021 22:38:58 -0500 Subject: [PATCH] UX: fix button alignment on log-in required page (#11965) --- .../discourse/app/controllers/static.js | 3 ++- .../javascripts/discourse/app/templates/static.hbs | 14 +++++++++----- app/assets/stylesheets/common/base/faqs.scss | 9 ++++++++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/discourse/app/controllers/static.js b/app/assets/javascripts/discourse/app/controllers/static.js index 61f8008d159..b86a70cd546 100644 --- a/app/assets/javascripts/discourse/app/controllers/static.js +++ b/app/assets/javascripts/discourse/app/controllers/static.js @@ -1,13 +1,14 @@ import Controller, { inject as controller } from "@ember/controller"; import { ajax } from "discourse/lib/ajax"; import discourseComputed from "discourse-common/utils/decorators"; -import { equal } from "@ember/object/computed"; +import { equal, or } from "@ember/object/computed"; import { userPath } from "discourse/lib/url"; export default Controller.extend({ application: controller(), showLoginButton: equal("model.path", "login"), + anyButtons: or("showLoginButton", "showSignupButton"), @discourseComputed("model.path") bodyClass: (path) => `static-${path}`, diff --git a/app/assets/javascripts/discourse/app/templates/static.hbs b/app/assets/javascripts/discourse/app/templates/static.hbs index dbfe466381e..2584bcdfd17 100644 --- a/app/assets/javascripts/discourse/app/templates/static.hbs +++ b/app/assets/javascripts/discourse/app/templates/static.hbs @@ -8,12 +8,16 @@ {{plugin-outlet name="below-static" tagName=""}} - {{#if showSignupButton}} - {{d-button action=(route-action "showCreateAccount") class="btn-primary sign-up-button" label="sign_up"}} - {{/if}} + {{#if anyButtons}} +
+ {{#if showSignupButton}} + {{d-button action=(route-action "showCreateAccount") class="btn-primary sign-up-button" label="sign_up"}} + {{/if}} - {{#if showLoginButton}} - {{d-button action=(route-action "showLogin") class="btn-primary login-button" icon="user" label="log_in"}} + {{#if showLoginButton}} + {{d-button action=(route-action "showLogin") class="btn-primary login-button" icon="user" label="log_in"}} + {{/if}} +
{{/if}} {{/watch-read}} diff --git a/app/assets/stylesheets/common/base/faqs.scss b/app/assets/stylesheets/common/base/faqs.scss index 49de3c100eb..1af108d9122 100644 --- a/app/assets/stylesheets/common/base/faqs.scss +++ b/app/assets/stylesheets/common/base/faqs.scss @@ -1,5 +1,5 @@ .body-page { - /* intended only for /about /faq, /guidelines, /tos, and /privacy */ + /* covers /about, /faq, /guidelines, /tos, /privacy, and login-required */ width: 100%; max-width: 700px; .about-page & { @@ -28,3 +28,10 @@ margin-left: 40px; } } + +.body-page-button-container { + display: flex; + button { + margin-right: 0.75em; + } +}