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
This commit is contained in:
tshenry 2022-04-13 08:51:23 -07:00 committed by GitHub
parent f344d122f2
commit 77ad4248e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 21 deletions

View File

@ -30,10 +30,17 @@
&--cta {
margin-top: 2rem;
&__signup {
margin-bottom: 1rem;
}
&__login {
#cta-login-link {
background: transparent;
color: var(--primary-high);
}
}
}
}

View File

@ -2,18 +2,18 @@
<div class="custom-gated-topic-container">
<div class="custom-gated-topic-content">
<div class="custom-gated-topic-content--header">
{{theme-setting "heading_text"}}
{{theme-i18n "heading_text"}}
</div>
<p class="custom-gated-topic-content--text">
{{theme-setting "subheading_text"}}
{{theme-i18n "subheading_text"}}
</p>
<div class="custom-gated-topic-content--cta">
<div class="custom-gated-topic-content--cta__signup">
{{d-button action=(route-action "showCreateAccount") class="btn-primary btn-large sign-up-button" translatedLabel=(theme-setting "signup_cta_label")}}
{{d-button action=(route-action "showCreateAccount") class="btn-primary btn-large sign-up-button" translatedLabel=(theme-i18n "signup_cta_label")}}
</div>
<div class="custom-gated-topic-content--cta__login">
{{d-button action=(route-action "showLogin") id="login-link" class="btn btn-text login-button" translatedLabel=(theme-setting "login_cta_label")}}
{{d-button action=(route-action "showLogin") id="cta-login-link" class="btn btn-text login-button" translatedLabel=(theme-i18n "login_cta_label")}}
</div>
</div>
</div>

View File

@ -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"

View File

@ -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: ""