discourse/app/assets/javascripts/admin/addon/templates/components/admin-penalty-reason.hbs
Bianca Nenciu 1ad06eb764
UX: Redesign and refactor penalty modals (#19458)
This merges the two modals code to remove duplication and implements
a more consistent design.
2022-12-19 19:36:03 +02:00

19 lines
1006 B
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>
<TextField @value={{this.customReason}} @class="silence-reason" @onChange={{this.setCustomReason}} @placeholderKey="admin.user.silence_reason_placeholder" />
{{/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>