discourse/app/assets/javascripts/wizard/addon/components/fields/image.hbs
David Taylor e4c373194d
DEV: Refactor Wizard components (#24770)
This commit refactors the Wizard component code in preparation for moving it to the 'static' directory for Embroider route-splitting. It also includes a number of general improvements and simplifications.

Extracted from https://github.com/discourse/discourse/pull/23678

Co-authored-by: Godfrey Chan <godfreykfc@gmail.com>
2023-12-07 16:33:38 +00:00

26 lines
505 B
Handlebars

<label
class="wizard-container__button wizard-container__button-upload
{{if this.uploading 'disabled'}}"
>
{{#if this.uploading}}
{{i18n "wizard.uploading"}}
{{else}}
{{i18n "wizard.upload"}}
{{/if}}
<input
class="wizard-hidden-upload-field"
disabled={{this.uploading}}
type="file"
accept="image/*"
/>
</label>
{{#if this.field.value}}
{{component
this.previewComponent
field=this.field
fieldClass=this.fieldClass
wizard=this.wizard
}}
{{/if}}