From e359d2cb323b107e020af32c3d9a3a603d43c5e4 Mon Sep 17 00:00:00 2001 From: Djordje Vlaisavljevic Date: Wed, 17 Aug 2022 12:55:24 +0200 Subject: [PATCH] Updated new/edit offer form design refs https://github.com/TryGhost/Team/issues/1811 --- ghost/admin/app/styles/layouts/main.css | 24 +++ ghost/admin/app/styles/layouts/offers.css | 146 +++++++++++++++- ghost/admin/app/templates/offer.hbs | 199 +++++++++++++--------- 3 files changed, 282 insertions(+), 87 deletions(-) diff --git a/ghost/admin/app/styles/layouts/main.css b/ghost/admin/app/styles/layouts/main.css index cb5e7997ff..3988057d38 100644 --- a/ghost/admin/app/styles/layouts/main.css +++ b/ghost/admin/app/styles/layouts/main.css @@ -1256,6 +1256,30 @@ grid-column: 1 / 4; } +.gh-main-section-header-with-info { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: -2px; +} + +.gh-main-section-header-info { + display: flex; + align-items: center; + line-height: 1; + text-transform: none; + letter-spacing: 0; + font-size: 1.25rem; + font-weight: 400; +} + +.gh-main-section-header-info svg { + height: 16px; + width: 16px; + margin-left: 8px; +} + + .gh-main-section-block { padding: 0; } diff --git a/ghost/admin/app/styles/layouts/offers.css b/ghost/admin/app/styles/layouts/offers.css index e248b5a4d9..20d132f8e2 100644 --- a/ghost/admin/app/styles/layouts/offers.css +++ b/ghost/admin/app/styles/layouts/offers.css @@ -142,6 +142,11 @@ max-width: unset; } +.gh-offer-discount { + width: 100%; + margin-left: 24px; +} + .gh-offer-duration { display: flex; } @@ -165,6 +170,11 @@ letter-spacing: 0; } +.gh-offer-trial-duration { + width: 100%; + margin-left: 24px; +} + .gh-offer-trial-duration .trial-duration::before { position: absolute; content: "days"; @@ -175,14 +185,63 @@ letter-spacing: 0; } - - .gh-offer-url .gh-input { background: var(--main-color-content-greybg); border-color: var(--lightgrey-l1); color: var(--midgrey); } +.gh-offer-type-container { + display: flex; + width: 100%; + border: 1px solid #dddedf; + background: #fff; + color: #394047; + border-radius: 3px; +} + +.gh-offer-tier-and-trial { + display: flex; +} + +.gh-select-product-cadence select { + text-overflow: ellipsis; + padding-right: 32px; +} + +.gh-offer-type-container .gh-radio { + width: 100%; + padding: 16px; + margin: 0; + align-items: center; +} + +.gh-offer-type-container .gh-radio:not(:first-child) { + border-left: 1px solid #F6F6F6; +} + +.gh-offer-type-container .gh-radio-button { + width: 18px; + height: 18px; +} + +.gh-offer-type-container .gh-radio.active .gh-radio-button:before { + content: ""; + position: absolute; + top: 4px; + left: 4px; + width: 9px; + height: 5px; + border: 2px solid #fff; + border-top: none; + border-right: none; + border-radius: 0px; + background: transparent; + opacity: 1; + transition: opacity .15s ease-in-out; + transform: rotate(-45deg); +} + /* Offers – Portal preview */ .gh-offer-portal-preview { display: flex; @@ -290,6 +349,35 @@ fill: var(--midgrey); } +@media (max-width: 1440px) { + .gh-offer-tier-and-trial, .gh-offer-duration { + flex-direction: column; + } + + .gh-offer-discount, .gh-offer-trial-duration, .gh-offer-duration .form-group:not(:first-of-type) { + margin-left: 0; + } + + .gh-offer-type-container { + flex-direction: column; + } + + .gh-offer-type-container .gh-radio:not(:first-child) { + border-left: none; + border-top: 1px solid #f6f6f6; + } + + .gh-offer-title-and-code { + grid-template-rows: 1fr 1fr; + grid-template-columns: none; + grid-column-gap: 0px; + } + + .gh-offer-duration .form-group { + margin-bottom: 1.6em; + } +} + @media (max-width: 1280px) { .gh-offer-portal-preview { display: none; @@ -320,6 +408,33 @@ .gh-offers-help-card p { font-size: 1.3rem; } + + .gh-offer-tier-and-trial, .gh-offer-duration { + flex-direction: row; + } + + .gh-offer-discount, .gh-offer-trial-duration, .gh-offer-duration .form-group:not(:first-of-type) { + margin-left: 24px; + } + + .gh-offer-type-container { + flex-direction: row; + } + + .gh-offer-type-container .gh-radio:not(:first-child) { + border-top: none; + border-left: 1px solid #f6f6f6; + } + + .gh-offer-title-and-code { + grid-template-columns: 1fr 1fr; + grid-template-rows: none; + grid-column-gap: 24px; + } + + .gh-offer-duration .form-group { + margin-bottom: 0; + } } @media (max-width: 1080px) { @@ -357,6 +472,33 @@ min-width: 200px; height: 120px; } + + .gh-offer-tier-and-trial, .gh-offer-duration { + flex-direction: column; + } + + .gh-offer-discount, .gh-offer-trial-duration, .gh-offer-duration .form-group:not(:first-of-type) { + margin-left: 0px; + } + + .gh-offer-type-container { + flex-direction: column; + } + + .gh-offer-type-container .gh-radio:not(:first-child) { + border-left: none; + border-top: 1px solid #f6f6f6; + } + + .gh-offer-title-and-code { + grid-template-rows: 1fr 1fr; + grid-template-columns: none; + grid-column-gap: 0px; + } + + .gh-offer-duration .form-group { + margin-bottom: 1.6em; + } } @media (max-width: 1000px) { diff --git a/ghost/admin/app/templates/offer.hbs b/ghost/admin/app/templates/offer.hbs index f05ad0a894..e3548158fc 100644 --- a/ghost/admin/app/templates/offer.hbs +++ b/ghost/admin/app/templates/offer.hbs @@ -41,113 +41,142 @@ -

- Discount information – Once saved, this cannot be changed. +

+ Discount information +
Once saved, this cannot be changed.{{svg-jar "info"}}

{{#if (feature 'freeTrial')}}
-
- - +
+
+
Free trial
+
Give free access for a limited time.
+
+
{{/if}} - - - - - {{svg-jar "arrow-down-small"}} - - - {{#if this.isTrialOffer}} -
- - -
- + + + + -
- - + {{svg-jar "arrow-down-small"}} +
-
- {{else}} -
- -
- -
- {{#if (eq this.offer.type 'fixed')}} - - {{else}} - - {{/if}} +
+ + +
+
-
- - - - {{svg-jar "arrow-down-small"}} +
+
+ {{else}} +
+ + + + + {{svg-jar "arrow-down-small"}} + + + +
+ +
+ +
+ {{#if (eq this.offer.type 'fixed')}} + + {{else}} + + {{/if}} +
+ + -
+
+ + + + {{svg-jar "arrow-down-small"}} + + + +
@@ -193,7 +222,7 @@

Portal settings

-
+