1
0
Fork 0
discourse-custom-wizard-unl.../assets/javascripts/discourse/templates/admin-wizard.hbs
Angus McLeod 98f9215d65 various
2020-04-08 12:52:07 +10:00

190 Zeilen
5,5 KiB
Handlebars

<div class="admin-wizard settings">
<div class="wizard-header large">
{{input
name="name"
value=model.name
placeholderKey="admin.wizard.name_placeholder"}}
<div class="wizard-url">
{{#if model.name}}
<a href="{{wizardUrl}}" target="_blank">{{wizardUrl}}</a>
{{/if}}
</div>
</div>
<div class="wizard-basic-details">
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.background'}}</label>
</div>
<div class="setting-value">
{{input
name="background"
value=model.background
placeholderKey="admin.wizard.background_placeholder"
class="medium"}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.theme_id'}}</label>
</div>
<div class="setting-value">
{{combo-box
content=model.themes
valueProperty='id'
value=model.theme_id
onChange=(action (mut model.theme_id))
options=(hash
none='admin.wizard.no_theme'
)}}
</div>
</div>
</div>
<div class="wizard-header medium">
{{i18n 'admin.wizard.label'}}
</div>
<div class="wizard-settings">
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.required'}}</label>
</div>
<div class="setting-value">
{{input type='checkbox' checked=model.required}}
<span>{{i18n 'admin.wizard.required_label'}}</span>
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.after_signup'}}</label>
</div>
<div class="setting-value">
{{input type='checkbox' checked=model.after_signup}}
<span>{{i18n 'admin.wizard.after_signup_label'}}</span>
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.multiple_submissions'}}</label>
</div>
<div class="setting-value">
{{input type='checkbox' checked=model.multiple_submissions}}
<span>{{i18n 'admin.wizard.multiple_submissions_label'}}</span>
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.prompt_completion'}}</label>
</div>
<div class="setting-value">
{{input type='checkbox' checked=model.prompt_completion}}
<span>{{i18n 'admin.wizard.prompt_completion_label'}}</span>
</div>
</div>
<div class="setting full-inline">
<div class="setting-label">
<label>{{i18n 'admin.wizard.after_time'}}</label>
</div>
<div class="setting-value">
{{input type='checkbox' checked=model.after_time}}
<span>{{i18n 'admin.wizard.after_time_label'}}</span>
{{d-button
action='setNextSessionScheduled'
translatedLabel=nextSessionScheduledLabel
class="btn-after-time"
icon='far-calendar'}}
</div>
</div>
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.permitted'}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=model.permitted
options=(hash
context='wizard'
inputTypes='assignment,validation'
groupSelection='output'
userFieldSelection='key'
textSelection='value'
inputConnector='and'
)}}
</div>
</div>
{{wizard-advanced-toggle showAdvanced=model.showAdvanced}}
{{#if model.showAdvanced}}
<div class="advanced-settings">
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.save_submissions'}}</label>
</div>
<div class="setting-value">
{{input type='checkbox' checked=model.save_submissions}}
<span>{{i18n 'admin.wizard.save_submissions_label'}}</span>
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.restart_on_revisit'}}</label>
</div>
<div class="setting-value">
{{input type='checkbox' checked=model.restart_on_revisit}}
<span>{{i18n 'admin.wizard.restart_on_revisit_label'}}</span>
</div>
</div>
</div>
{{/if}}
</div>
{{wizard-links type="step" current=currentStep items=model.steps}}
{{#if currentStep}}
{{wizard-custom-step
step=currentStep
wizard=model
currentField=currentField
wizardFields=wizardFields}}
{{/if}}
{{wizard-links type="action" current=currentAction items=model.actions}}
{{#if currentAction}}
{{wizard-custom-action
action=currentAction
wizard=model
removeAction="removeAction"
wizardFields=wizardFields}}
{{/if}}
<div class='admin-wizard-buttons'>
<button {{action "save"}} disabled={{disableSave}} class='btn btn-primary'>
{{i18n 'admin.wizard.save'}}
</button>
{{#unless newWizard}}
<button {{action "remove"}} class='btn btn-danger remove'>
{{d-icon "far-trash-alt"}}{{i18n 'admin.wizard.remove'}}
</button>
{{/unless}}
{{conditional-loading-spinner condition=saving size='small'}}
{{#if error}}
<span class="error">{{d-icon "times"}}{{error}}</span>
{{/if}}
</div>
</div>