2022-01-31 21:26:12 +03:00
|
|
|
<div class="flex justify-between items-center">
|
|
|
|
<label>Tiers</label>
|
|
|
|
<div>
|
|
|
|
<div class="gh-contentfilter-menu gh-contentfilter-type {{if (not (eq this.selectedType.value "active")) "gh-contentfilter-selected"}}" data-test-type-select="true">
|
|
|
|
<PowerSelect
|
|
|
|
@selected={{this.selectedType}}
|
|
|
|
@options={{this.availableTypes}}
|
|
|
|
@searchEnabled={{false}}
|
|
|
|
@onChange={{this.onTypeChange}}
|
|
|
|
@triggerComponent="gh-power-select/trigger"
|
|
|
|
@triggerClass="gh-contentfilter-menu-trigger gh-contentfilter-menu-trigger-tiers"
|
|
|
|
@dropdownClass="gh-contentfilter-menu-dropdown"
|
|
|
|
@matchTriggerWidth={{false}}
|
|
|
|
as |type|
|
|
|
|
>
|
|
|
|
{{#if type.name}}{{type.name}}{{else}}<span class="red">Unknown type</span>{{/if}}
|
|
|
|
</PowerSelect>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-06-04 12:35:28 +03:00
|
|
|
<div class="gh-product-cards">
|
2022-01-31 21:26:12 +03:00
|
|
|
{{#if this.isEmptyList}}
|
2022-02-04 16:50:34 +03:00
|
|
|
<div class="gh-main-content-card gh-product-card-empty-state">
|
|
|
|
<p>You have no {{this.selectedType.value}} tiers.</p>
|
2022-01-31 21:26:12 +03:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2021-06-04 12:35:28 +03:00
|
|
|
|
2022-03-09 10:53:49 +03:00
|
|
|
{{#each this.products as |product|}}
|
2022-01-31 21:26:12 +03:00
|
|
|
<GhProductCard
|
|
|
|
@product={{product}}
|
|
|
|
@openEditProduct={{this.openEditProduct}}
|
2022-02-02 13:51:21 +03:00
|
|
|
@onUnarchive={{this.onUnarchive}}
|
2022-03-09 10:35:07 +03:00
|
|
|
@onArchive={{this.onArchive}}
|
2022-01-31 21:26:12 +03:00
|
|
|
/>
|
|
|
|
{{/each}}
|
|
|
|
{{#if (eq this.type "active" )}}
|
|
|
|
<div class="gh-product-cards-footer">
|
2022-02-02 20:09:02 +03:00
|
|
|
<button class="gh-btn gh-btn-link gh-btn-text gh-btn-icon gh-btn-add-product green" type="button" {{action "openNewProduct" this.product}}>
|
2022-01-31 21:26:12 +03:00
|
|
|
<span>{{svg-jar "add-stroke" class="stroke-green"}}Add tier</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
2021-06-04 10:37:47 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
{{#if this.showProductModal}}
|
|
|
|
<GhFullscreenModal
|
|
|
|
@modal="product"
|
|
|
|
@model={{hash
|
|
|
|
product=this.productModel
|
|
|
|
}}
|
|
|
|
@confirm={{this.confirmProductSave}}
|
|
|
|
@close={{this.closeProductModal}}
|
2021-06-18 11:51:06 +03:00
|
|
|
@modifier="edit-product action wide" />
|
2021-06-21 11:36:17 +03:00
|
|
|
{{/if}}
|