mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 10:53:34 +03:00
10f83ebd45
refs https://github.com/TryGhost/Team/issues/910 - added `card-is-available` helper that handles the previous `card.developerExperiment` and the new `card.feature` options - updated `<KoenigMenuContent>` to use the `card-is-available` helper in the conditional when adding cards to the list Cards can be gated by feature when specifying them in `cards.js`, in the card definition object you can add `feature: 'flagName'` which will mean the card is only available when that feature is enabled.
31 lines
1.7 KiB
Handlebars
31 lines
1.7 KiB
Handlebars
{{#each @itemSections as |section sectionIndex|}}
|
|
{{#if section.items}}
|
|
{{#if (or (not section.developerExperiment) (enable-developer-experiments))}}
|
|
<div class="flex flex-column justify-center flex-shrink-0 {{unless (eq sectionIndex 0) "mt3 bt b--whitegrey"}} mb2 pl4 pr4 pt3 midlightgrey ttu f-supersmall fw5 tracked-3" style="min-width: calc(100% - 3.2rem);">
|
|
{{section.title}}
|
|
</div>
|
|
{{#each section.items as |item|}}
|
|
{{#if (card-is-available item)}}
|
|
<div
|
|
class="{{if (eq item @selectedItem) "kg-cardmenu-card-selected"}} {{kg-style "cardmenu-card"}}"
|
|
data-kg="cardmenu-card"
|
|
role="menuitem"
|
|
title="{{item.label}}"
|
|
{{on "click" (fn @itemClicked item)}}
|
|
{{did-update this.scrollIntoView (eq item @selectedItem)}}
|
|
>
|
|
<div class="{{kg-style "cardmenu-icon"}} {{item.iconClass}}" aria-hidden="true">{{svg-jar item.icon class="w7 h7"}}</div>
|
|
<div class="{{kg-style "cardmenu-text"}}">
|
|
<div class="{{kg-style "cardmenu-label"}}">{{item.label}}</div>
|
|
<div class="{{kg-style "cardmenu-desc"}}">{{item.desc}}</div>
|
|
</div>
|
|
{{#if item.deleteClicked}}
|
|
<span class="kg-cardmenu-action-icon" {{on "click" item.deleteClicked}}>{{svg-jar "trash"}}</span>
|
|
{{/if}}
|
|
</div>
|
|
{{/if}}
|
|
{{/each}}
|
|
{{/if}}
|
|
{{/if}}
|
|
{{/each}}
|