forked from UKSOURCE/cms.hailearning.edu.vn
feat: Enhance comment management functionality in blog module
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<form action="/admin/blog/create" method="POST" id="blogForm">
|
||||
<form action="/admin/blog/create" method="POST" id="blogForm" class="content-with-fixed-buttons">
|
||||
<!-- Navigation Tabs -->
|
||||
<div class="card shadow-sm border-0 mb-4">
|
||||
<div class="card-header bg-white border-bottom">
|
||||
@@ -60,7 +60,9 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-text">Upload a featured image for this blog post or
|
||||
enter image URL.</div>
|
||||
enter image URL.
|
||||
<br><strong>Recommended size:</strong> 852 x 400 px
|
||||
</div>
|
||||
<div id="featuredImagePreview" class="mt-2"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -96,6 +98,7 @@
|
||||
<label class="form-label fw-medium">Gallery Images <span
|
||||
class="text-danger">*</span></label>
|
||||
<div class="form-text mb-2">Exactly 2 images required (row, 2 columns)
|
||||
<br><strong>Recommended size:</strong> 410 x 264 px each
|
||||
</div>
|
||||
<div id="galleryContainer" class="row g-3">
|
||||
<div class="col-md-6">
|
||||
@@ -287,7 +290,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-grid gap-2 d-md-flex justify-content-md-end mb-4">
|
||||
<!-- Fixed Bottom Buttons -->
|
||||
<div class="fixed-bottom-buttons">
|
||||
<a href="/admin/blog" class="btn btn-outline-secondary">
|
||||
<i class="fas fa-times me-1"></i>Cancel
|
||||
</a>
|
||||
@@ -332,10 +336,7 @@
|
||||
const tools = {
|
||||
header: {
|
||||
class: Header,
|
||||
config: {
|
||||
levels: [2, 3, 4],
|
||||
defaultLevel: 2
|
||||
}
|
||||
inlineToolbar: true
|
||||
},
|
||||
paragraph: {
|
||||
class: Paragraph,
|
||||
@@ -349,10 +350,33 @@
|
||||
}
|
||||
},
|
||||
image: {
|
||||
class: Image,
|
||||
class: ImageTool,
|
||||
config: {
|
||||
endpoints: {
|
||||
byFile: '/admin/upload/image?imageType=blog'
|
||||
},
|
||||
// Map backend response (success:true, path/url) to EditorJS expected shape
|
||||
uploader: {
|
||||
async uploadByFile(file) {
|
||||
const formData = new FormData();
|
||||
formData.append('image', file);
|
||||
|
||||
const response = await fetch('/admin/upload/image?imageType=blog', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
});
|
||||
|
||||
const result = await response.json();
|
||||
if (!response.ok || !result.success || !(result.url || result.path)) {
|
||||
throw new Error(result.error || 'Upload failed');
|
||||
}
|
||||
|
||||
const url = result.url || result.path;
|
||||
return {
|
||||
success: 1,
|
||||
file: { url }
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -839,6 +863,24 @@
|
||||
#deleteCategoryModal.show, #deleteTagModal.show {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
/* EditorJS delimiter -> render as HR line */
|
||||
.codex-editor .ce-delimiter {
|
||||
line-height: 0;
|
||||
margin: 16px 0;
|
||||
}
|
||||
|
||||
.codex-editor .ce-delimiter::before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 100%;
|
||||
border-top: 2px solid rgba(0,0,0,0.75);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.codex-editor .ce-delimiter::after {
|
||||
content: none !important; /* hide the *** */
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user