discourse/app/assets/javascripts/wizard/addon/templates/components/wizard-step.hbs

81 lines
3.0 KiB
Handlebars

<div class="wizard-container__step-contents">
{{#if this.step.title}}
<h1 class="wizard-container__step-title">{{this.step.title}}</h1>
{{/if}}
<div class="wizard-container__step-container">
{{#if this.step.fields}}
<WizardStepForm @step={{this.step}}>
{{#if this.includeSidebar}}
<div class="wizard-container__sidebar">
{{#each this.step.fields as |field|}}
{{#if field.show_in_sidebar}}
<WizardField @field={{field}} @step={{this.step}} @wizard={{this.wizard}} />
{{/if}}
{{/each}}
</div>
{{/if}}
<div class="wizard-container__fields">
{{#each this.step.fields as |field|}}
{{#unless field.show_in_sidebar}}
<WizardField @field={{field}} @step={{this.step}} @wizard={{this.wizard}} />
{{/unless}}
{{/each}}
</div>
</WizardStepForm>
{{/if}}
{{#if (or this.bannerImage this.step.description)}}
<div class={{this.bannerAndDescriptionClass}}>
{{#if this.step.description}}
<p class="wizard-container__step-description">{{html-safe this.step.description}}</p>
{{/if}}
{{#if this.bannerImage}}
<div class="wizard-container__step-banner-image">
{{#if (eq this.bannerImage "welcome-illustration")}}
<IllustrationWelcome />
{{else if (eq this.bannerImage "members-illustration")}}
<IllustrationMembers />
{{else if (eq this.bannerImage "finished-illustration")}}
<IllustrationFinished />
{{/if}}
</div>
{{/if}}
</div>
{{/if}}
</div>
</div>
<div class="wizard-container__step-footer">
<div class="wizard-container__buttons">
{{#if this.showNextButton}}
<button {{action "nextStep"}} disabled={{this.saving}} type="button" class="wizard-container__button primary {{this.nextButtonClass}}">
{{i18n this.nextButtonLabel}}
</button>
{{/if}}
{{#if this.showFinishButton}}
<button {{action "exitEarly"}} disabled={{this.saving}} type="button" class="wizard-container__button jump-in">
{{i18n "wizard.jump_in"}}
</button>
{{/if}}
{{#if this.showJumpInButton}}
<button {{action "quit"}} disabled={{this.saving}} type="button" class="wizard-container__button {{this.jumpInButtonClass}}">
{{i18n this.jumpInButtonLabel}}
</button>
{{/if}}
</div>
<div class="wizard-container__step-progress">
<a href {{action "backStep"}} class="wizard-container__link back {{unless this.showBackButton "inactive"}}">{{d-icon "chevron-left"}}</a>
<span class="wizard-container__step-text">{{bound-i18n "wizard.step-text"}}</span>
<span class="wizard-container__step-count">{{bound-i18n "wizard.step" current=this.step.displayIndex total=this.wizard.totalSteps}}</span>
<a href {{action "nextStep"}} class="wizard-container__link {{unless this.showNextButton "inactive"}}">{{d-icon "chevron-right"}}</a>
</div>
</div>