As a result, I got such a script, maybe it will be useful to someone.
const Theme = {} const user = require.main.require('./src/user') const privileges = require.main.require('./src/privileges') Theme.getUsersByCategory = async function(data) { const { templateData: { cid } } = data const allUserIds = await user.getUidsFromSet('users:joindate', 0, -1) const asyncFilter = async (arr, predicate) => { const results = await Promise.all(arr.map(predicate)) return arr.filter((element, index) => results[index]) } const availableUserIds = await asyncFilter(allUserIds, async (id) => { return await privileges.categories.can('read', cid, id) }) data.templateData.availableUsers = await user.getUsersData(availableUserIds) return data } module.exports = ThemeA light re-shuffling of categories...
-
I guess it's spring cleaning time, since I've shuffled around a couple of categories in this forum.
-
It was confusing what Announcements was really for, and how it fit in with the NodeBB Development category, or the NodeBB Blog category.
- Topics in Announcements have now been moved into either one or the other category, and the category itself has been disabled
- NodeBB developers will be making short "dev diary" style posts in NodeBB Development, instead.
- Regular digests of dev diaries will be blogged on an ad-hoc basis (we'll try monthly!), and then cross-posted to the NodeBB Blog category
-
We got rid of some of the foreign language support forums as they were inactive, and moved Tutorials under Technical Support.
- Tutorials and Developer FAQ work in-tandem. The former will contain topics about how to use/tweak NodeBB as an admin, and the latter will contain technical topics about how to extend NodeBB via plugins.
- Specifically, I found that @baris was spending quite some time helping others on this forum with bespoke custom code, and it seemed to be a waste to not collect them someplace
I am toying with the idea of moving the top-level plugins and themes categories under "NodeBB Development", thoughts?
-
-
It has certainly improves the first impression of categories page.
-
J julian referenced this topic on