From 77ad4248e51034e1acd95a5a90f465e893f44ef1 Mon Sep 17 00:00:00 2001 From: tshenry Date: Wed, 13 Apr 2022 08:51:23 -0700 Subject: [PATCH] Use theme translations and fix login-link id (#5) * Use theme translations and fix login-link id Switches over to using theme translations instead of theme settings to manage the text content. This just adds a little extra flexibility for admins if they want to translate the text to other languages. It also replaces the `login-link` id with `cta-login-link` since the `login-link` id is already used in core. The relevant CSS is added along with it. * Run prettier --- common/common.scss | 9 ++++++++- .../components/topic-in-gated-category.hbs | 8 ++++---- locales/en.yml | 4 ++++ settings.yml | 16 ---------------- 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/common/common.scss b/common/common.scss index 79b2da5..c20926d 100644 --- a/common/common.scss +++ b/common/common.scss @@ -30,10 +30,17 @@ &--cta { margin-top: 2rem; - + &__signup { margin-bottom: 1rem; } + + &__login { + #cta-login-link { + background: transparent; + color: var(--primary-high); + } + } } } diff --git a/javascripts/discourse/templates/components/topic-in-gated-category.hbs b/javascripts/discourse/templates/components/topic-in-gated-category.hbs index 6b7882f..593b818 100644 --- a/javascripts/discourse/templates/components/topic-in-gated-category.hbs +++ b/javascripts/discourse/templates/components/topic-in-gated-category.hbs @@ -2,18 +2,18 @@
- {{theme-setting "heading_text"}} + {{theme-i18n "heading_text"}}

- {{theme-setting "subheading_text"}} + {{theme-i18n "subheading_text"}}

diff --git a/locales/en.yml b/locales/en.yml index 9e5eff5..a7adc2d 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -1,3 +1,7 @@ en: theme_metadata: description: "Categories with logged-in access only" + heading_text: "This area is for members only" + subheading_text: "Create an account to view this content" + signup_cta_label: "Sign Up" + login_cta_label: "Already have an account? Sign in" diff --git a/settings.yml b/settings.yml index 7e4527f..2fd1d03 100644 --- a/settings.yml +++ b/settings.yml @@ -3,19 +3,3 @@ enabled_categories: list_type: category default: "" description: "Choose which categories that users need to sign up for." -heading_text: - type: string - default: "This area is for members only" - description: "" -subheading_text: - type: string - default: "Create an account to view this content" - description: "" -signup_cta_label: - type: string - default: "Sign Up" - description: "" -login_cta_label: - type: string - default: "Already have an account? Sign in" - description: ""