discourse/app/assets/javascripts/admin/addon/components/theme-upload-add.hbs
Jarek Radosz 1c87bb7fe9
DEV: Update DButton uses (#23333)
1. Use `this.` instead of `{{action}}` where applicable
2. Use `{{fn}}` instead of `@actionParam` where applicable
3. Use non-`@` versions of class/type/tabindex/aria-controls/aria-expanded
4. Remove `btn` class (it's added automatically to all DButtons)
5. Remove `type="button"` (it's the default)
6. Use `concat-class` helper
2023-08-31 11:49:35 +02:00

47 lines
1.2 KiB
Handlebars

<DModal
class="add-upload-modal"
@title={{i18n "admin.customize.theme.add_upload"}}
@closeModal={{@closeModal}}
@flash={{this.flash}}
>
<:body>
<div class="inputs">
<section class="field">
<input
{{on "change" this.updateName}}
type="file"
id="file-input"
accept="*"
/>
<label for="file-input">
{{i18n "admin.customize.theme.upload_file_tip"}}
</label>
</section>
<section class="field">
<label for="theme-variable-name">
{{i18n "admin.customize.theme.variable_name"}}
</label>
<Input id="theme-variable-name" @value={{this.name}} />
</section>
{{#if this.fileSelected}}
{{#if this.errorMessage}}
<span class="alert alert-error">{{this.errorMessage}}</span>
{{/if}}
{{/if}}
</div>
</:body>
<:footer>
<DButton
@action={{this.upload}}
@disabled={{this.disabled}}
@icon="upload"
@label="admin.customize.theme.upload"
class="btn-primary"
/>
<DButton
@action={{@closeModal}}
@label="cancel"
class="btn-flat d-modal-cancel"
/>
</:footer>
</DModal>