0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-23 01:40:29 +01:00
discourse-custom-wizard/assets/javascripts/discourse/templates/components/wizard-realtime-validations.hbs
angusmcleod c45e51fcb6 Various fixes
* Code formatting
* Both "type" and "name" are used to refer to the validation type. Changed all to "type".
* Added proper abstraction of realtime validation classes on server
* UI improvements in admin and wizard
2021-02-16 11:43:00 +11:00

48 Zeilen
1,9 KiB
Handlebars

<h3>{{i18n 'admin.wizard.field.validations.header'}}</h3>
<ul>
{{#each-in field.validations as |type props|}}
<li>
<span class="setting-title">
<h4>{{i18n (concat 'admin.wizard.field.validations.' type)}}</h4>
{{input type="checkbox" checked=props.status}}
{{i18n 'admin.wizard.field.validations.enabled'}}
</span>
<div class="validation-container">
<div class="validation-section">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.validations.categories'}}</label>
</div>
<div class="setting-value">
{{category-selector
categories=(get this (concat 'validationBuffer.' type '.categories'))
onChange=(action 'updateValidationCategories' type props)
class="wizard"}}
</div>
</div>
<div class="validation-section">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.validations.date_after'}}</label>
</div>
<div class="setting-value">
{{date-picker-past
value=(readonly props.date_after)
containerId="date-container"
onSelect=(action (mut props.date_after))}}
</div>
</div>
<div class="validation-section">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.validations.position'}}</label>
</div>
<div class="setting-value">
{{radio-button name=(concat type field.id) value="above" selection=props.position}}
{{i18n 'admin.wizard.field.validations.above'}}
{{radio-button name=(concat type field.id) value="below" selection=props.position}}
{{i18n 'admin.wizard.field.validations.below'}}
</div>
</div>
</div>
</li>
{{/each-in}}
</ul>