mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: plumb pid into return data from posts.loadPostTools, add link to view original post, for remote content
closes #12433
This commit is contained in:
@@ -152,6 +152,7 @@
|
|||||||
"bookmarks.has-no-bookmarks": "You haven't bookmarked any posts yet.",
|
"bookmarks.has-no-bookmarks": "You haven't bookmarked any posts yet.",
|
||||||
|
|
||||||
"copy-permalink": "Copy Permalink",
|
"copy-permalink": "Copy Permalink",
|
||||||
|
"go-to-original": "View Original Post",
|
||||||
|
|
||||||
"loading-more-posts": "Loading More Posts",
|
"loading-more-posts": "Loading More Posts",
|
||||||
"move-topic": "Move Topic",
|
"move-topic": "Move Topic",
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ module.exports = function (SocketPosts) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const postData = results.posts;
|
const postData = results.posts;
|
||||||
postData.absolute_url = `${nconf.get('url')}/post/${data.pid}`;
|
postData.pid = data.pid;
|
||||||
|
postData.absolute_url = `${nconf.get('url')}/post/${encodeURIComponent(data.pid)}`;
|
||||||
postData.bookmarked = results.bookmarked;
|
postData.bookmarked = results.bookmarked;
|
||||||
postData.selfPost = socket.uid && socket.uid === postData.uid;
|
postData.selfPost = socket.uid && socket.uid === postData.uid;
|
||||||
postData.display_edit_tools = results.canEdit.flag;
|
postData.display_edit_tools = results.canEdit.flag;
|
||||||
@@ -48,6 +49,7 @@ module.exports = function (SocketPosts) {
|
|||||||
postData.display_change_owner_tools = results.isAdmin || results.isModerator;
|
postData.display_change_owner_tools = results.isAdmin || results.isModerator;
|
||||||
postData.display_ip_ban = (results.isAdmin || results.isGlobalMod) && !postData.selfPost;
|
postData.display_ip_ban = (results.isAdmin || results.isGlobalMod) && !postData.selfPost;
|
||||||
postData.display_history = results.history && results.canViewHistory;
|
postData.display_history = results.history && results.canViewHistory;
|
||||||
|
postData.display_original_url = !utils.isNumber(data.pid);
|
||||||
postData.flags = {
|
postData.flags = {
|
||||||
flagId: parseInt(results.posts.flagId, 10) || null,
|
flagId: parseInt(results.posts.flagId, 10) || null,
|
||||||
can: results.canFlag.flag,
|
can: results.canFlag.flag,
|
||||||
|
|||||||
Reference in New Issue
Block a user