mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 03:52:14 +00:00
groups: add "ban" feature for group leaders. unfortunately not
updating dom, so require a refresh for now
This commit is contained in:
parent
385704aad7
commit
fcf02d33d9
2 changed files with 19 additions and 10 deletions
|
|
@ -104,13 +104,6 @@ get '/', (page, model, params, next) ->
|
|||
# ========== CONTROLLER FUNCTIONS ==========
|
||||
|
||||
ready (model) ->
|
||||
# used for things like remove website, chat, etc
|
||||
exports.removeAt = (e, el) ->
|
||||
if (confirmMessage = $(el).attr 'data-confirm')?
|
||||
return unless confirm(confirmMessage) is true
|
||||
debugger
|
||||
e.at().remove()
|
||||
|
||||
user = model.at('_user')
|
||||
misc.fixCorruptUser(model) # https://github.com/lefnire/habitrpg/issues/634
|
||||
|
||||
|
|
@ -127,6 +120,13 @@ ready (model) ->
|
|||
require('./filters').app(exports, model)
|
||||
require('./challenges').app(exports, model)
|
||||
|
||||
# used for things like remove website, chat, etc
|
||||
exports.removeAt = (e, el) ->
|
||||
if (confirmMessage = $(el).attr 'data-confirm')?
|
||||
return unless confirm(confirmMessage) is true
|
||||
e.at().remove()
|
||||
browser.resetDom(model) if $(el).attr('data-refresh')
|
||||
|
||||
###
|
||||
Cron
|
||||
###
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
{{#each _guilds as :guild}}
|
||||
<div class="tab-pane" id="groups-guild-{{:guild.id}}" >
|
||||
<app:groups:group group={{:guild}} />
|
||||
<app:groups:group group={:guild} />
|
||||
</div>
|
||||
{{/}}
|
||||
|
||||
|
|
@ -220,9 +220,18 @@
|
|||
<div id="accordion-{{@group.id}}-members" class="accordion-body collapse">
|
||||
<div class="accordion-inner">
|
||||
<table class="table table-striped">
|
||||
{{#each @group.members as :memberId}}
|
||||
{#each @group.members as :memberId}
|
||||
<tr><td>
|
||||
<a data-toggle='modal' data-target="#avatar-modal-{{:memberId}}">
|
||||
<!-- allow leaders to ban members -->
|
||||
{{#if equal(@group.leader,_user.id)}}
|
||||
{{#with @group.members[$index]}}
|
||||
<a x-bind=click:removeAt data-refresh=true data-confirm='Ban this member?'>
|
||||
<i class=icon-ban-circle rel=tooltip title="Ban Member"></i>
|
||||
</a>
|
||||
{{/}}
|
||||
|
||||
{{/}}
|
||||
{{username(_members[:memberId].auth, _members[:memberId].profile.name)}}
|
||||
</a>
|
||||
</td>
|
||||
|
|
@ -230,7 +239,7 @@
|
|||
({{:memberId}})
|
||||
</td>
|
||||
</tr>
|
||||
{{/}}
|
||||
{/}
|
||||
</table>
|
||||
{#with @group as :group}
|
||||
<form class="form-inline" x-bind="submit:groupInvite" data-type="{@group.type}" >
|
||||
|
|
|
|||
Loading…
Reference in a new issue