Added the ability to edit and delete posts which includes uploading of images for the posts and managing those images

Signed-off-by: rodude123 <rodude123@gmail.com>
This commit is contained in:
2023-07-12 03:29:56 +01:00
parent be5e047f51
commit 3b71ba4d23
26 changed files with 1549 additions and 315 deletions
+64 -5
View File
@@ -15,11 +15,11 @@
<li><a href="#" id="goToCV"><span>&lt;</span>CV<span>&gt;</span></a></li>
<li><a href="#" id="goToProjects"><span>&lt;</span>Projects<span>&gt;</span></a></li>
<li><a href="#" id="blog" class="active"><span>&lt;</span>Blog<span>&gt;</span> <i
class="fa fa-caret-right"></i></a></li>
class="fa fa-caret-right"></i>
</a></li>
<li class="dropdown">
<ul>
<li><a href="#" id="goToAddPost"><span>&lt;</span>Add Blog Post<span>&gt;</span></a>
</li>
<li><a href="#" id="goToAddPost"><span>&lt;</span>Add Blog Post<span>&gt;</span></a></li>
<li><a href="#" id="goToEditPost" class="active"><span>&lt;</span>Edit Blog
Post<span>&gt;</span></a></li>
</ul>
@@ -189,8 +189,9 @@
</div>
<div class="formControl" style="align-items: stretch;">
<label for="CKEditor">Post</label>
<div id="CKEditor">
<label for="CKEditorAddPost">Post</label>
<div id="CKEditorAddPost">
</div>
</div>
@@ -207,6 +208,64 @@
</form>
</section>
<section id="editPost">
<h2>edit post</h2>
<table>
<thead>
<tr>
<th>Title</th>
<th>Date Created</th>
<th>Date Modified</th>
<th>Action</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<form action="" id="editPostForm" method="POST">
<div class="formControl">
<label for="editPostTitle">Title </label>
<input type="text" name="editPostTitle" id="editPostTitle" required>
</div>
<div class="formControl">
<label class="checkContainer" for="editIsFeatured">Is It The Featured Post
<input type="checkbox" id="editIsFeatured" name="editIsFeatured">
<span class="checkmark"></span>
</label>
</div>
<div class="formControl">
<label for="editHeaderImg">Header Image</label>
<input type="file" name="editHeaderImg" id="editHeaderImg">
</div>
<div class="formControl">
<label for="editPostCategories">Categories</label>
<input type="text" name="editPostCategories" id="editPostCategories"
pattern='(?:,|\n|^)("(?:(?:"")*[^"]*)*"|[^",\n]*|(?:\n|$))' title="CSV format"
oninvalid="this.setCustomValidity('This field takes a CSV like format')"
oninput="this.setCustomValidity('')" required>
</div>
<div class="formControl" style="align-items: stretch;">
<label for="CKEditorEditPost">Post</label>
<div id="CKEditorEditPost">
</div>
</div>
<div class="error hidden" id="editPostError">
<button class="close" type="button">&times;</button>
<div></div>
</div>
<div class="success hidden" id="editPostSuccess">
<button class="close" type="button">&times;</button>
<div></div>
</div>
<input type="submit" value="Add new blog post" class="btn btnPrimary boxShadowIn boxShadowOut">
</form>
</section>
</main>