mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-02 08:13:34 +03:00
a47b61c1d4
refs https://github.com/TryGhost/Team/issues/1141 Showing canceled subscriptions provide a more complete picture of the activity of a member. - Given there is no `member.product` object when a subscription is canceled, use the `member.subscriptions.price.product` objects instead of `member.products`. - applied boy-scout rule for linter errors and and code formatting - removed `multipleTiers` flag conditionals as it's now GA - set up subscriptions as a separate mirage resource so they are easier to work with - updated `PUT /members/:id/` endpoint to match real API's complimentary subscription behaviour - modified mirage member serializer to match API output Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk> Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
67 lines
2.6 KiB
Handlebars
67 lines
2.6 KiB
Handlebars
<header class="modal-header" data-test-modal="member-product" {{did-insert this.setup}}>
|
|
<h1>Add subscription</h1>
|
|
</header>
|
|
<button type="button" class="close" title="Close" {{on "click" this.close}}>
|
|
{{svg-jar "close"}}<span class="hidden">Close</span>
|
|
</button>
|
|
|
|
<form>
|
|
<div class="modal-body">
|
|
<p class="gh-member-addcomp-subhed" data-test-text="select-tier-desc">
|
|
Select a tier for <strong>{{or this.member.name this.member.email}}</strong>'s
|
|
complimentary subscription.
|
|
</p>
|
|
{{#if this.activeSubscriptions.length}}
|
|
<p class="gh-member-addcomp-warning" data-test-text="sub-cancel-warning">
|
|
Adding a complimentary subscription cancels all existing subscriptions of this member.
|
|
</p>
|
|
{{/if}}
|
|
{{#if this.loadingProducts}}
|
|
<div class="flex justify-center flex-auto">
|
|
<div class="gh-loading-spinner"> </div>
|
|
</div>
|
|
{{else}}
|
|
<div class="form-rich-radio">
|
|
{{#each this.products as |product|}}
|
|
<div
|
|
class="gh-radio {{if (eq this.selectedProduct product.id) "active"}}"
|
|
{{on "click" (fn this.setProduct product.id)}}
|
|
data-test-tier-option={{product.id}}
|
|
>
|
|
<div class="gh-radio-content">
|
|
<div class="gh-radio-label">
|
|
<div class="description" data-test-text="tier-desc">
|
|
<h4>{{product.name}}</h4>
|
|
<p>{{product.description}}</p>
|
|
</div>
|
|
{{svg-jar "check" class="check"}}
|
|
</div>
|
|
</div>
|
|
<div class="gh-radio-button"></div>
|
|
</div>
|
|
{{/each}}
|
|
</div>
|
|
{{/if}}
|
|
</div>
|
|
</form>
|
|
|
|
<div class="modal-footer">
|
|
<button
|
|
class="gh-btn"
|
|
type="button"
|
|
{{on "click" this.close}}
|
|
{{!-- disable mouseDown so it does not trigger focus-out validations --}}
|
|
{{!-- template-lint-disable no-down-event-binding --}}
|
|
{{on "mousedown" (optional this.noop)}}
|
|
data-test-button="cancel-webhook"
|
|
>
|
|
<span>Cancel</span>
|
|
</button>
|
|
|
|
|
|
<GhTaskButton @buttonText="Add subscription"
|
|
@successText={{"Added"}}
|
|
@task={{this.addProduct}}
|
|
@class="gh-btn gh-btn-green gh-btn-icon gh-btn-add-memberproduct"
|
|
data-test-button="save-comp-product" />
|
|
</div> |