From 821c087871e65eb61f833f31c18c211d6faddadb Mon Sep 17 00:00:00 2001 From: Peter Zimon Date: Fri, 18 Jun 2021 16:57:52 +0200 Subject: [PATCH] Refined complimentary for multiple products (alpha) --- .../components/gh-member-settings-form-cp.hbs | 150 ++++++++++++------ ghost/admin/app/styles/layouts/members.css | 57 +++++-- ghost/admin/app/styles/layouts/products.css | 11 +- ghost/admin/app/styles/patterns/forms.css | 9 +- ghost/admin/public/assets/icons/dotdotdot.svg | 2 +- 5 files changed, 151 insertions(+), 78 deletions(-) diff --git a/ghost/admin/app/components/gh-member-settings-form-cp.hbs b/ghost/admin/app/components/gh-member-settings-form-cp.hbs index dd12711738..1bfedc69e2 100644 --- a/ghost/admin/app/components/gh-member-settings-form-cp.hbs +++ b/ghost/admin/app/components/gh-member-settings-form-cp.hbs @@ -135,71 +135,119 @@ {{/unless}} {{#each this.products as |product|}} -
-
+
+

{{product.name}} - {{#unless (eq product.subscriptions.length 1)}} + {{#if (gt product.subscriptions.length 1)}} {{product.subscriptions.length}} subscriptions - {{/unless}} + {{/if}}

+ {{#each product.subscriptions as |sub|}}
- {{sub.price.nickname}} - – - {{sub.price.currencySymbol}}{{sub.price.nonDecimalAmount}}/{{sub.price.interval}} - – - {{#if sub.cancel_at_period_end}} - Has access until {{sub.validUntil}} - Cancelled - {{else}} - Renews {{sub.validUntil}} - Active - {{/if}} -
- {{#if sub.cancellationReason}} -
Cancellation reason: {{sub.cancellationReason}}
- {{/if}} -
Created on {{sub.startDate}}
- - - - - {{svg-jar "dotdotdot"}} - - - - -
  • - - View Stripe customer - -
  • -
  • -
  • - - View Stripe subscription - -
  • -
  • +
    + {{sub.price.nickname}} + – {{#if sub.cancel_at_period_end}} - + Has access until {{sub.validUntil}} + Cancelled {{else}} - + Renews {{sub.validUntil}} + Active {{/if}} -
  • -
    -
    +
    + {{#if sub.cancellationReason}} +
    Cancellation reason: {{sub.cancellationReason}}
    + {{/if}} +
    Created on {{sub.startDate}}
    +
    + +
    +
    +
    + {{sub.price.currencySymbol}} + {{sub.price.nonDecimalAmount}} +
    +
    {{if (eq sub.price.interval "year") "yearly" "monthly"}}
    +
    + + + + + {{svg-jar "dotdotdot"}} + + + + +
  • + + View Stripe customer + +
  • +
  • +
  • + + View Stripe subscription + +
  • +
  • + {{#if sub.cancel_at_period_end}} + + {{else}} + + {{/if}} +
  • +
    +
    +
    {{/each}} + + {{#if (and (feature "multipleProducts") (eq product.subscriptions.length 0))}} +
    +
    +
    + Complimentary + Active +
    +
    Created on
    +
    +
    +
    +
    + $ + 0 +
    +
    yearly
    +
    + + + + {{svg-jar "dotdotdot"}} + + + + +
  • + +
  • +
    +
    +
    +
    + {{/if}} + {{#if (not (feature "multipleProducts"))}} {{#if this.isAddComplimentaryAllowed}} -