Add button for deleting post

This commit is contained in:
towards-a-new-leftypol 2023-09-13 16:50:57 -04:00
parent ab23fb6ab4
commit 961e60a2af
2 changed files with 16 additions and 6 deletions

View File

@ -611,7 +611,7 @@ function renderPostElem(post) {
if (shouldDisplayMarkIllegalButton(post)) {
const mark_illegal = span()
mark_illegal.classList.add('post--mark_illegal');
mark_illegal.classList.add('post--header_action', 'post--mark_illegal');
const mark_illegal_a = document.createElement('a');
mark_illegal_a.appendChild(text('Mark Illegal'));
@ -633,10 +633,22 @@ function renderPostElem(post) {
postHeader.appendChild(mark_illegal);
} else if (isIllegal(post)) {
const mark_illegal = span(text('illegal'))
mark_illegal.classList.add('post--is_illegal');
mark_illegal.classList.add('post--header_action', 'post--is_illegal');
postHeader.appendChild(mark_illegal);
}
// Delete post
const delete_post = span()
delete_post.classList.add('post--header_action', 'post--delete_post');
const delete_post_a = document.createElement('a');
delete_post_a.appendChild(text('delete'));
delete_post_a.setAttribute('href', '#' + identifier);
delete_post_a.setAttribute('title', 'Remove post from known spam and related tables. Post content will no longer be matched as illegal. Content can again end up in known spam posts if it keeps getting posted.');
delete_post.appendChild(text('['));
delete_post.appendChild(delete_post_a);
delete_post.appendChild(text(']'));
postHeader.appendChild(delete_post);
postContainer.appendChild(postHeader);
const postElem = div();

View File

@ -64,14 +64,12 @@ header {
flex: 1;
}
.post--header span.post--mark_illegal {
span.post--header_action {
flex-basis: fit-content;
flex-grow: 0;
}
.post--header span.post--is_illegal {
flex-basis: fit-content;
flex-grow: 0;
span.post--is_illegal {
color: orange;
font-weight: bold;
font-family: monospace;