Skip to content

Commit

Permalink
Only show member count of currently active users in groups.
Browse files Browse the repository at this point in the history
  • Loading branch information
martini committed Feb 10, 2017
1 parent fb4dee7 commit 46f5160
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions app/assets/javascripts/app/controllers/ticket_overview.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ class App.TicketOverview extends App.Controller

$(document).on 'mousemove.item', @dragItem
$(document).one 'mouseup.item', @endDragItem

@mainContent.addClass('u-unclickable')
# TODO: fire @cancelDrag on ESC

dragItem: (event) =>
Expand Down Expand Up @@ -235,6 +233,7 @@ class App.TicketOverview extends App.Controller
return

showBatchOverlay: ->
@mainContent.addClass('u-unclickable')
@batchOverlay.show()
$('html').css('overflow', 'hidden')
@batchOverlayBackdrop.velocity { opacity: [1, 0] }, { duration: 500 }
Expand All @@ -244,6 +243,7 @@ class App.TicketOverview extends App.Controller
$(document).on 'mousemove.batchoverlay', @controlBatchOverlay

hideBatchOverlay: ->
@mainContent.removeClass('u-unclickable')
$(document).off 'mousemove.batchoverlay'
@batchOverlayShown = false
@batchOverlayBackdrop.velocity { opacity: [0, 1] }, { duration: 300, queue: false }
Expand Down Expand Up @@ -409,7 +409,9 @@ class App.TicketOverview extends App.Controller

for user_id in group.user_ids
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()
@batchAssignGroupInner.html $(App.view('ticket_overview/batch_overlay_user_group')(
Expand Down Expand Up @@ -590,6 +592,14 @@ class App.TicketOverview extends App.Controller
user = App.User.find(user_id)
if user.active is true
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 = [
App.User.find(2),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
<%- @Icon('organization') %>
</span>
<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>
<% end %>

0 comments on commit 46f5160

Please sign in to comment.