{{_ "Private_Groups_list"}}
+-
+ {{#each groups}}
+
- + + + {{name}} + + + {{/each}} +
diff --git a/client/methods/openRoom.coffee b/client/methods/openRoom.coffee
new file mode 100644
index 000000000000..a1b21e5ce310
--- /dev/null
+++ b/client/methods/openRoom.coffee
@@ -0,0 +1,11 @@
+Meteor.methods
+ openRoom: (rid) ->
+ if not Meteor.userId()
+ throw new Meteor.Error 'invalid-user', '[methods] openRoom -> Invalid user'
+
+ ChatSubscription.update
+ rid: rid
+ 'u._id': Meteor.userId()
+ ,
+ $set:
+ open: true
diff --git a/client/routes/roomRoute.coffee b/client/routes/roomRoute.coffee
index 2211ec98e7f9..2b6ef4a6fd16 100644
--- a/client/routes/roomRoute.coffee
+++ b/client/routes/roomRoute.coffee
@@ -48,6 +48,8 @@ openRoom = (type, name) ->
$('.message-form .input-message').focus()
, 100
+ # update user's room subscription
+ Meteor.call 'openRoom', room._id
roomExit = ->
mainNode = document.querySelector('.main-content')
diff --git a/client/views/app/sideNav/listPrivateGroupsFlex.coffee b/client/views/app/sideNav/listPrivateGroupsFlex.coffee
new file mode 100644
index 000000000000..08ea0d9eb0c7
--- /dev/null
+++ b/client/views/app/sideNav/listPrivateGroupsFlex.coffee
@@ -0,0 +1,19 @@
+Template.listPrivateGroupsFlex.helpers
+ groups: ->
+ return ChatSubscription.find { t: { $in: ['p']}, f: { $ne: true } }, { sort: 't': 1, 'name': 1 }
+
+Template.listPrivateGroupsFlex.events
+ 'click header': ->
+ SideNav.closeFlex()
+
+ 'click .channel-link': ->
+ SideNav.closeFlex()
+
+ 'click footer .create': ->
+ SideNav.setFlex "createChannelFlex"
+
+ 'mouseenter header': ->
+ SideNav.overArrow()
+
+ 'mouseleave header': ->
+ SideNav.leaveArrow()
diff --git a/client/views/app/sideNav/listPrivateGroupsFlex.html b/client/views/app/sideNav/listPrivateGroupsFlex.html
new file mode 100644
index 000000000000..182f28297e71
--- /dev/null
+++ b/client/views/app/sideNav/listPrivateGroupsFlex.html
@@ -0,0 +1,27 @@
+
+ {{_ "Private_Groups"}}
+ {{_ "Private_Groups_list"}}
+
+ {{#each groups}}
+
+
{{_ "No_groups_yet" }}
{{/each}} + {{_ "More_groups"}} .. diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json index aaffba4f49a5..b27d2789261e 100644 --- a/i18n/en.i18n.json +++ b/i18n/en.i18n.json @@ -170,6 +170,7 @@ "Meta_robots" : "Robots", "minutes" : "minutes", "More_channels" : "More channels", + "More_groups" : "More private groups", "More_unreads" : "More unreads", "Msgs" : "Msgs", "multi" : "multi", @@ -205,6 +206,7 @@ "Preferences_saved" : "Preferences saved", "Privacy" : "Privacy", "Private_Groups" : "Private Groups", + "Private_Groups_list" : "List of Private Groups", "Profile" : "Profile", "Profile_saved_successfully" : "Profile saved successfully", "Proudly_developed" : "Proudly developed with Meteor", diff --git a/i18n/pt.i18n.json b/i18n/pt.i18n.json index 430f84ff60be..871d8bc30771 100644 --- a/i18n/pt.i18n.json +++ b/i18n/pt.i18n.json @@ -164,6 +164,7 @@ "Meta_robots" : "Robots", "minutes" : "minutos", "More_channels" : "Mais canais", + "More_groups" : "Mais grupos privados", "Msgs" : "Msgs", "multi" : "multi", "My_Account" : "Minha Conta", @@ -198,6 +199,7 @@ "Preferences_saved" : "PreferĂȘncias salvas", "Privacy" : "Privacidade", "Private_Groups" : "Grupos Privados", + "Private_Groups_list" : "Lista de Grupos Privados", "Profile" : "Perfil", "Profile_saved_successfully" : "Perfil salvo com sucesso", "Proudly_developed" : "Orgulhosamente desenvolvido com Meteor", diff --git a/server/methods/openRoom.coffee b/server/methods/openRoom.coffee new file mode 100644 index 000000000000..d3ab6783b764 --- /dev/null +++ b/server/methods/openRoom.coffee @@ -0,0 +1,13 @@ +Meteor.methods + openRoom: (rid) -> + if not Meteor.userId() + throw new Meteor.Error 'invalid-user', '[methods] openRoom -> Invalid user' + + console.log '[methods] openRoom -> '.green, 'userId:', Meteor.userId(), 'arguments:', arguments + + ChatSubscription.update + rid: rid + 'u._id': Meteor.userId() + , + $set: + open: true