Only show member count of currently active users in groups.

This commit is contained in:
Martin Edenhofer 2017-02-10 11:05:01 +01:00
parent fb4dee7357
commit 46f5160211
2 changed files with 14 additions and 4 deletions

View file

@ -49,8 +49,6 @@ class App.TicketOverview extends App.Controller
$(document).on 'mousemove.item', @dragItem $(document).on 'mousemove.item', @dragItem
$(document).one 'mouseup.item', @endDragItem $(document).one 'mouseup.item', @endDragItem
@mainContent.addClass('u-unclickable')
# TODO: fire @cancelDrag on ESC # TODO: fire @cancelDrag on ESC
dragItem: (event) => dragItem: (event) =>
@ -235,6 +233,7 @@ class App.TicketOverview extends App.Controller
return return
showBatchOverlay: -> showBatchOverlay: ->
@mainContent.addClass('u-unclickable')
@batchOverlay.show() @batchOverlay.show()
$('html').css('overflow', 'hidden') $('html').css('overflow', 'hidden')
@batchOverlayBackdrop.velocity { opacity: [1, 0] }, { duration: 500 } @batchOverlayBackdrop.velocity { opacity: [1, 0] }, { duration: 500 }
@ -244,6 +243,7 @@ class App.TicketOverview extends App.Controller
$(document).on 'mousemove.batchoverlay', @controlBatchOverlay $(document).on 'mousemove.batchoverlay', @controlBatchOverlay
hideBatchOverlay: -> hideBatchOverlay: ->
@mainContent.removeClass('u-unclickable')
$(document).off 'mousemove.batchoverlay' $(document).off 'mousemove.batchoverlay'
@batchOverlayShown = false @batchOverlayShown = false
@batchOverlayBackdrop.velocity { opacity: [0, 1] }, { duration: 300, queue: false } @batchOverlayBackdrop.velocity { opacity: [0, 1] }, { duration: 300, queue: false }
@ -409,7 +409,9 @@ class App.TicketOverview extends App.Controller
for user_id in group.user_ids for user_id in group.user_ids
if App.User.exists(user_id) if App.User.exists(user_id)
users.push App.User.find(user_id) user = App.User.find(user_id)
if user.active is true
users.push user
@batchAssignGroupName.text group.displayName() @batchAssignGroupName.text group.displayName()
@batchAssignGroupInner.html $(App.view('ticket_overview/batch_overlay_user_group')( @batchAssignGroupInner.html $(App.view('ticket_overview/batch_overlay_user_group')(
@ -590,6 +592,14 @@ class App.TicketOverview extends App.Controller
user = App.User.find(user_id) user = App.User.find(user_id)
if user.active is true if user.active is true
users.push user users.push user
for group in groups
valid_user_ids = []
for user_id in group.user_ids
if App.User.exists(user_id)
if App.User.find(user_id).active is true
valid_user_ids.push user_id
group.valid_user_ids = valid_user_ids
### ###
users = [ users = [
App.User.find(2), App.User.find(2),

View file

@ -10,6 +10,6 @@
<%- @Icon('organization') %> <%- @Icon('organization') %>
</span> </span>
<div class="batch-overlay-assign-entry-name"><%- group.displayName() %></div> <div class="batch-overlay-assign-entry-name"><%- group.displayName() %></div>
<div class="batch-overlay-assign-entry-detail"><%- @T('%s people', group.user_ids.length) %></div> <div class="batch-overlay-assign-entry-detail"><%- @T('%s people', group.valid_user_ids.length) %></div>
</div> </div>
<% end %> <% end %>