@crazycells I have the desire, but I need a lot of time to make it a separate plugin, now everything is strongly tied to the theme. Alas no free time right now
but someday I think I'll do it
Matvey
Posts
-
NodeBB + ReactJS -
NodeBB + ReactJSI want to brag a bit about our prototype Kanban board implementation
We used ReactJS + MobX inside a custom nodebb-theme -
[nodebb-plugin-poll] Poll pluginI also noticed a strange bug. For some reason the plugin puts the answer choices in the wrong order when publishing. Maybe someone knows why this is so and if there is any way to fix it?
For example:
I create a survey in strict order
But I get the following result
-
[nodebb-plugin-poll] Poll plugin@julian @psychobunny Is there anywhere you can follow the development of the new plugin? I would very much like to get a new stable working plugin as soon as possible
-
[nodebb-plugin-poll] Poll plugin@Schamper Good afternoon. Can you tell me if the plugin will be further improved? I would very much like to see the ability to edit an already created survey.
-
Strange behavior of nodebb-plugin-markdown when inserting a link@pitaj What do you think?
-
Strange behavior of nodebb-plugin-markdown when inserting a linkThe plugin inserts the link outside the `.plugin-markdown' block. I think this is wrong behavior, because it breaks the appearance of the text.
For example I want to make a list with checkboxes, text and a link:
As you can see in the html code, the tag
a
is most likely out of place
Alternatively, you could change the style of the
div.plugin-markdown
tag fromdisplay: flex
todisplay: inline
ordisplay: inline-block
then the appearance would not be broken, but I am afraid that this might break something in other cases
-
Users to whom the category is availableAs 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 = Theme
-
Users to whom the category is availablecould it be better this way?
user.getUidsFromSet ('users: joindate', 0, -1)
-
Users to whom the category is available@pitaj
Actually I just need a simple method to get all user IDs. I have now used the following code:const nextUid = await db.getObjectField('global', 'nextUid'); const allUids = []; for (let i = 1; i <= nextUid; i++) { allUids.push(i); }
But I'm not sure if this is correct.
-
Users to whom the category is available@baris
Thank you! I'll check it out today.
But I still need help getting data about all users. I tried the method described in this post, but it doesn't work for me. Always gives an empty array.
https://community.nodebb.org/topic/8908/retrieve-select-info-of-all-users-in-database -
Users to whom the category is availableHey! I am just starting to deal with development and I have a task that I cannot cope with yet. I need to get a list of all users to whom the category is available. For now, I don't want to do this as a widget, but just use the filter: category.build hook in plugin.json and call the method in which I am experimenting. In general, I have not yet found a suitable ready-made method in the code of NodeBB.
In general, I see the task like this ... I need to write a function that will receive the user ID and category ID and the answer will return true or false, that is, whether the user can see this category or not