mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
Update: Improved UI and functionality of posts and post-edit pages
This change includes both UI and functionality enhancements in 'posts.html' and 'postEdit.html' within the web templates directory. For posts.html, the caption under the table of posts has been replaced with a paragraph tag for better readability. A more comprehensive redesign has been done on postEdit.html, ensuring a more user-friendly page layout with enhanced post edition capabilities. In addition, minor updates were made to the go.sum and go.mod file as a result of new dependencies and versions required by these changes.
This commit is contained in:
@@ -1,25 +1,77 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>GohCMS | Post edition</title>
|
||||
{{.Head}}
|
||||
<title>GohCMS | Post edition</title>
|
||||
{{.Head}}
|
||||
</head>
|
||||
<body class="text-dark">
|
||||
<body class="text-dark vh-100 d-flex flex-column">
|
||||
{{.Navbar}}
|
||||
<div class="container mt-3 text-black-50">
|
||||
<h1>Post - edition</h1>
|
||||
<form action="posts" method="POST">
|
||||
<label for="postContent">Edition</label>
|
||||
<textarea id="postContent" name="postContent"></textarea>
|
||||
</form>
|
||||
<div class="container mt-3 text-black-50 d-flex flex-column h-100">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>
|
||||
<h1>Post - edition</h1>
|
||||
<label for="postContent">Edition</label>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
<button class="btn btn-success d-flex justify-content-center align-items-center gap-1" style="fill: white;">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M840-680v480q0 33-23.5 56.5T760-120H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h480l160 160Zm-80 34L646-760H200v560h560v-446ZM480-240q50 0 85-35t35-85q0-50-35-85t-85-35q-50 0-85 35t-35 85q0 50 35 85t85 35ZM240-560h360v-160H240v160Zm-40-86v446-560 114Z"/></svg>
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-black-50 d-flex align-items-center justify-content-center h-100 py-3">
|
||||
<textarea id="postContent" name="postContent"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/tinymce/js/tinymce/tinymce.min.js"></script>
|
||||
<script>
|
||||
tinymce.init({
|
||||
selector: '#postContent',
|
||||
promotion: false
|
||||
});
|
||||
promotion: false,
|
||||
plugins: 'image',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
images_upload_handler: (blobInfo, progress) => new Promise((resolve, reject) => {
|
||||
// const xhr = new XMLHttpRequest();
|
||||
// xhr.withCredentials = false;
|
||||
// xhr.open('POST', 'postAcceptor.php');
|
||||
//
|
||||
// xhr.upload.onprogress = (e) => {
|
||||
// progress(e.loaded / e.total * 100);
|
||||
// };
|
||||
//
|
||||
// xhr.onload = () => {
|
||||
// if (xhr.status === 403) {
|
||||
// reject({message: 'HTTP Error: ' + xhr.status, remove: true});
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if (xhr.status < 200 || xhr.status >= 300) {
|
||||
// reject('HTTP Error: ' + xhr.status);
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// const json = JSON.parse(xhr.responseText);
|
||||
//
|
||||
// if (!json || typeof json.location != 'string') {
|
||||
// reject('Invalid JSON: ' + xhr.responseText);
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// resolve(json.location);
|
||||
// };
|
||||
//
|
||||
// xhr.onerror = () => {
|
||||
// reject('Image upload failed due to a XHR Transport error. Code: ' + xhr.status);
|
||||
// };
|
||||
//
|
||||
// const formData = new FormData();
|
||||
// formData.append('file', blobInfo.blob(), blobInfo.filename());
|
||||
//
|
||||
// xhr.send(formData);
|
||||
}),
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
{{.Navbar}}
|
||||
<div class="container mt-3 text-black-50">
|
||||
<h1>Posts</h1>
|
||||
<p>List of your posts</p>
|
||||
<table class="table table-striped">
|
||||
<caption>List of posts</caption>
|
||||
<thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
Reference in New Issue
Block a user