Ghost/ghost/admin/app/components/gh-membership-products-alpha.hbs

55 lines
2.0 KiB
Handlebars
Raw Normal View History

<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">
{{#if this.isEmptyList}}
<div class="gh-main-content-card gh-product-card-empty-state">
<p>You have no {{this.selectedType.value}} tiers.</p>
</div>
{{/if}}
2021-06-04 12:35:28 +03:00
{{#each this.products as |product productIdx|}}
<GhProductCard
@product={{product}}
@openEditProduct={{this.openEditProduct}}
@onUnarchive={{this.onUnarchive}}
@onArchive={{this.onArchive}}
/>
{{/each}}
{{#if (eq this.type "active" )}}
<div class="gh-product-cards-footer">
<button class="gh-btn gh-btn-link gh-btn-text gh-btn-icon gh-btn-add-product green" type="button" {{action "openNewProduct" this.product}}>
<span>{{svg-jar "add-stroke" class="stroke-green"}}Add tier</span>
</button>
</div>
{{/if}}
</div>
{{#if this.showProductModal}}
<GhFullscreenModal
@modal="product"
@model={{hash
product=this.productModel
}}
@confirm={{this.confirmProductSave}}
@close={{this.closeProductModal}}
@modifier="edit-product action wide" />
{{/if}}