From 500e3342b2a02f96961798243df4521573083232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 24 Jun 2024 22:25:13 -0400 Subject: [PATCH] feat: show links in post queue --- install/package.json | 2 +- public/language/en-GB/post-queue.json | 3 ++- public/src/client/post-queue.js | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/install/package.json b/install/package.json index a7de7d2996..262a7474d6 100644 --- a/install/package.json +++ b/install/package.json @@ -104,7 +104,7 @@ "nodebb-plugin-ntfy": "1.7.4", "nodebb-plugin-spam-be-gone": "2.2.2", "nodebb-rewards-essentials": "1.0.0", - "nodebb-theme-harmony": "1.2.62", + "nodebb-theme-harmony": "1.2.63", "nodebb-theme-lavender": "7.1.8", "nodebb-theme-peace": "2.2.6", "nodebb-theme-persona": "13.3.24", diff --git a/public/language/en-GB/post-queue.json b/public/language/en-GB/post-queue.json index 021ed0d83f..24b33da2e6 100644 --- a/public/language/en-GB/post-queue.json +++ b/public/language/en-GB/post-queue.json @@ -38,5 +38,6 @@ "remove-selected": "Remove Selected", "remove-selected-confirm": "Do you want to remove %1 selected posts?", "bulk-accept-success": "%1 posts accepted", - "bulk-reject-success": "%1 posts rejected" + "bulk-reject-success": "%1 posts rejected", + "links-in-this-post": "Links in this post" } \ No newline at end of file diff --git a/public/src/client/post-queue.js b/public/src/client/post-queue.js index d7cfb9f230..ff5fa931d7 100644 --- a/public/src/client/post-queue.js +++ b/public/src/client/post-queue.js @@ -29,8 +29,23 @@ define('forum/post-queue', [ }); $('[component="post/content"] img:not(.not-responsive)').addClass('img-fluid'); + showLinksInPosts(); }; + function showLinksInPosts() { + $('.posts-list [data-id]').each((idx, el) => { + const $el = $(el); + const linkContainer = $el.find('[component="post-queue/link-container"]'); + const linkList = linkContainer.find('[component="post-queue/link-container/list"]'); + const linksInPost = $el.find('.post-content a'); + linksInPost.each((idx, link) => { + const href = $(link).attr('href'); + linkList.append(`
  • ${href}
  • `); + }); + linkContainer.toggleClass('hidden', !linksInPost.length); + }); + } + function confirmReject(msg) { return new Promise((resolve) => { bootbox.confirm(msg, resolve);