discourse/app/assets/javascripts/admin/addon/components/admin-penalty-reason.hbs
Jeff Wong a8324395e9 FEATURE: add silence reason dropdown to admin penalty reason
Adds dropdown list for pre-defined penalty options to silence to
mirror options on suspension list.
2023-09-05 18:21:51 -07:00

49 lines
1.3 KiB
Handlebars

<div class="penalty-reason-controls">
{{#if (eq @penaltyType "suspend")}}
<label class="suspend-reason-title">{{i18n
"admin.user.suspend_reason_title"
}}</label>
<ComboBox
@content={{this.reasons}}
@value={{this.selectedReason}}
@class="suspend-reason"
@onChange={{this.setSelectedReason}}
/>
{{#if this.isCustomReason}}
<TextField
@value={{this.customReason}}
@class="suspend-reason"
@onChange={{this.setCustomReason}}
/>
{{/if}}
{{else if (eq @penaltyType "silence")}}
<label class="silence-reason-title">
{{html-safe (i18n "admin.user.silence_reason_label")}}</label>
<ComboBox
@content={{this.reasons}}
@value={{this.selectedReason}}
@class="silence-reason"
@onChange={{this.setSelectedReason}}
/>
{{#if this.isCustomReason}}
<TextField
@value={{this.customReason}}
@class="silence-reason"
@onChange={{this.setCustomReason}}
@placeholderKey="admin.user.silence_reason_placeholder"
/>
{{/if}}
{{/if}}
</div>
<div class="penalty-message-controls">
<label>{{i18n "admin.user.suspend_message"}}</label>
<Textarea
@value={{this.message}}
class="suspend-message"
placeholder={{i18n "admin.user.suspend_message_placeholder"}}
/>
</div>