Switch over comment reporting to use the new system
This commit is contained in:
parent
a0488f2b23
commit
bd5fd8fb21
4 changed files with 37 additions and 51 deletions
|
@ -50,6 +50,10 @@ function filter_new_comment_status(id, new_status) {
|
|||
const commentRow = document.getElementById(`comment-${id}`);
|
||||
if(document.location.pathname === '/admin/filtered/comments' || document.location.pathname === '/admin/reported/comments' ) {
|
||||
commentRow.parentElement.removeChild(commentRow);
|
||||
const postRow = document.querySelector(`div.post-row-cid-${id}`);
|
||||
if (postRow) {
|
||||
postRow.parentElement.removeChild(postRow);
|
||||
}
|
||||
} else {
|
||||
const approveLink = commentRow.querySelector('button#filter-approve')
|
||||
const removeLink = commentRow.querySelector('button#filter-remove')
|
||||
|
@ -57,6 +61,16 @@ function filter_new_comment_status(id, new_status) {
|
|||
approveLink.parentElement.removeChild(approveLink);
|
||||
removeLink.parentElement.removeChild(removeLink);
|
||||
}
|
||||
|
||||
const reportButtonCell = document.getElementById(`flaggers-${id}`);
|
||||
if(reportButtonCell) {
|
||||
reportButtonCell.classList.add('d-none')
|
||||
}
|
||||
|
||||
const reportButton = document.getElementById(`report-btn-${id}`);
|
||||
if(reportButton) {
|
||||
reportButton.parentElement.removeChild(reportButton);
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById('toast-post-success-text').innerText = json.result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue