<script>
const hidden_reportEntity = document.getElementById("forum_report_report_entity");
const hidden_reportRubriqueID = document.getElementById("forum_report_rubrique_id");
</script>
{# --------- COMMENT REPORT --------- #}
<script>
const reportPostCommentBtn = document.querySelectorAll('.report_comment');
reportPostCommentBtn.forEach(button => {
button.addEventListener('click', () => {
let commentId = button.getAttribute('data-comment-id');
hidden_reportEntity.value = "comment";
hidden_reportRubriqueID.value = commentId;
});
});
</script>
{# --------- POST REPORT --------- #}
<script>
const reportPostBtn = document.querySelectorAll('.report_post');
reportPostBtn.forEach(button => {
button.addEventListener('click', () => {
let postID = button.getAttribute('data-post-id');
hidden_reportEntity.value = "post";
hidden_reportRubriqueID.value = postID;
});
});
</script>
{# --------- COMMENT REPLY --------- #}
<script>
const reportPostCommentReplyBtn = document.querySelectorAll('.report_reply');
reportPostCommentReplyBtn.forEach(button => {
button.addEventListener('click', () => {
let replyId = button.getAttribute('data-reply-id');
hidden_reportEntity.value = "reply";
hidden_reportRubriqueID.value = replyId;
});
});
</script>