mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
Updated portal preview in tier modal
refs 9e43fa9332
- cleans up free trial logic in portal preview
This commit is contained in:
parent
e1984c8607
commit
800a2ee3d7
@ -219,12 +219,10 @@
|
||||
<span class="amount">0</span>
|
||||
</div>
|
||||
{{else}}
|
||||
{{#if (feature 'freeTrial')}}
|
||||
{{#if this.freeTrialEnabled}}
|
||||
{{#if this.isFreeTierEnabled}}
|
||||
<div class="gh-portal-tier-price">
|
||||
<span class="amount">{{ this.trialDays }} days free</span>
|
||||
<span class="amount">{{ this.tier.trialDays }} days free</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{#if this.stripeYearlyAmount}}
|
||||
{{#if (feature 'freeTrial')}}
|
||||
@ -274,16 +272,14 @@
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{#if (feature 'freeTrial')}}
|
||||
{{#if this.freeTrialEnabled}}
|
||||
<span class="after-trial-amount">Then
|
||||
{{#if (eq this.previewCadence "yearly")}}
|
||||
{{currency-symbol this.currency}}{{ format-number this.stripeYearlyAmount }}/year
|
||||
{{else}}
|
||||
{{currency-symbol this.currency}}{{ format-number this.stripeMonthlyAmount }}/month
|
||||
{{/if}}
|
||||
</span>
|
||||
{{#if this.isFreeTrialEnabled}}
|
||||
<span class="after-trial-amount">Then
|
||||
{{#if (eq this.previewCadence "yearly")}}
|
||||
{{currency-symbol this.currency}}{{ format-number this.stripeYearlyAmount }}/year
|
||||
{{else}}
|
||||
{{currency-symbol this.currency}}{{ format-number this.stripeMonthlyAmount }}/month
|
||||
{{/if}}
|
||||
</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
|
@ -21,6 +21,7 @@ const CURRENCIES = currencies.map((currency) => {
|
||||
// TODO: update modals to work fully with Glimmer components
|
||||
@classic
|
||||
export default class ModalTierPrice extends ModalBase {
|
||||
@service feature;
|
||||
@service settings;
|
||||
@service config;
|
||||
@tracked model;
|
||||
@ -61,6 +62,10 @@ export default class ModalTierPrice extends ModalBase {
|
||||
return CURRENCIES.findBy('value', this.currency);
|
||||
}
|
||||
|
||||
get isFreeTierEnabled() {
|
||||
return this.feature.get('freeTrial') && this.freeTrialEnabled && this.tier.get('trialDays') > 0;
|
||||
}
|
||||
|
||||
init() {
|
||||
super.init(...arguments);
|
||||
this.tier = this.model.tier;
|
||||
@ -82,7 +87,6 @@ export default class ModalTierPrice extends ModalBase {
|
||||
this.calculateDiscount();
|
||||
if (this.tier.get('trialDays')) {
|
||||
this.freeTrialEnabled = true;
|
||||
this.trialDays = this.tier.get('trialDays');
|
||||
}
|
||||
this.accentColorStyle = htmlSafe(`color: ${this.settings.get('accentColor')}`);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user