Delete Posts!
This commit is contained in:
@@ -46,13 +46,15 @@ function postPost() {
|
||||
}
|
||||
|
||||
$(window).on("load", function() {
|
||||
$(".modal-close").click(function () {
|
||||
$(".modal-close").click(function (){closeModal()});
|
||||
});
|
||||
|
||||
function closeModal() {
|
||||
$(".modal").hide();
|
||||
scrollbarMargin(0, 'auto');
|
||||
$('#modal-response').hide();
|
||||
$('.modal-default').show();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var masonryMode = 0;
|
||||
var windowWidth = $(window).width();
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
function postComment(buttonValue) {
|
||||
formData = $("#newcommentform").serializeArray();
|
||||
formData.push({name: "button", value: buttonValue});
|
||||
@@ -31,6 +32,8 @@ function deletePost(postID) {
|
||||
alert("Je account is bevroren, dus je kan geen posts verwijderen. Contacteer een admin als je denkt dat dit onjuist is.");
|
||||
}
|
||||
});
|
||||
closeModal();
|
||||
masonry(masonryMode);
|
||||
|
||||
|
||||
}
|
||||
@@ -84,3 +84,20 @@
|
||||
height: 24px;
|
||||
width: 24px;
|
||||
}
|
||||
|
||||
.deleteButton {
|
||||
background-color: firebrick;
|
||||
|
||||
}
|
||||
|
||||
.deleteButton i {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.deleteButton:hover span {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.deleteButton span {
|
||||
display: none;
|
||||
}
|
||||
@@ -6,9 +6,14 @@ session_start();
|
||||
?>
|
||||
<div class='post-header header'>
|
||||
<h4><?=$post['title']?></h4>
|
||||
<form onsubmit="return false;" id="deletepostform">
|
||||
<button onclick="deletePost('<?=$postID?>')" type="submit">verwijder post<br /></button>
|
||||
</form>
|
||||
<?php if (checkPermissionOnPost($postID, $_SESSION["userID"])) {?>
|
||||
<button class="deleteButton"
|
||||
onclick="deletePost('<?=$postID?>')"
|
||||
type="submit">
|
||||
<i class="fa fa-trash"></i>
|
||||
<span>Verwijder post</span>
|
||||
</button><br />
|
||||
<?php } ?>
|
||||
<span class='postinfo'>
|
||||
gepost door <?=$fullname?>,
|
||||
<span class='posttime' title='<?=$post['creationdate']?>'>
|
||||
|
||||
Reference in New Issue
Block a user