0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Wired free trial offer UI in offers list

refs https://github.com/TryGhost/Team/issues/1726

- refines UI for a trial offer in offer list
This commit is contained in:
Rishabh 2022-08-10 16:02:34 +05:30 committed by Rishabh Garg
parent b8acc9ef19
commit 7130fc2833
2 changed files with 17 additions and 7 deletions

View file

@ -44,7 +44,11 @@ export default class MembersController extends Controller {
const price = offer.cadence === 'month' ? tier.monthlyPrice : tier.yearlyPrice; const price = offer.cadence === 'month' ? tier.monthlyPrice : tier.yearlyPrice;
offer.finalCurrency = offer.currency || tier.currency; offer.finalCurrency = offer.currency || tier.currency;
offer.originalPrice = price; offer.originalPrice = price;
offer.updatedPrice = offer.type === 'fixed' ? (price - offer.amount) : (price - ((price * offer.amount) / 100)); if (offer.type !== 'trial') {
offer.updatedPrice = offer.type === 'fixed' ? (price - offer.amount) : (price - ((price * offer.amount) / 100));
} else {
offer.updatedPrice = offer.originalPrice;
}
return offer; return offer;
}); });
} }

View file

@ -64,17 +64,23 @@
{{#if (feature 'freeTrial')}} {{#if (feature 'freeTrial')}}
{{#if (eq offer.type 'trial')}} {{#if (eq offer.type 'trial')}}
<span class="pink">{{svg-jar "offer"}}</span> <span class="pink">{{svg-jar "offer"}}</span>
<span class="pink fw6"><span class="ttu">21</span> DAYS FREE</span> <span class="pink fw6"><span class="ttu">{{offer.amount}}</span> DAYS FREE</span>
{{/if}} {{/if}}
{{/if}} {{/if}}
<span class="dib ml1 midgrey ttc">   {{#if (not (eq offer.type 'trial'))}}
{{if (eq offer.duration 'once') "First-payment" "Repeating"}} <span class="dib ml1 midgrey ttc">  
</span> {{if (eq offer.duration 'once') "First-payment" "Repeating"}}
</span>
{{/if}}
</span> </span>
</LinkTo> </LinkTo>
<LinkTo @route="offer" @model={{offer}} class="gh-list-data"> <LinkTo @route="offer" @model={{offer}} class="gh-list-data">
<span>{{currency-symbol offer.finalCurrency}}{{gh-price-amount offer.updatedPrice}}</span> {{#if (eq offer.type 'trial')}}
<span class="midgrey strike ml2">{{currency-symbol offer.finalCurrency}}{{gh-price-amount offer.originalPrice}}</span> <span>{{currency-symbol offer.finalCurrency}}{{gh-price-amount offer.originalPrice}}</span>
{{else}}
<span>{{currency-symbol offer.finalCurrency}}{{gh-price-amount offer.updatedPrice}}</span>
<span class="midgrey strike ml2">{{currency-symbol offer.finalCurrency}}{{gh-price-amount offer.originalPrice}}</span>
{{/if}}
</LinkTo> </LinkTo>
<LinkTo @route="offer" @model={{offer}} class="gh-list-data"> <LinkTo @route="offer" @model={{offer}} class="gh-list-data">
<span class="midgrey">{{offer.redemptionCount}}</span> <span class="midgrey">{{offer.redemptionCount}}</span>