discourse/app/assets/javascripts/admin/addon/components/watched-word-form.hbs

89 lines
2.4 KiB
Handlebars

<div class="watched-word-input">
<label for="watched-word">{{i18n "admin.watched_words.form.label"}}</label>
<TextField
@id="watched-word"
@value={{this.word}}
@disabled={{this.formSubmitted}}
@class="watched-word-input-field"
@autocorrect="off"
@autocapitalize="off"
@placeholderKey={{this.placeholderKey}}
@title={{i18n this.placeholderKey}}
/>
</div>
{{#if this.canReplace}}
<div class="watched-word-input">
<label for="watched-replacement">{{i18n
"admin.watched_words.form.replace_label"
}}</label>
<TextField
@id="watched-replacement"
@value={{this.replacement}}
@disabled={{this.formSubmitted}}
@class="watched-word-input-field"
@autocorrect="off"
@autocapitalize="off"
@placeholderKey="admin.watched_words.form.replace_placeholder"
/>
</div>
{{/if}}
{{#if this.canTag}}
<div class="watched-word-input">
<label for="watched-tag">{{i18n
"admin.watched_words.form.tag_label"
}}</label>
<TagChooser
@id="watched-tag"
@class="watched-word-input-field"
@tags={{this.selectedTags}}
@onChange={{action "changeSelectedTags"}}
@everyTag={{true}}
@options={{hash allowAny=true disabled=this.formSubmitted}}
/>
</div>
{{/if}}
{{#if this.canLink}}
<div class="watched-word-input">
<label for="watched-link">{{i18n
"admin.watched_words.form.link_label"
}}</label>
<TextField
@id="watched-link"
@value={{this.replacement}}
@disabled={{this.formSubmitted}}
@class="watched-word-input-field"
@autocorrect="off"
@autocapitalize="off"
@placeholderKey="admin.watched_words.form.link_placeholder"
/>
</div>
{{/if}}
<div class="watched-word-input">
<label for="watched-case-sensitivity">{{i18n
"admin.watched_words.form.case_sensitivity_label"
}}</label>
<label class="case-sensitivity-checkbox">
<Input
@type="checkbox"
@checked={{this.isCaseSensitive}}
disabled={{this.formSubmitted}}
/>
{{i18n "admin.watched_words.form.case_sensitivity_description"}}
</label>
</div>
<DButton
@type="submit"
@class="btn btn-primary"
@action={{action "submitForm"}}
@disabled={{this.submitDisabled}}
@label="admin.watched_words.form.add"
/>
{{#if this.showMessage}}
<span class="success-message">{{this.message}}</span>
{{/if}}