{{plugin-outlet name="admin-customize-themes-show-top" args=(hash theme=model)}}
{{#if editingName}}
{{text-field value=model.name autofocus="true"}}
{{d-button action=(action "finishedEditingName") class="btn-primary btn-small submit-edit" icon="check"}}
{{d-button action=(action "cancelEditingName") class="btn-small cancel-edit" icon="times"}}
{{else}}
{{model.name}}
{{d-button
action=(action "startEditingName")
icon="pencil-alt"
class="btn-small"
}}
{{/if}}
{{#each model.errors as |error|}}
{{error}}
{{/each}}
{{#unless model.supported}}
{{i18n "admin.customize.theme.required_version.error"}}
{{#if model.remote_theme.minimum_discourse_version}}
{{i18n "admin.customize.theme.required_version.minimum" version=model.remote_theme.minimum_discourse_version}}
{{/if}}
{{#if model.remote_theme.maximum_discourse_version}}
{{i18n "admin.customize.theme.required_version.maximum" version=model.remote_theme.maximum_discourse_version}}
{{/if}}
{{/unless}}
{{#unless model.enabled}}
{{#if model.disabled_by}}
{{i18n "admin.customize.theme.disabled_by"}}
{{#user-link user=model.disabled_by}}
{{avatar model.disabled_by imageSize="tiny"}}
{{model.disabled_by.username}}
{{/user-link}}
{{format-date model.disabled_at leaveAgo="true"}}
{{else}}
{{i18n "admin.customize.theme.disabled"}}
{{/if}}
{{d-button
class="btn-default"
action=(action "enableComponent")
icon="check"
label="admin.customize.theme.enable"}}
{{/unless}}
{{#if showCheckboxes}}
{{#unless model.component}}
{{inline-edit-checkbox action=(action "applyDefault") labelKey="admin.customize.theme.is_default" checked=model.default modelId=model.id}}
{{inline-edit-checkbox action=(action "applyUserSelectable") labelKey="admin.customize.theme.user_selectable" checked=model.user_selectable modelId=model.id}}
{{/unless}}
{{#if model.remote_theme}}
{{inline-edit-checkbox action=(action "applyAutoUpdateable") labelKey="admin.customize.theme.auto_update" checked=model.auto_update modelId=model.id}}
{{/if}}
{{/if}}
{{#unless model.component}}
{{#d-section class="form-horizontal theme settings control-unit"}}
{{i18n "admin.customize.theme.color_scheme"}}
{{color-palettes
content=colorSchemes
filterable=true
forceEscape=true
value=colorSchemeId
icon="paint-brush"}}
{{i18n "admin.customize.theme.color_scheme_select"}}
{{#if colorSchemeChanged}}
{{d-button action=(action "changeScheme") class="ok submit-edit" icon="check"}}
{{d-button action=(action "cancelChangeScheme") class="cancel cancel-edit" icon="times"}}
{{/if}}
{{/d-section}}
{{/unless}}
{{#if parentThemes}}
{{i18n "admin.customize.theme.component_of"}}
{{#each parentThemes as |theme|}}
- {{#link-to "adminCustomizeThemes.show" theme replace=true}}{{theme.name}}{{/link-to}}
{{/each}}
{{/if}}
{{#if model.component}}
{{#d-section class="form-horizontal theme settings control-unit"}}
{{theme-setting-relatives-selector setting=relativesSelectorSettingsForComponent model=model class="theme-setting"}}
{{/d-section}}
{{else}}
{{#d-section class="form-horizontal theme settings control-unit"}}
{{theme-setting-relatives-selector setting=relativesSelectorSettingsForTheme model=model class="theme-setting"}}
{{/d-section}}
{{/if}}
{{#unless model.remote_theme.is_git}}
{{i18n "admin.customize.theme.css_html"}}
{{#if model.hasEditedFields}}
{{i18n "admin.customize.theme.custom_sections"}}
{{#each editedFieldsFormatted as |field|}}
- {{field}}
{{/each}}
{{else}}
{{i18n "admin.customize.theme.edit_css_html_help"}}
{{/if}}
{{d-button
class="btn-default edit"
action=(action "editTheme")
label="admin.customize.theme.edit_css_html"}}
{{i18n "admin.customize.theme.uploads"}}
{{#if model.uploads}}
{{#each model.uploads as |upload|}}
-
${{upload.name}}: {{upload.filename}}
{{d-button action=(action "removeUpload") actionParam=upload class="second btn-default btn-default cancel-edit" icon="times"}}
{{/each}}
{{else}}
{{i18n "admin.customize.theme.no_uploads"}}
{{/if}}
{{d-button action=(action "addUploadModal") class="btn-default" icon="plus" label="admin.customize.theme.add"}}
{{/unless}}
{{#if extraFiles.length}}
{{i18n "admin.customize.theme.extra_files"}}
{{#if model.remote_theme}}
{{i18n "admin.customize.theme.extra_files_remote"}}
{{else}}
{{i18n "admin.customize.theme.extra_files_upload"}}
{{/if}}
{{#each extraFiles as |extraFile|}}
- {{extraFile.name}}
{{/each}}
{{/if}}
{{#if hasSettings}}
{{i18n "admin.customize.theme.theme_settings"}}
{{#d-section class="form-horizontal theme settings control-unit"}}
{{#each settings as |setting|}}
{{theme-setting-editor setting=setting model=model class="theme-setting control-unit"}}
{{/each}}
{{/d-section}}
{{/if}}
{{#if hasTranslations}}
{{i18n "admin.customize.theme.theme_translations"}}
{{#d-section class="form-horizontal theme settings translations control-unit"}}
{{#each translations as |translation|}}
{{theme-translation translation=translation model=model class="theme-translation"}}
{{/each}}
{{/d-section}}
{{/if}}
{{d-icon "desktop"}}{{i18n "admin.customize.theme.preview"}}
{{d-icon "download"}} {{i18n "admin.export_json.button_text"}}
{{#if showConvert}}
{{d-button action=(action "switchType") label="admin.customize.theme.convert" icon=convertIcon class="btn-default btn-normal" title=convertTooltip}}
{{/if}}
{{#if model.component}}
{{#if model.enabled}}
{{d-button
class="btn-default"
action=(action "disableComponent")
icon="ban"
label="admin.customize.theme.disable"}}
{{else}}
{{d-button
class="btn-default"
action=(action "enableComponent")
icon="check"
label="admin.customize.theme.enable"}}
{{/if}}
{{/if}}
{{d-button action=(action "destroy") label="admin.customize.delete" icon="trash-alt" class="btn-danger"}}