0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-25 18:50:27 +01:00
discourse-custom-wizard/assets/javascripts/discourse/templates/admin-wizards-wizard-show.hbs
2022-09-23 17:25:34 +02:00

201 Zeilen
5,8 KiB
Handlebars

{{#if wizard}}
<div class="wizard-header large">
{{input
name="name"
value=wizard.name
placeholderKey="admin.wizard.name_placeholder"}}
<div class="wizard-url">
{{#if wizard.name}}
{{#if copiedUrl}}
{{d-button class="btn-hover pull-right" icon="copy" label="ip_lookup.copied"}}
{{else}}
{{d-button action=(action "copyUrl") class="pull-right no-text" icon="copy"}}
{{/if}}
<a href={{wizardUrl}} target="_blank" rel="noopener noreferrer">{{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=wizard.background
placeholderKey="admin.wizard.background_placeholder"
class="small"}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.theme_id"}}</label>
</div>
<div class="setting-value">
{{combo-box
content=themes
valueProperty="id"
value=wizard.theme_id
onChange=(action (mut wizard.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=wizard.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=wizard.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=wizard.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=wizard.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=wizard.after_time}}
<span>{{i18n "admin.wizard.after_time_label"}}</span>
{{d-button
action=(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=wizard.permitted
options=(hash
context="wizard"
inputTypes="assignment,validation"
groupSelection="output"
userFieldSelection="key"
textSelection="value"
inputConnector="and"
)}}
</div>
</div>
{{#wizard-subscription-container}}
<div class="setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.save_submissions"}}</label>
</div>
<div class="setting-value">
{{input type="checkbox" checked=wizard.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=wizard.restart_on_revisit}}
<span>{{i18n "admin.wizard.restart_on_revisit_label"}}</span>
</div>
</div>
{{/wizard-subscription-container}}
</div>
{{wizard-links
itemType="step"
current=currentStep
items=wizard.steps}}
{{#if currentStep}}
{{wizard-custom-step
step=currentStep
wizard=wizard
currentField=currentField
wizardFields=wizardFields
fieldTypes=fieldTypes
subscribed=subscribed}}
{{/if}}
{{wizard-links
itemType="action"
current=currentAction
items=wizard.actions
generateLabels=true}}
{{#each wizard.actions as |wizardAction|}}
{{wizard-custom-action
action=wizardAction
currentActionId=currentAction.id
wizard=wizard
apis=apis
removeAction="removeAction"
wizardFields=wizardFields
fieldTypes=fieldTypes}}
{{/each}}
<div class="admin-wizard-buttons">
<button {{action "save"}} disabled={{disableSave}} class="btn btn-primary" type="button">
{{i18n "admin.wizard.save"}}
</button>
{{#unless creating}}
<button {{action "remove"}} class="btn btn-danger remove" type="button">
{{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>
{{/if}}