From 5140e5db8d807d5fcbe1fe46b12457fa3404a3c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 27 Feb 2015 12:53:00 -0500 Subject: [PATCH] closes #2759 --- public/language/en_GB/user.json | 4 +++- src/controllers/accounts.js | 4 ++++ src/posts/user.js | 17 +++++++++++++---- src/user/settings.js | 3 ++- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/public/language/en_GB/user.json b/public/language/en_GB/user.json index 9c32b2d26e..265439e4ca 100644 --- a/public/language/en_GB/user.json +++ b/public/language/en_GB/user.json @@ -88,5 +88,7 @@ "topic_search_help": "If enabled, in-topic searching will override the browser's default page search behaviour and allow you to search through the entire topic, instead of what is only shown on screen.", "follow_topics_you_reply_to": "Follow topics that you reply to.", - "follow_topics_you_create": "Follow topics you create." + "follow_topics_you_create": "Follow topics you create.", + + "grouptitle": "Select the group title you would like to display" } diff --git a/src/controllers/accounts.js b/src/controllers/accounts.js index eb78226145..a9577a9899 100644 --- a/src/controllers/accounts.js +++ b/src/controllers/accounts.js @@ -354,6 +354,9 @@ accountsController.accountSettings = function(req, res, next) { settings: function(next) { plugins.fireHook('filter:user.settings', [], next); }, + userGroups: function(next) { + groups.getUserGroups([userData.uid], next); + }, languages: function(next) { languages.list(next); } @@ -364,6 +367,7 @@ accountsController.accountSettings = function(req, res, next) { userData.settings = results.settings; userData.languages = results.languages; + userData.userGroups = results.userGroups[0]; userData.disableEmailSubscriptions = parseInt(meta.config.disableEmailSubscriptions, 10) === 1; diff --git a/src/posts/user.js b/src/posts/user.js index 6b9f4f5e48..c2094d5707 100644 --- a/src/posts/user.js +++ b/src/posts/user.js @@ -17,6 +17,9 @@ module.exports = function(Posts) { groups: function(next) { groups.getUserGroups(uids, next); }, + userSettings: function(next){ + user.getMultipleUserSettings(uids, next); + }, userData: function(next) { user.getMultipleUserFields(uids, ['uid', 'username', 'userslug', 'reputation', 'postcount', 'picture', 'signature', 'banned', 'status'], next); }, @@ -29,10 +32,16 @@ module.exports = function(Posts) { } var userData = results.userData; - for(var i=0; i