mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-03 08:21:07 +00:00
chat: allow admins to remove other people's messages
This commit is contained in:
parent
92e8e5b597
commit
ae4c5723e0
2 changed files with 4 additions and 2 deletions
|
|
@ -134,7 +134,9 @@ module.exports.app = (appExports, model, app) ->
|
|||
return next() unless e.keyCode is 13
|
||||
appExports.tavernSendChat()
|
||||
|
||||
appExports.deleteChatMessage = (e) -> e.at().remove() #requires the {#with}
|
||||
appExports.deleteChatMessage = (e) ->
|
||||
if confirm("Delete chat message?") is true
|
||||
e.at().remove() #requires the {#with}
|
||||
|
||||
app.on 'render', (ctx) ->
|
||||
$('#party-tab-link').on 'shown', (e) ->
|
||||
|
|
|
|||
|
|
@ -63,6 +63,6 @@
|
|||
class="label {{#if @message.npc}}label-success{{else if @message.contributor}}label-inverse{{else if equal(@message.uuid,_user.id)}}label-info{{/}} chat-message"
|
||||
rel='tooltip' title="{{@message.contributor}}{{@message.npc}}">
|
||||
{{@message.user}}</span> {{@message.text}} - <span class='muted time'>{relativeDate(@message.timestamp, _currentTime)}
|
||||
{{#if equal(@message.uuid,_user.id)}}{{#with @message}}<a x-bind="click:deleteChatMessage"><i rel=tooltip title=Delete class=icon-remove></i></a>{{/}}{{/}}
|
||||
{{#if or(_user.backer.admin,equal(@message.uuid,_user.id))}}{{#with @message}}<a x-bind="click:deleteChatMessage"><i rel=tooltip title=Delete class=icon-remove></i></a>{{/}}{{/}}
|
||||
</span>
|
||||
</li>
|
||||
|
|
|
|||
Loading…
Reference in a new issue