This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/templates/modal/flag.hbs
2016-03-01 14:22:36 -08:00

49 lines
2.3 KiB
Handlebars

<div class="modal-body flag-modal">
<form>
{{#each f in flagsAvailable itemController="flag-action-type"}}
{{#if f.isNotifyUser}}
<h3>{{f.formattedName}}</h3>
<div class='controls'>
<label class='radio'><input type='radio' id="radio_{{unbound f.model.name_key}}" {{action "changePostActionType" f}} name='post_action_type_index'> <span class='description'>{{{f.model.description}}}</span></label>
{{#if f.showMessageInput}}
{{textarea name="message" class="flag-message" placeholder=f.customPlaceholder value=f.message}}
<div {{bind-attr class=":custom-message-length f.customMessageLengthClasses"}}>{{f.customMessageLength}}</div>
{{/if}}
</div>
{{#if staffFlagsAvailable}}
<hr>
<h3>{{i18n 'flagging.notify_staff'}}</h3>
{{/if}}
{{else}}
<div class='controls'>
<label class='radio'>
<input type='radio' id="radio_{{unbound f.model.name_key}}" {{action "changePostActionType" f}} name='post_action_type_index'> <strong>{{f.formattedName}}</strong>
{{#if f.showDescription}}
<div class='description'>{{{f.model.description}}}</div>
{{/if}}
</label>
{{#if f.showMessageInput}}
{{textarea name="message" class="flag-message" placeholder=f.customPlaceholder value=f.message}}
<div {{bind-attr class=":custom-message-length f.customMessageLengthClasses"}}>{{f.customMessageLength}}</div>
{{/if}}
</div>
{{/if}}
{{else}}
{{i18n 'flagging.cant'}}
{{/each}}
</form>
</div>
<div class="modal-footer">
<button class='btn btn-primary' {{action "createFlag"}} {{bind-attr disabled="submitDisabled"}} title="{{i18n 'flagging.submit_tooltip'}}">{{{submitText}}}</button>
{{#if canTakeAction}}
<button class='btn btn-danger' {{action "takeAction"}} {{bind-attr disabled="submitDisabled"}} title="{{i18n 'flagging.take_action_tooltip'}}"><i class="fa fa-gavel"></i>{{i18n 'flagging.take_action'}}</button>
{{/if}}
{{#if canDeleteSpammer}}
<button class="btn btn-danger" {{action "deleteSpammer" userDetails}} {{bind-attr disabled="submitDisabled"}} title="{{i18n 'flagging.delete_spammer'}}"><i class="fa fa-exclamation-triangle"></i> {{i18n 'flagging.delete_spammer'}}</button>
{{/if}}
</div>