Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV: Makes several changes, fixes, updates.... #22

Merged
merged 12 commits into from
Dec 16, 2023
21 changes: 11 additions & 10 deletions common/common.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.d-modal.gate {
// if custom gate enabled
&.custom-gate {
.modal-inner-container {
.d-modal__container {
background-color: #{$custom_gate_background_color};
}
.modal-footer {
color: #{$custom_gate_link_color};
a {
color: #{$custom_gate_link_color};
.d-modal__footer {
color: #{$custom_gate_footer_text_color};
.btn-transparent {
color: #{$custom_gate_link_color};
}
}
.custom-gate-content {
Expand All @@ -27,21 +27,22 @@
}
}
}
.modal-inner-container {
.d-modal__container {
background-color: var(--secondary);
}
.modal-header {
.d-modal__header {
border-bottom: none;
}
.modal-body {
.d-modal__body {
padding: 0 1em;
}
.modal-footer {
.d-modal__footer {
color: var(--primary-medium);
justify-content: #{$gate_footer_position};
a {
.btn-transparent {
color: var(--primary-medium);
outline: none;
padding: 0;
margin: 0 0.25em;
}
}
Expand Down
55 changes: 33 additions & 22 deletions javascripts/discourse/components/modal/guest-gate.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{{#if (theme-setting 'custom_gate_enabled')}}
<div class="custom-gate-content">
<img src="{{theme-setting 'custom_gate_image'}}"/>
<h2>{{theme-i18n "custom_gate.big_text"}}</h2>
<h2>{{html-safe (theme-i18n "custom_gate.big_text")}}</h2>
<p>{{html-safe (theme-i18n "custom_gate.little_text")}}</p>
</div>

Expand All @@ -22,8 +22,6 @@
<p>{{replace-emoji (i18n 'signup_cta.value_prop')}}</p>
</div>
{{/if}}

<LoginButtons @externalLogin={{action "externalLogin"}} />
</:body>

<:footer>
Expand All @@ -45,15 +43,20 @@
{{/if}}

{{else}}

<a href {{on "click" this.ssoLoginGate}}>
{{theme-i18n "guest_gate.sso_log_in"}}
</a>

<DButton
@class="btn-transparent"
@label={{theme-prefix "guest_gate.sso_log_in"}}
@action={{route-action "showLogin"}}
/>

{{#if (theme-setting 'enable_discourse_connect_signup')}}
{{theme-i18n "guest_gate.or"}}
<a href="{{theme-setting 'discourse_connect_signup_url'}}">
{{theme-i18n "guest_gate.sso_sign_up"}}
</a>
<DButton
@class="btn-transparent"
@label={{theme-prefix "guest_gate.sso_sign_up"}}
@href={{theme-setting "discourse_connect_signup_url"}}
/>
{{/if}}
{{/if}}

Expand Down Expand Up @@ -93,27 +96,35 @@
{{else}}

{{#if (theme-setting 'custom_url_enabled')}}
<a href="{{theme-setting 'custom_login_url'}}">
{{theme-i18n "guest_gate.log_in"}}
</a>
<DButton
@class="btn-transparent"
@label={{theme-prefix "guest_gate.log_in"}}
@href={{theme-setting "custom_login_url"}}
/>

{{theme-i18n "guest_gate.or"}}

<a href="{{theme-setting 'custom_signup_url'}}">
{{theme-i18n "guest_gate.sign_up"}}
</a>
<DButton
@class="btn-transparent"
@label={{theme-prefix "guest_gate.sign_up"}}
@href={{theme-setting "custom_signup_url"}}
/>

{{else}}

<a href {{on "click" this.showLoginGate}}>
{{theme-i18n "guest_gate.log_in"}}
</a>
<DButton
@class="btn-transparent"
@label={{theme-prefix "guest_gate.log_in"}}
@action={{route-action "showLogin"}}
/>

{{theme-i18n "guest_gate.or"}}

<a href {{on "click" this.showCreateAccountGate}}>
{{theme-i18n "guest_gate.sign_up"}}
</a>
<DButton
@class="btn-transparent"
@label={{theme-prefix "guest_gate.sign_up"}}
@action={{route-action "showCreateAccount"}}
/>
{{/if}}
{{/if}}
{{/if}}
Expand Down
51 changes: 0 additions & 51 deletions javascripts/discourse/components/modal/guest-gate.js

This file was deleted.

4 changes: 4 additions & 0 deletions settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ custom_gate_background_color:
type: string
default: "var(--secondary)"
description: "Change the modal background color."
custom_gate_footer_text_color:
type: string
default: "var(--primary-medium)"
description: "Change the footer text color. This applies if the use gate buttons setting is disabled and you have set up a custom gate."
custom_gate_link_color:
type: string
default: "var(--primary-medium)"
Expand Down