diff --git a/ghost/admin/app/components/gh-member-settings-form.hbs b/ghost/admin/app/components/gh-member-settings-form.hbs index 17f2b6742b..f16e5f9289 100644 --- a/ghost/admin/app/components/gh-member-settings-form.hbs +++ b/ghost/admin/app/components/gh-member-settings-form.hbs @@ -145,11 +145,19 @@
- {{sub.price.nickname}} + {{#if sub.trialUntil}} + Free Trial + {{else}} + {{sub.price.nickname}} + {{/if}} + – {{#if (eq sub.status "canceled")}} Ended {{sub.validUntil}} Cancelled + {{else if sub.trialUntil}} + Ends {{sub.trialUntil}} + Active {{else if sub.cancel_at_period_end}} Has access until {{sub.validUntil}} Cancelled diff --git a/ghost/admin/app/components/gh-member-settings-form.js b/ghost/admin/app/components/gh-member-settings-form.js index 4ffc670c24..266906d329 100644 --- a/ghost/admin/app/components/gh-member-settings-form.js +++ b/ghost/admin/app/components/gh-member-settings-form.js @@ -71,7 +71,7 @@ export default class extends Component { let subscriptionData = subscriptions.filter((sub) => { return !!sub.price; }).map((sub) => { - return { + const data = { ...sub, startDate: sub.start_date ? moment(sub.start_date).format('D MMM YYYY') : '-', validUntil: sub.current_period_end ? moment(sub.current_period_end).format('D MMM YYYY') : '-', @@ -83,6 +83,13 @@ export default class extends Component { }, isComplimentary: !sub.id }; + if (this.feature.get('freeTrial') && sub.trial_end_at) { + const inTrialMode = moment(sub.trial_end_at).isAfter(new Date(), 'day'); + if (inTrialMode) { + data.trialUntil = moment(sub.trial_end_at).format('D MMM YYYY'); + } + } + return data; }); return tiers.map((tier) => { let tierSubscriptions = subscriptionData.filter((subscription) => {