v1.18.x
Barış Soner Uşaklı 10 years ago
parent 27282a2877
commit 5140e5db8d

@ -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"
}

@ -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;

@ -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<userData.length; ++i) {
userData[i].groups = results.groups[i];
userData[i].status = user.getStatus(userData[i].status, results.online[i]);
}
userData.forEach(function(userData, i) {
userData.groups = results.groups[i];
if (!results.userSettings[i].groupTitle) {
results.userSettings[i].groupTitle = results.groups[i][0] ? results.groups[i][0].name : '';
}
results.groups[i].forEach(function(group, index) {
group.selected = group.name === results.userSettings[i].groupTitle;
});
userData.status = user.getStatus(userData.status, results.online[i]);
});
async.map(userData, function(userData, next) {
userData.uid = userData.uid || 0;

@ -103,7 +103,8 @@ module.exports = function(User) {
sendChatNotifications: data.sendChatNotifications,
sendPostNotifications: data.sendPostNotifications,
restrictChat: data.restrictChat,
topicSearchEnabled: data.topicSearchEnabled
topicSearchEnabled: data.topicSearchEnabled,
groupTitle: data.groupTitle
}, next);
},
function(next) {

Loading…
Cancel
Save