The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/views/app/sideNav/channels.coffee

28 lines
753 B

Template.channels.helpers
tRoomMembers: ->
return t('Members_placeholder')
isActive: ->
return 'active' if ChatSubscription.findOne({ t: { $in: ['c']}, f: { $ne: true }, open: true, rid: Session.get('openedRoom') }, { fields: { _id: 1 } })?
rooms: ->
query =
t: { $in: ['c']},
open: true
if !RocketChat.settings.get 'Disable_Favorite_Rooms'
query.f = { $ne: true }
return ChatSubscription.find query, { sort: 't': 1, 'name': 1 }
Template.channels.events
'click .add-room': (e, instance) ->
if RocketChat.authz.hasAtLeastOnePermission('create-c')
SideNav.setFlex "createChannelFlex"
SideNav.openFlex()
else
e.preventDefault()
'click .more-channels': ->
SideNav.setFlex "listChannelsFlex"
SideNav.openFlex()