diff --git a/ghost/admin/app/controllers/offer.js b/ghost/admin/app/controllers/offer.js index 3626142e0a..2850d57159 100644 --- a/ghost/admin/app/controllers/offer.js +++ b/ghost/admin/app/controllers/offer.js @@ -11,6 +11,21 @@ export default class MembersController extends Controller { @tracked cadences = []; @tracked products = []; @tracked selectedDiscountType = 'percentage'; + @tracked durations = [ + { + label: 'Forever', + duration: 'forever' + }, + { + label: 'Once', + duration: 'once' + }, + { + label: 'Multiple months', + duration: 'multiple-months' + } + ]; + @tracked selectedDuration = 'forever'; constructor() { super(...arguments); @@ -44,6 +59,11 @@ export default class MembersController extends Controller { this.selectedDiscountType = discountType; } + @action + setDuration(duration) { + this.selectedDuration = duration; + } + @action updateVisibility(tab) { this.tab = tab; diff --git a/ghost/admin/app/styles/layouts/offers.css b/ghost/admin/app/styles/layouts/offers.css index a040385b91..5ab1f864d5 100644 --- a/ghost/admin/app/styles/layouts/offers.css +++ b/ghost/admin/app/styles/layouts/offers.css @@ -73,6 +73,7 @@ grid-gap: 24px; white-space: nowrap; margin-top: -8px; + margin-bottom: 24px; } .gh-offer-type .gh-radio { @@ -114,6 +115,10 @@ padding-right: 28px; } +.gh-offer-form { + max-width: 680px; +} + .gh-offer-form textarea { max-width: unset; } @@ -122,6 +127,28 @@ max-width: unset; } +.gh-offer-duration { + display: flex; +} + +.gh-offer-duration .form-group { + position: relative; + margin-bottom: 0; +} + +.gh-offer-duration .form-group:not(:first-of-type) { + margin-left: 24px; +} + +.gh-offer-duration .duration-months::before { + position: absolute; + content: "months"; + bottom: 7px; + right: 12px; + color: var(--midgrey); + font-size: 1.5rem; +} + /* Offers – Portal preview */ .gh-offer-portal-preview { display: flex; diff --git a/ghost/admin/app/templates/offer.hbs b/ghost/admin/app/templates/offer.hbs index 7f98f94fdd..b711b0712f 100644 --- a/ghost/admin/app/templates/offer.hbs +++ b/ghost/admin/app/templates/offer.hbs @@ -88,6 +88,32 @@ +