Files
pics/models/forms/bumplockposts.js
Thomas Lynch e7042b3428 Add i18n to bumplock/lock/sticky/cycle, change board/globalsettings, changepassword, and create board pages
Update a bunch of middleware, pages  and libs to destructure i18n funcs if used more than once to not repeat res.locals
ref #396 (going to try and remember this from now on)
2023-02-04 14:52:53 +11:00

30 lines
499 B
JavaScript

'use strict';
const { NumberInt } = require(__dirname+'/../../db/db.js');
module.exports = (locals) => {
const { posts, __, __n } = locals;
const filteredposts = posts.filter(post => {
return !post.thread;
});
if (filteredposts.length === 0) {
return {
message: __('No threads selected to Bumplock'),
};
}
return {
message: __n('Toggled Bumplock for %s threads', filteredposts.length),
action: '$bit',
query: {
'bumplocked': {
'xor': NumberInt(1)
},
}
};
};