feat: add selected group to all profile pages

add new lang strings
This commit is contained in:
Barış Soner Uşaklı
2022-12-23 18:20:43 -05:00
parent 8f5bb18ee5
commit 6e86b4afa2
4 changed files with 4 additions and 3 deletions

View File

@@ -87,6 +87,7 @@
"reputation": "Reputation",
"lastpost": "Last post",
"firstpost": "First post",
"about": "About",
"read_more": "read more",
"more": "More",

View File

@@ -45,6 +45,7 @@
"followers": "Followers",
"following": "Following",
"blocks": "Blocks",
"blocked-users": "Blocked users",
"block_toggle": "Toggle Block",
"block_user": "Block User",
"unblock_user": "Unblock User",

View File

@@ -78,6 +78,8 @@ helpers.getUserDataByUserSlug = async function (userslug, callerUID, query = {})
userData.hasPrivateChat = results.hasPrivateChat;
userData.showHidden = results.canEdit; // remove in v1.19.0
userData.groups = Array.isArray(results.groups) && results.groups.length ? results.groups[0] : [];
userData.selectedGroup = userData.groups.filter(group => group && userData.groupTitleArray.includes(group.name))
.sort((a, b) => userData.groupTitleArray.indexOf(a.name) - userData.groupTitleArray.indexOf(b.name));
userData.disableSignatures = meta.config.disableSignatures === 1;
userData['reputation:disabled'] = meta.config['reputation:disabled'] === 1;
userData['downvote:disabled'] = meta.config['downvote:disabled'] === 1;

View File

@@ -61,9 +61,6 @@ profileController.get = async function (req, res, next) {
addMetaTags(res, userData);
userData.selectedGroup = userData.groups.filter(group => group && userData.groupTitleArray.includes(group.name))
.sort((a, b) => userData.groupTitleArray.indexOf(a.name) - userData.groupTitleArray.indexOf(b.name));
res.render('account/profile', userData);
};