2021-06-04 10:37:47 +03:00
|
|
|
|
<button class="close" href title="Close" {{action "closeModal"}} {{action (optional this.noop) on="mouseDown"}}>
|
|
|
|
|
{{svg-jar "close"}}
|
|
|
|
|
</button>
|
|
|
|
|
|
2021-09-02 17:01:25 +03:00
|
|
|
|
<div class="gh-product-modal-content">
|
|
|
|
|
<header class="modal-header" data-test-modal="webhook-form">
|
|
|
|
|
<h1 data-test-text="title">{{this.title}}</h1>
|
|
|
|
|
</header>
|
2021-06-04 10:37:47 +03:00
|
|
|
|
|
2021-09-02 17:01:25 +03:00
|
|
|
|
<form>
|
2022-01-19 04:19:51 +03:00
|
|
|
|
<div class="modal-body gh-form-edit-product">
|
|
|
|
|
<div class="gh-main-section columns-3">
|
|
|
|
|
<div class="gh-main-section-block span-2">
|
|
|
|
|
<h4 class="gh-main-section-header small bn">Basic</h4>
|
|
|
|
|
<div class="gh-main-section-content grey gh-product-priceform-block">
|
|
|
|
|
{{#if (not this.isFreeProduct)}}
|
|
|
|
|
<GhFormGroup @errors={{this.errors}} @property="name">
|
|
|
|
|
<label for="name" class="fw6">Name</label>
|
|
|
|
|
<GhTextInput
|
|
|
|
|
@value={{readonly this.product.name}}
|
|
|
|
|
@input={{action (mut this.product.name) value="target.value"}}
|
|
|
|
|
@name="name"
|
|
|
|
|
@placeholder="Bronze"
|
|
|
|
|
@id="name"
|
|
|
|
|
@class="gh-input" />
|
|
|
|
|
<GhErrorMessage @errors={{this.errors}} @property="name" />
|
|
|
|
|
</GhFormGroup>
|
|
|
|
|
{{/if}}
|
|
|
|
|
<GhFormGroup @errors={{this.errors}} @property="description">
|
|
|
|
|
<label for="description" class="fw6">Description</label>
|
2022-01-18 14:28:46 +03:00
|
|
|
|
{{#if (not this.isFreeProduct)}}
|
2022-01-17 21:53:43 +03:00
|
|
|
|
<GhTextInput
|
2022-01-18 14:28:46 +03:00
|
|
|
|
@value={{readonly this.product.description}}
|
|
|
|
|
@input={{action (mut this.product.description) value="target.value"}}
|
|
|
|
|
@name="description"
|
|
|
|
|
@placeholder="Full access to premium content"
|
|
|
|
|
@id="description"
|
2022-01-17 21:53:43 +03:00
|
|
|
|
@class="gh-input" />
|
2022-01-19 04:19:51 +03:00
|
|
|
|
{{else}}
|
|
|
|
|
<GhTextInput
|
|
|
|
|
@value={{readonly this.product.description}}
|
|
|
|
|
@input={{action (mut this.product.description) value="target.value"}}
|
|
|
|
|
@name="description"
|
2022-01-19 10:34:08 +03:00
|
|
|
|
@placeholder="Free preview of {{this.settings.title}}"
|
2022-01-19 04:19:51 +03:00
|
|
|
|
@id="description"
|
|
|
|
|
@class="gh-input" />
|
|
|
|
|
{{/if}}
|
|
|
|
|
<GhErrorMessage @errors={{this.errors}} @property="description" />
|
|
|
|
|
</GhFormGroup>
|
|
|
|
|
{{#if (not this.isFreeProduct)}}
|
|
|
|
|
<GhFormGroup @errors={{this.settings.errors}} @hasValidated={{this.settings.hasValidated}} @property="prices">
|
|
|
|
|
<div class="gh-settings-members-pricelabelcont">
|
|
|
|
|
<label for="monthlyPrice">Prices</label>
|
|
|
|
|
<span>–</span>
|
|
|
|
|
<div>
|
|
|
|
|
<span class="gh-setting-members-currency gh-select">
|
|
|
|
|
<div class="gh-setting-members-currencylabel">
|
|
|
|
|
<span>{{this.currency}}</span>
|
|
|
|
|
{{svg-jar "arrow-down-small"}}
|
|
|
|
|
</div>
|
|
|
|
|
<OneWaySelect
|
|
|
|
|
@value={{this.selectedCurrency}}
|
|
|
|
|
id="currency"
|
|
|
|
|
name="currency"
|
|
|
|
|
@options={{readonly this.allCurrencies}}
|
|
|
|
|
@optionValuePath="value"
|
|
|
|
|
@optionLabelPath="label"
|
|
|
|
|
@update={{action "setCurrency"}}
|
|
|
|
|
/>
|
|
|
|
|
</span>
|
2022-01-17 21:53:43 +03:00
|
|
|
|
</div>
|
2022-01-19 04:19:51 +03:00
|
|
|
|
</div>
|
|
|
|
|
<div class="gh-setting-members-prices">
|
2021-09-02 17:01:25 +03:00
|
|
|
|
|
2022-01-19 04:19:51 +03:00
|
|
|
|
<div class="gh-input-group">
|
|
|
|
|
<GhTextInput
|
|
|
|
|
@id="monthlyPrice"
|
|
|
|
|
@value={{readonly this.stripeMonthlyAmount}}
|
|
|
|
|
@type="number"
|
|
|
|
|
@input={{action (mut this.stripeMonthlyAmount) value="target.value"}}
|
|
|
|
|
@focus-out={{action "validateStripePlans"}}
|
|
|
|
|
/>
|
|
|
|
|
<span class="gh-input-append"><span class="ttu">{{this.currency}}</span>/month</span>
|
2022-01-17 21:53:43 +03:00
|
|
|
|
</div>
|
2022-01-19 04:19:51 +03:00
|
|
|
|
<div class="gh-input-group">
|
|
|
|
|
<GhTextInput
|
|
|
|
|
@id="yearlyPrice"
|
|
|
|
|
@value={{readonly this.stripeYearlyAmount}}
|
|
|
|
|
@type="number"
|
|
|
|
|
@input={{action (mut this.stripeYearlyAmount) value="target.value"}}
|
|
|
|
|
@focus-out={{this.validateStripePlans}}
|
|
|
|
|
@placeholder=''
|
|
|
|
|
data-test-title-input={{true}}
|
|
|
|
|
/>
|
|
|
|
|
<span class="gh-input-append"><span class="ttu">{{this.currency}}</span>/year</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{{#if this.stripePlanError}}
|
|
|
|
|
<p class="response w-100"><span class="red">{{this.stripePlanError}}</span></p>
|
|
|
|
|
{{/if}}
|
|
|
|
|
</GhFormGroup>
|
|
|
|
|
{{/if}}
|
|
|
|
|
</div>
|
2021-09-02 17:01:25 +03:00
|
|
|
|
|
2022-01-19 04:19:51 +03:00
|
|
|
|
<h4 class="gh-main-section-header small bn">Benefits</h4>
|
|
|
|
|
<div class="gh-main-section-content grey gh-product-form-benefits">
|
|
|
|
|
<div class="gh-product-benefits">
|
|
|
|
|
<form id="product-benefits" class="gh-blognav" novalidate="novalidate">
|
|
|
|
|
<SortableObjects
|
|
|
|
|
@sortableObjectList={{this.benefits}}
|
|
|
|
|
@useSwap={{false}}
|
|
|
|
|
@sortEndAction={{action "reorderItems"}}
|
|
|
|
|
>
|
|
|
|
|
{{#each this.benefits as |benefitItem index|}}
|
|
|
|
|
<DraggableObject @content={{benefitItem}} @dragHandle=".gh-blognav-grab" @isSortable={{true}}>
|
|
|
|
|
<GhBenefitItem
|
|
|
|
|
@benefitItem={{benefitItem}}
|
|
|
|
|
@id={{index}}
|
|
|
|
|
@addItem={{action "addBenefit"}}
|
|
|
|
|
@focusItem={{action "focusItem"}}
|
|
|
|
|
@deleteItem={{action "deleteBenefit"}}
|
|
|
|
|
@updateLabel={{action "updateLabel"}}
|
|
|
|
|
data-test-navitem={{index}} />
|
|
|
|
|
</DraggableObject>
|
|
|
|
|
{{/each}}
|
|
|
|
|
</SortableObjects>
|
|
|
|
|
<GhBenefitItem
|
2022-01-19 10:34:08 +03:00
|
|
|
|
@isFreeProduct={{this.isFreeProduct}}
|
2022-01-19 04:19:51 +03:00
|
|
|
|
@benefitItem={{this.newBenefit}}
|
|
|
|
|
@addItem={{action "addBenefit"}}
|
|
|
|
|
@deleteItem={{action "deleteBenefit"}}
|
|
|
|
|
@updateLabel={{action "updateLabel"}}
|
|
|
|
|
data-test-navitem="new" />
|
|
|
|
|
</form>
|
2021-06-04 15:27:33 +03:00
|
|
|
|
</div>
|
2021-09-02 17:01:25 +03:00
|
|
|
|
</div>
|
2022-01-19 04:19:51 +03:00
|
|
|
|
</div>
|
|
|
|
|
<div class="gh-main-section-block gh-product-form-tierpreview">
|
|
|
|
|
<div class="gh-product-form-tierpreview-content">
|
|
|
|
|
{{#if (not this.isFreeProduct)}}
|
2022-01-18 14:28:46 +03:00
|
|
|
|
<h4 class="gh-main-section-header small bn">Tier Preview</h4>
|
2022-01-19 04:19:51 +03:00
|
|
|
|
{{else}}
|
|
|
|
|
<h4 class="gh-main-section-header small bn">Free Membership Preview</h4>
|
|
|
|
|
{{/if}}
|
|
|
|
|
<div class="gh-main-section-content" style="border-color: {{this.settings.accentColor}}">
|
|
|
|
|
<span class="checkmark" style="background-color: {{this.settings.accentColor}}"></span>
|
2022-01-17 21:53:43 +03:00
|
|
|
|
|
2022-01-19 04:19:51 +03:00
|
|
|
|
{{#if this.product.name}}
|
|
|
|
|
<h4>{{this.product.name}}</h4>
|
|
|
|
|
{{else}}
|
|
|
|
|
<h4 class="placeholder">Bronze</h4>
|
|
|
|
|
{{/if}}
|
2021-09-02 17:01:25 +03:00
|
|
|
|
|
2022-01-19 04:19:51 +03:00
|
|
|
|
{{#if this.product.description}}
|
|
|
|
|
<p>{{this.product.description}}</p>
|
|
|
|
|
{{else}}
|
|
|
|
|
{{#if (not this.isFreeProduct)}}
|
2022-01-18 14:28:46 +03:00
|
|
|
|
<p class="placeholder">Full access to premium content</p>
|
|
|
|
|
{{else}}
|
2022-01-19 10:34:08 +03:00
|
|
|
|
<p class="placeholder">Free preview of {{this.settings.title}}</p>
|
2022-01-18 14:28:46 +03:00
|
|
|
|
{{/if}}
|
2022-01-19 04:19:51 +03:00
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
|
|
{{#if this.benefits}}
|
|
|
|
|
<ul>
|
|
|
|
|
{{#each this.benefits as |benefitItem index|}}
|
|
|
|
|
<li>{{svg-jar "check-2"}} <span>{{benefitItem.name}}</span></li>
|
|
|
|
|
{{/each}}
|
|
|
|
|
</ul>
|
|
|
|
|
{{else}}
|
|
|
|
|
<ul class="placeholder">
|
2022-01-18 14:28:46 +03:00
|
|
|
|
{{#if (not this.isFreeProduct)}}
|
2022-01-19 04:19:51 +03:00
|
|
|
|
<li>{{svg-jar "check-2"}} <span>Expert analysis</span></li>
|
|
|
|
|
{{else}}
|
|
|
|
|
<li>{{svg-jar "check-2"}} <span>Access to all public posts</span></li>
|
|
|
|
|
{{/if}}
|
|
|
|
|
</ul>
|
|
|
|
|
{{/if}}
|
|
|
|
|
<div class="price">
|
|
|
|
|
{{#if (not this.isFreeProduct)}}
|
|
|
|
|
{{#if this.stripeMonthlyAmount}}
|
|
|
|
|
<span class="monthly-price">
|
|
|
|
|
<span class="currency">{{currency-symbol this.currency}}</span>
|
|
|
|
|
{{format-number this.stripeMonthlyAmount}}
|
|
|
|
|
<span class="period">/month</span>
|
|
|
|
|
</span>
|
|
|
|
|
{{else}}
|
|
|
|
|
<span class="monthly-price placeholder">
|
|
|
|
|
<span class="currency">{{currency-symbol this.currency}}</span>
|
|
|
|
|
0
|
|
|
|
|
<span class="period">/month</span>
|
|
|
|
|
</span>
|
|
|
|
|
{{/if}}
|
2021-09-02 17:01:25 +03:00
|
|
|
|
|
2022-01-19 04:19:51 +03:00
|
|
|
|
{{#if this.stripeYearlyAmount}}
|
|
|
|
|
<span class="yearly-price">{{currency-symbol this.currency}}{{format-number this.stripeYearlyAmount}}/year</span>
|
2022-01-17 21:53:43 +03:00
|
|
|
|
{{else}}
|
2022-01-19 04:19:51 +03:00
|
|
|
|
<span class="yearly-price placeholder">0<span class="currency">{{this.currency}}</span>/year</span>
|
2022-01-17 21:53:43 +03:00
|
|
|
|
{{/if}}
|
2022-01-19 04:19:51 +03:00
|
|
|
|
{{else}}
|
|
|
|
|
<span class="monthly-price">
|
|
|
|
|
<span class="currency">{{currency-symbol this.currency}}</span>
|
|
|
|
|
0
|
|
|
|
|
</span>
|
|
|
|
|
{{/if}}
|
2021-09-02 17:01:25 +03:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2021-06-04 15:27:33 +03:00
|
|
|
|
</div>
|
2021-06-18 11:51:06 +03:00
|
|
|
|
</div>
|
2021-06-04 10:37:47 +03:00
|
|
|
|
</div>
|
2022-01-19 04:19:51 +03:00
|
|
|
|
</div>
|
2021-09-02 17:01:25 +03:00
|
|
|
|
</form>
|
2021-06-04 10:37:47 +03:00
|
|
|
|
</div>
|
|
|
|
|
|
2021-09-02 17:01:25 +03:00
|
|
|
|
<div class="modal-footer top-shadow items-center">
|
2021-09-02 23:37:14 +03:00
|
|
|
|
<button
|
|
|
|
|
class="gh-btn"
|
|
|
|
|
{{action "closeModal"}}
|
|
|
|
|
{{!-- disable mouseDown so it doesn't trigger focus-out validations --}}
|
|
|
|
|
{{action (optional this.noop) on="mouseDown"}}
|
|
|
|
|
data-test-button="cancel-webhook"
|
|
|
|
|
>
|
|
|
|
|
<span>Cancel</span>
|
|
|
|
|
</button>
|
|
|
|
|
<GhTaskButton @buttonText="{{if this.isExistingProduct "Save" "Add tier"}}"
|
|
|
|
|
@successText={{this.successText}}
|
|
|
|
|
@task={{this.saveProduct}}
|
|
|
|
|
@idleClass="gh-btn-primary"
|
|
|
|
|
@class="gh-btn {{if this.isExistingProduct "gh-btn-black" "gh-btn-green"}} gh-btn-icon"
|
|
|
|
|
data-test-button="save-product" />
|
2021-06-30 13:21:08 +03:00
|
|
|
|
</div>
|