From bc7ae07530d07361c2b64878aad8eb38a4a1aa08 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Sat, 25 May 2024 17:11:30 +0200 Subject: [PATCH] added function to archive button --- res/forum/home/home.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/res/forum/home/home.html b/res/forum/home/home.html index 4c0c3f9..aa74e40 100644 --- a/res/forum/home/home.html +++ b/res/forum/home/home.html @@ -114,12 +114,18 @@ $(document).on("click", ".post_options", function(event) { - let post_title = $(this).parent(".post").children(".post_info").children("div").children(".post_author").html() + " - " + $(this).parent(".post").children(".post_info").children("div").children(".post_name").html(); + let post_author = $(this).parent(".post").children(".post_info").children("div").children(".post_author").html(); + let post_title = post_author + " - " + $(this).parent(".post").children(".post_info").children("div").children(".post_name").html(); if ($("#moderation_post_title").html() !== post_title) { $("#moderation_popup").css("display", "flex"); $("#moderation_post_title").html(post_title); + + let post_id_buffer = $(this).parent(".post").children(".post_image").children("img").attr("src").split("/"); + let post_id = post_id_buffer[post_id_buffer.length - 1]; + + $("#archive_btn").attr("onclick", "archive_post(\"" + post_id + "\", \"" + post_author + "\")"); } else { $("#moderation_popup").css("display", "none");