feat: show links in post queue

This commit is contained in:
Barış Soner Uşaklı
2024-06-24 22:25:13 -04:00
parent 54b0139531
commit 500e3342b2
3 changed files with 18 additions and 2 deletions

View File

@@ -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",

View File

@@ -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"
}

View File

@@ -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(`<li><a href="${href}">${href}</a></li>`);
});
linkContainer.toggleClass('hidden', !linksInPost.length);
});
}
function confirmReject(msg) {
return new Promise((resolve) => {
bootbox.confirm(msg, resolve);