discourse/app/assets/javascripts/admin/addon/components/themes-list.hbs

128 lines
3.8 KiB
Handlebars

<div class="themes-list-header">
<DButton
@action={{fn this.changeView this.THEMES}}
@label="admin.customize.theme.title"
class={{concat-class "themes-tab" "tab" (if this.themesTabActive "active")}}
/>
<DButton
@action={{fn this.changeView this.COMPONENTS}}
@label="admin.customize.theme.components"
@icon="puzzle-piece"
class={{concat-class
"components-tab"
"tab"
(if this.componentsTabActive "active")
}}
/>
</div>
<div class="themes-list-container">
{{#if this.showFilter}}
<div class="themes-list-filter themes-list-item">
<Input
class="filter-input"
placeholder={{i18n "admin.customize.theme.filter_placeholder"}}
autocomplete="off"
@type="search"
@value={{mut this.filterTerm}}
/>
{{d-icon "search"}}
</div>
{{/if}}
{{#if this.hasThemes}}
{{#if this.hasActiveThemes}}
{{#each this.activeThemes as |theme|}}
<ThemesListItem
@theme={{theme}}
@navigateToTheme={{action "navigateToTheme" theme}}
/>
{{/each}}
{{#if this.hasInactiveThemes}}
<div class="themes-list-item inactive-indicator">
<span class="empty">
<div class="info">
{{#if this.selectInactiveMode}}
<Input
@type="checkbox"
@checked={{(or
(eq this.allInactiveSelected true)
(eq this.someInactiveSelected true)
)}}
class="toggle-all-inactive"
indeterminate={{this.someInactiveSelected}}
{{on "click" this.toggleAllInactive}}
/>
{{else}}
<DButton
class="btn-flat select-inactive-mode"
@action={{this.toggleInactiveMode}}
>
{{d-icon "list"}}
</DButton>
{{/if}}
{{#if this.selectInactiveMode}}
<span class="select-inactive-mode-label">
{{i18n
"admin.customize.theme.selected"
count=this.selectedCount
}}
</span>
{{else if this.themesTabActive}}
<span class="header">
{{i18n "admin.customize.theme.inactive_themes"}}
</span>
{{else}}
<span class="header">
{{i18n "admin.customize.theme.inactive_components"}}
</span>
{{/if}}
{{#if this.selectInactiveMode}}
<a
href
{{on "click" this.toggleInactiveMode}}
class="cancel-select-inactive-mode"
>
{{i18n "admin.customize.theme.cancel"}}
</a>
<DButton
class="btn btn-delete"
@action={{this.deleteConfirmation}}
@disabled={{(eq this.selectedCount 0)}}
>
{{d-icon "trash-alt"}}
Delete
</DButton>
{{/if}}
</div>
</span>
</div>
{{/if}}
{{/if}}
{{#if this.hasInactiveThemes}}
{{#each this.inactiveThemes as |theme|}}
<ThemesListItem
@classNames="inactive-theme"
@theme={{theme}}
@navigateToTheme={{action "navigateToTheme" theme}}
@selectInactiveMode={{this.selectInactiveMode}}
/>
{{/each}}
{{/if}}
{{else}}
<div class="themes-list-item">
<span class="empty">{{i18n "admin.customize.theme.empty"}}</span>
</div>
{{/if}}
</div>
<div class="create-actions">
<DButton
@action={{this.installModal}}
@icon="upload"
@label="admin.customize.install"
class="btn-primary"
/>
</div>