mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: add line to description exposing a category's handle if accessible by fediverse pseudo-user, closes #13126
This commit is contained in:
@@ -108,7 +108,7 @@
|
|||||||
"nodebb-plugin-spam-be-gone": "2.3.1",
|
"nodebb-plugin-spam-be-gone": "2.3.1",
|
||||||
"nodebb-plugin-web-push": "0.7.3",
|
"nodebb-plugin-web-push": "0.7.3",
|
||||||
"nodebb-rewards-essentials": "1.0.1",
|
"nodebb-rewards-essentials": "1.0.1",
|
||||||
"nodebb-theme-harmony": "2.0.37",
|
"nodebb-theme-harmony": "2.0.38",
|
||||||
"nodebb-theme-lavender": "7.1.17",
|
"nodebb-theme-lavender": "7.1.17",
|
||||||
"nodebb-theme-peace": "2.2.39",
|
"nodebb-theme-peace": "2.2.39",
|
||||||
"nodebb-theme-persona": "14.0.15",
|
"nodebb-theme-persona": "14.0.15",
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
"subcategories": "Subcategories",
|
"subcategories": "Subcategories",
|
||||||
"uncategorized": "Uncategorized",
|
"uncategorized": "Uncategorized",
|
||||||
"uncategorized.description": "Topics that do not strictly fit in with any existing categories",
|
"uncategorized.description": "Topics that do not strictly fit in with any existing categories",
|
||||||
|
"handle.description": "This category can be followed from the open social web via the handle %1",
|
||||||
"new-topic-button": "New Topic",
|
"new-topic-button": "New Topic",
|
||||||
"guest-login-post": "Log in to post",
|
"guest-login-post": "Log in to post",
|
||||||
"no-topics": "<strong>There are no topics in this category.</strong><br />Why don't you try posting one?",
|
"no-topics": "<strong>There are no topics in this category.</strong><br />Why don't you try posting one?",
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ define('forum/category', [
|
|||||||
'hooks',
|
'hooks',
|
||||||
'alerts',
|
'alerts',
|
||||||
'api',
|
'api',
|
||||||
], function (infinitescroll, share, navigator, topicList, sort, categorySelector, hooks, alerts, api) {
|
'clipboard',
|
||||||
|
], function (infinitescroll, share, navigator, topicList, sort, categorySelector, hooks, alerts, api, clipboard) {
|
||||||
const Category = {};
|
const Category = {};
|
||||||
|
|
||||||
$(window).on('action:ajaxify.start', function (ev, data) {
|
$(window).on('action:ajaxify.start', function (ev, data) {
|
||||||
@@ -48,6 +49,8 @@ define('forum/category', [
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
new clipboard('[data-clipboard-text]');
|
||||||
|
|
||||||
hooks.fire('action:topics.loaded', { topics: ajaxify.data.topics });
|
hooks.fire('action:topics.loaded', { topics: ajaxify.data.topics });
|
||||||
hooks.fire('action:category.loaded', { cid: ajaxify.data.cid });
|
hooks.fire('action:category.loaded', { cid: ajaxify.data.cid });
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ const privileges = require('../privileges');
|
|||||||
const user = require('../user');
|
const user = require('../user');
|
||||||
const categories = require('../categories');
|
const categories = require('../categories');
|
||||||
const meta = require('../meta');
|
const meta = require('../meta');
|
||||||
|
const activitypub = require('../activitypub');
|
||||||
const pagination = require('../pagination');
|
const pagination = require('../pagination');
|
||||||
const helpers = require('./helpers');
|
const helpers = require('./helpers');
|
||||||
const utils = require('../utils');
|
const utils = require('../utils');
|
||||||
@@ -161,6 +162,12 @@ categoryController.get = async function (req, res, next) {
|
|||||||
if (meta.config.activitypubEnabled) {
|
if (meta.config.activitypubEnabled) {
|
||||||
// Include link header for richer parsing
|
// Include link header for richer parsing
|
||||||
res.set('Link', `<${nconf.get('url')}/actegory/${cid}>; rel="alternate"; type="application/activity+json"`);
|
res.set('Link', `<${nconf.get('url')}/actegory/${cid}>; rel="alternate"; type="application/activity+json"`);
|
||||||
|
|
||||||
|
// Category accessible
|
||||||
|
const remoteOk = await privileges.categories.can('read', cid, activitypub._constants.uid);
|
||||||
|
if (remoteOk) {
|
||||||
|
categoryData.handleFull = `${categoryData.handle}@${nconf.get('url_parsed').host}`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
res.render('category', categoryData);
|
res.render('category', categoryData);
|
||||||
|
|||||||
Reference in New Issue
Block a user