2021-10-04 16:00:41 +03:00
|
|
|
|
<section class="gh-canvas circle-bg">
|
2021-10-04 17:17:32 +03:00
|
|
|
|
<GhCanvasHeader class="gh-canvas-header">
|
2021-10-04 14:01:12 +03:00
|
|
|
|
<h2 class="gh-canvas-title" data-test-screen-title>
|
|
|
|
|
<LinkTo @route="offers" data-test-link="offers-back">Offers</LinkTo>
|
|
|
|
|
<span>{{svg-jar "arrow-right"}}</span>
|
2021-10-06 17:29:15 +03:00
|
|
|
|
{{#if this.offer.isNew}}
|
|
|
|
|
New Offer
|
|
|
|
|
{{else}}
|
|
|
|
|
{{this.offer.name}}
|
|
|
|
|
{{/if}}
|
2021-10-04 14:01:12 +03:00
|
|
|
|
</h2>
|
|
|
|
|
<section class="view-actions">
|
|
|
|
|
<GhTaskButton @class="gh-btn gh-btn-primary gh-btn-icon" @type="button" @task={{this.saveTask}} @data-test-button="save" />
|
|
|
|
|
</section>
|
|
|
|
|
</GhCanvasHeader>
|
|
|
|
|
|
|
|
|
|
<section class="view-container">
|
2021-10-04 16:00:41 +03:00
|
|
|
|
<div class="gh-main-layout content-preview">
|
|
|
|
|
<form>
|
|
|
|
|
<div class="gh-main-section gh-offer-form">
|
|
|
|
|
<div class="gh-main-section-block no-margin">
|
|
|
|
|
<h4 class="gh-main-section-header small bn">Basic</h4>
|
|
|
|
|
<div class="gh-main-section-content grey">
|
|
|
|
|
<GhFormGroup @errors={{this.errors}} @property="name">
|
|
|
|
|
<label for="name" class="fw6">Name</label>
|
|
|
|
|
<GhTextInput
|
|
|
|
|
@name="name"
|
|
|
|
|
@placeholder="Black Friday"
|
|
|
|
|
@id="name"
|
2021-10-06 17:29:15 +03:00
|
|
|
|
@value={{this.offer.name}}
|
|
|
|
|
@input={{this.setOfferName}}
|
2021-10-04 16:00:41 +03:00
|
|
|
|
@class="gh-input" />
|
|
|
|
|
<GhErrorMessage @errors={{this.errors}} @property="name" />
|
|
|
|
|
<p>Will be shown to members on the Stripe Checkout page</p>
|
|
|
|
|
</GhFormGroup>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<h4 class="gh-main-section-header small bn">Discount info</h4>
|
|
|
|
|
<div class="gh-main-section-content grey">
|
|
|
|
|
<GhFormGroup @errors={{this.errors}} @property="product-cadence">
|
2021-10-07 13:17:50 +03:00
|
|
|
|
<label for="product-cadence" class="fw6">Tier – cadence</label>
|
2021-10-04 16:00:41 +03:00
|
|
|
|
<span class="gh-select">
|
2021-10-06 17:29:15 +03:00
|
|
|
|
<OneWaySelect
|
|
|
|
|
@value={{this.cadence}}
|
2021-10-04 16:00:41 +03:00
|
|
|
|
@options={{this.cadences}}
|
|
|
|
|
@optionValuePath="name"
|
|
|
|
|
@optionLabelPath="label"
|
|
|
|
|
@optionTargetPath="name"
|
2021-10-06 17:29:15 +03:00
|
|
|
|
@update={{this.updateCadence}}
|
2021-10-04 16:00:41 +03:00
|
|
|
|
/>
|
|
|
|
|
{{svg-jar "arrow-down-small"}}
|
|
|
|
|
</span>
|
|
|
|
|
<GhErrorMessage @errors={{this.errors}} @property="product-cadence" />
|
|
|
|
|
</GhFormGroup>
|
2021-10-06 17:29:15 +03:00
|
|
|
|
{{#if (eq this.offer.type "percent")}}
|
2021-10-04 16:00:41 +03:00
|
|
|
|
<GhFormGroup @errors={{this.errors}} @property="amount">
|
|
|
|
|
<label for="amount" class="fw6">Percentage off</label>
|
2021-10-04 16:21:28 +03:00
|
|
|
|
<div class="gh-offer-value percentage">
|
|
|
|
|
<span class="unit">%</span>
|
|
|
|
|
<GhTextInput
|
|
|
|
|
@type="number"
|
|
|
|
|
@name="amount"
|
|
|
|
|
@placeholder=""
|
|
|
|
|
@id="amount"
|
2021-10-06 17:29:15 +03:00
|
|
|
|
@value={{this.offer.amount}}
|
|
|
|
|
@input={{this.setDiscountAmount}}
|
2021-10-04 16:21:28 +03:00
|
|
|
|
@class="gh-input" />
|
|
|
|
|
<GhErrorMessage @errors={{this.errors}} @property="amount" />
|
|
|
|
|
</div>
|
2021-10-04 16:00:41 +03:00
|
|
|
|
</GhFormGroup>
|
|
|
|
|
{{else}}
|
|
|
|
|
<GhFormGroup @errors={{this.errors}} @property="amount">
|
|
|
|
|
<label for="amount" class="fw6">Amount off</label>
|
2021-10-06 18:49:45 +03:00
|
|
|
|
<div class="gh-offer-value fixed {{if (eq this.currencyLength 3) "fullcurrency"}}">
|
|
|
|
|
<span class="unit">{{this.displayCurrency}}</span>
|
2021-10-04 16:21:28 +03:00
|
|
|
|
<GhTextInput
|
|
|
|
|
@name="amount"
|
|
|
|
|
@type="number"
|
|
|
|
|
@placeholder=""
|
2021-10-06 17:29:15 +03:00
|
|
|
|
@value={{this.offer.amount}}
|
|
|
|
|
@input={{this.setDiscountAmount}}
|
2021-10-04 16:21:28 +03:00
|
|
|
|
@id="amount"
|
|
|
|
|
@class="gh-input" />
|
|
|
|
|
<GhErrorMessage @errors={{this.errors}} @property="amount" />
|
|
|
|
|
</div>
|
2021-10-04 16:00:41 +03:00
|
|
|
|
</GhFormGroup>
|
|
|
|
|
{{/if}}
|
|
|
|
|
<div class="gh-offer-type">
|
2021-10-06 17:29:15 +03:00
|
|
|
|
<div class="gh-radio {{if (eq this.offer.type "percent") "active"}}" {{on "click" (fn this.setDiscountType "percent")}}>
|
2021-10-04 16:00:41 +03:00
|
|
|
|
<div class="gh-radio-button"></div>
|
|
|
|
|
<div class="gh-radio-content">
|
|
|
|
|
<div class="gh-radio-label">Percentage discount</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2021-10-06 17:29:15 +03:00
|
|
|
|
<div class="gh-radio {{if (eq this.offer.type "fixed") "active"}}" {{on "click" (fn this.setDiscountType "fixed")}}>
|
2021-10-04 16:00:41 +03:00
|
|
|
|
<div class="gh-radio-button"></div>
|
|
|
|
|
<div class="gh-radio-content">
|
|
|
|
|
<div class="gh-radio-label">Fixed amount discount</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2021-10-05 15:34:19 +03:00
|
|
|
|
<div class="gh-offer-duration">
|
|
|
|
|
<GhFormGroup @errors={{this.errors}} @property="duration">
|
|
|
|
|
<label for="product-cadence" class="fw6">Duration</label>
|
|
|
|
|
<span class="gh-select">
|
2021-10-06 17:29:15 +03:00
|
|
|
|
<OneWaySelect
|
|
|
|
|
@value={{this.offer.duration}}
|
2021-10-05 15:34:19 +03:00
|
|
|
|
@options={{this.durations}}
|
|
|
|
|
@optionValuePath="duration"
|
|
|
|
|
@optionLabelPath="label"
|
|
|
|
|
@optionTargetPath="duration"
|
2021-10-06 17:29:15 +03:00
|
|
|
|
@update = {{this.updateDuration}}
|
2021-10-05 15:34:19 +03:00
|
|
|
|
/>
|
|
|
|
|
{{svg-jar "arrow-down-small"}}
|
|
|
|
|
</span>
|
|
|
|
|
<GhErrorMessage @errors={{this.errors}} @property="duration" />
|
|
|
|
|
</GhFormGroup>
|
|
|
|
|
{{#if (eq this.selectedDuration "multiple-months")}}
|
|
|
|
|
<GhFormGroup @errors={{this.errors}} @property="duration-months" @class="duration-months">
|
2021-10-05 16:03:39 +03:00
|
|
|
|
<label for="duration-months" class="fw6">Number of months</label>
|
2021-10-05 15:34:19 +03:00
|
|
|
|
<GhTextInput
|
|
|
|
|
@name="duration-months"
|
2021-10-06 17:29:15 +03:00
|
|
|
|
@value={{this.offer.durationInMonths}}
|
|
|
|
|
@input={{this.setDurationInMonths}}
|
2021-10-05 15:34:19 +03:00
|
|
|
|
@id="duration-months"
|
|
|
|
|
@class="gh-input" />
|
|
|
|
|
<GhErrorMessage @errors={{this.errors}} @property="duration-months" />
|
|
|
|
|
</GhFormGroup>
|
|
|
|
|
{{/if}}
|
|
|
|
|
</div>
|
2021-10-04 16:00:41 +03:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<h4 class="gh-main-section-header small bn">Portal settings</h4>
|
|
|
|
|
<div class="gh-main-section-content grey">
|
|
|
|
|
<div class="form-col2">
|
|
|
|
|
<GhFormGroup @errors={{this.errors}} @property="display-title">
|
|
|
|
|
<label for="display-title" class="fw6">Display title</label>
|
|
|
|
|
<GhTextInput
|
|
|
|
|
@name="display-title"
|
2021-10-06 17:29:15 +03:00
|
|
|
|
@value={{this.offer.displayTitle}}
|
|
|
|
|
@input={{this.setPortalTitle}}
|
2021-10-04 16:00:41 +03:00
|
|
|
|
@placeholder="Black Friday Special"
|
|
|
|
|
@id="display-title"
|
|
|
|
|
@class="gh-input" />
|
|
|
|
|
<GhErrorMessage @errors={{this.errors}} @property="display-title" />
|
|
|
|
|
</GhFormGroup>
|
|
|
|
|
<GhFormGroup @errors={{this.errors}} @property="code">
|
|
|
|
|
<label for="code" class="fw6">Offer code</label>
|
|
|
|
|
<GhTextInput
|
|
|
|
|
@name="code"
|
|
|
|
|
@placeholder="black-friday"
|
2021-10-06 17:29:15 +03:00
|
|
|
|
@value={{this.offer.code}}
|
|
|
|
|
@input={{this.setOfferCode}}
|
2021-10-04 16:00:41 +03:00
|
|
|
|
@id="code"
|
|
|
|
|
@class="gh-input" />
|
|
|
|
|
<GhErrorMessage @errors={{this.errors}} @property="code" />
|
|
|
|
|
</GhFormGroup>
|
|
|
|
|
</div>
|
2021-10-05 16:03:39 +03:00
|
|
|
|
<GhFormGroup @errors={{this.errors}} @property="url" @class="gh-offer-url">
|
|
|
|
|
<label for="url" class="fw6">URL</label>
|
|
|
|
|
<div class="gh-input-group">
|
|
|
|
|
<GhTextInput
|
|
|
|
|
@name="url"
|
|
|
|
|
@value="https://example.com/black-friday"
|
|
|
|
|
@id="url"
|
|
|
|
|
@disabled="disabled"
|
|
|
|
|
@class="gh-input" />
|
|
|
|
|
|
|
|
|
|
<GhTaskButton
|
|
|
|
|
@buttonText="Copy link"
|
|
|
|
|
@task={{this.copyOfferUrl}}
|
|
|
|
|
@successText="Link copied"
|
|
|
|
|
@class="gh-btn gh-btn-icon" />
|
|
|
|
|
</div>
|
|
|
|
|
<GhErrorMessage @errors={{this.errors}} @property="url" />
|
|
|
|
|
</GhFormGroup>
|
2021-10-04 16:00:41 +03:00
|
|
|
|
<GhFormGroup @errors={{this.errors}} @property="description">
|
|
|
|
|
<label for="description" class="fw6">Description</label>
|
|
|
|
|
<GhTextarea
|
|
|
|
|
@id="description"
|
|
|
|
|
@name="description"
|
2021-10-06 17:29:15 +03:00
|
|
|
|
@value={{this.offer.displayDescription}}
|
|
|
|
|
@input={{this.setPortalDescription}}
|
2021-10-04 16:00:41 +03:00
|
|
|
|
@stopEnterKeyDownPropagation="true"
|
|
|
|
|
/>
|
|
|
|
|
<GhErrorMessage @errors={{this.errors}} @property="description" />
|
|
|
|
|
</GhFormGroup>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
2021-10-06 17:29:15 +03:00
|
|
|
|
|
2021-10-04 16:00:41 +03:00
|
|
|
|
<div class="gh-offer-portal-preview">
|
|
|
|
|
<div>
|
|
|
|
|
<h4 class="gh-main-section-header small bn">Preview</h4>
|
|
|
|
|
<div class="gh-offer-portal-preview-mock">Portal preview</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2021-10-07 13:16:23 +03:00
|
|
|
|
{{!-- <div class="gh-main-section">
|
2021-10-04 16:00:41 +03:00
|
|
|
|
<div class="gh-main-section-block">
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
class="gh-btn gh-btn-red gh-btn-icon"
|
|
|
|
|
>
|
2021-10-07 12:21:53 +03:00
|
|
|
|
<span>Archive offer</span>
|
2021-10-04 16:00:41 +03:00
|
|
|
|
</button>
|
|
|
|
|
</div>
|
2021-10-07 13:16:23 +03:00
|
|
|
|
</div> --}}
|
2021-10-04 14:01:12 +03:00
|
|
|
|
</section>
|
2021-10-06 17:29:15 +03:00
|
|
|
|
</section>
|