refactor: remove camp location functionality

This commit is contained in:
Wini_Fy
2026-02-05 10:52:27 +07:00
parent 00f93cefab
commit 7dd52d8669
15 changed files with 291 additions and 1070 deletions

View File

@@ -540,10 +540,25 @@
// Lưu đúng relative path vào input (ví dụ: /uploads/blog/xxx.png)
input.value = result.path;
// Show preview sử dụng đúng data gốc (không gắn thêm URL)
// Helper function để tạo full URL
const backendUrl = '<%= typeof backendUrl !== "undefined" ? backendUrl : "http://localhost:3001" %>';
const getFullImageUrl = function(imagePath, baseUrl) {
if (!imagePath) return "";
if (imagePath.startsWith("http://") || imagePath.startsWith("https://")) {
return imagePath;
}
const base = (baseUrl || "http://localhost:3001").replace(/\/$/, "");
let imgSrc = imagePath;
if (!imgSrc.startsWith("/")) {
imgSrc = "/" + imgSrc;
}
return base + imgSrc;
};
// Show preview sử dụng helper function
if (targetInput === 'featuredImageUrl') {
const preview = document.getElementById('featuredImagePreview');
const previewUrl = result.path || '';
const previewUrl = getFullImageUrl(result.path, backendUrl);
preview.innerHTML = `
<img src="${previewUrl}" class="img-thumbnail"
style="max-width: 300px; max-height: 200px; object-fit: cover;"
@@ -553,7 +568,7 @@
const index = targetInput.split('_')[1];
const preview = document.getElementById(`galleryPreview_${index}`);
if (preview) {
const previewUrl = result.path || '';
const previewUrl = getFullImageUrl(result.path, backendUrl);
preview.innerHTML = `
<img src="${previewUrl}" class="img-thumbnail"
style="max-width: 200px; max-height: 150px; object-fit: cover;"

View File

@@ -72,7 +72,7 @@
</div>
<div id="featuredImagePreview" class="mt-2">
<% if (blog.featuredImage) { %>
<img src="<%= blog.featuredImage %>"
<img src="<%= getFullImageUrl(blog.featuredImage, backendUrl) %>"
class="img-thumbnail"
style="max-width: 300px; max-height: 200px; object-fit: cover;"
alt="Featured image preview">
@@ -134,7 +134,7 @@
</div>
<div id="galleryPreview_0" class="mt-2">
<% if (image1) { %>
<img src="<%= image1 %>"
<img src="<%= getFullImageUrl(image1, backendUrl) %>"
class="img-thumbnail"
style="max-width: 200px; max-height: 150px; object-fit: cover;"
alt="Gallery image 1 preview">
@@ -157,7 +157,7 @@
</div>
<div id="galleryPreview_1" class="mt-2">
<% if (image2) { %>
<img src="<%= image2 %>"
<img src="<%= getFullImageUrl(image2, backendUrl) %>"
class="img-thumbnail"
style="max-width: 200px; max-height: 150px; object-fit: cover;"
alt="Gallery image 2 preview">
@@ -958,11 +958,23 @@
input.value = result.path;
// Show preview
const backendUrl = '<%= typeof backendUrl !== "undefined" ? backendUrl : "http://localhost:3001" %>';
const getFullImageUrl = function(imagePath, baseUrl) {
if (!imagePath) return "";
if (imagePath.startsWith("http://") || imagePath.startsWith("https://")) {
return imagePath;
}
const base = (baseUrl || "http://localhost:3001").replace(/\/$/, "");
let imgSrc = imagePath;
if (!imgSrc.startsWith("/")) {
imgSrc = "/" + imgSrc;
}
return base + imgSrc;
};
if (targetInput === 'featuredImageUrl') {
const preview = document.getElementById('featuredImagePreview');
const previewUrl = (result.path && (result.path.startsWith('http://') || result.path.startsWith('https://')))
? result.path
: (window.location.origin + result.path);
const previewUrl = getFullImageUrl(result.path, backendUrl);
preview.innerHTML = `
<img src="${previewUrl}" class="img-thumbnail"
style="max-width: 300px; max-height: 200px; object-fit: cover;"
@@ -972,9 +984,7 @@
const index = targetInput.split('_')[1];
const preview = document.getElementById(`galleryPreview_${index}`);
if (preview) {
const previewUrl = (result.path && (result.path.startsWith('http://') || result.path.startsWith('https://')))
? result.path
: (window.location.origin + result.path);
const previewUrl = getFullImageUrl(result.path, backendUrl);
preview.innerHTML = `
<img src="${previewUrl}" class="img-thumbnail"
style="max-width: 200px; max-height: 150px; object-fit: cover;"

View File

@@ -84,7 +84,7 @@
<tr>
<td>
<% if (blog.featuredImage) { %>
<img src="<%= blog.featuredImage %>"
<img src="<%= getFullImageUrl(blog.featuredImage, backendUrl) %>"
alt="<%= blog.title %>" class="img-thumbnail"
style="width: 50px; height: 50px; object-fit: cover;">
<% } else { %>

View File

@@ -690,7 +690,7 @@
<div>
<div class="text-muted small">Version</div>
<div class="fw-bold" style="color: var(--primary-color)">
CMS-SIMS v1.0.0
CMS.HAILearning v1.0.0
</div>
</div>
</div>

View File

@@ -1219,7 +1219,7 @@
class="form-control"
id="faqContactInfo"
value="<%= data.faq?.contact?.info || '' %>"
placeholder="e.g., +(123) 456-789 | office@ggcamp.org"
placeholder="e.g., +(123) 456-789 | info@hailearning.edu.vn"
/>
</div>
</div>

View File

@@ -105,7 +105,7 @@
<div class="card-body p-4 p-lg-5">
<div class="row align-items-center">
<div class="col-lg-8 mx-auto text-center">
<h2 class="fw-bold mb-4 text-white">Start Using CMS-GGCamp Today</h2>
<h2 class="fw-bold mb-4 text-white">Start Using CMS.HAILearning Today</h2>
<p class="lead mb-4 text-white-50">Experience simple and effective API management system</p>
<a href="/admin/dashboard" class="btn btn-lg"
style="background-color: white; color: var(--primary-color); font-weight: 600; border-radius: 10px; padding: 12px 30px;">

View File

@@ -6,7 +6,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>
<%= typeof title !=='undefined' ? title + ' | ' : '' %>CMS-GGCamp
<%= typeof title !=='undefined' ? title + ' | ' : '' %>CMS.HAILearning
</title>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" />
@@ -81,9 +81,6 @@
<li class="nav-item">
<a class="nav-link" href="/admin/safety">Safety</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/admin/camp-location">Camp Location</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/admin/blog">Blog</a>
</li>

View File

@@ -6,7 +6,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>
<%= typeof title !=='undefined' ? title + ' | ' : '' %>CMS-GGCamp
<%= typeof title !=='undefined' ? title + ' | ' : '' %>CMS.HAILearning
</title>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" />
@@ -15,9 +15,9 @@
<!-- Custom CSS -->
<style>
:root {
--primary-color: #bc9f69;
--primary-light: #bba57c;
--primary-dark: #be9d5f;
--primary-color: #0048b4;
--primary-light: #003a8f;
--primary-dark: #002a6f;
--secondary-color: #f5f5e8;
--text-light: #black;
}
@@ -173,7 +173,7 @@
}
footer {
background: linear-gradient(90deg, var(--primary-dark), var(--primary-color), var(--primary-light), #d4c4a8);
background: linear-gradient(90deg, var(--primary-dark), var(--primary-color), var(--primary-light), #0048b4);
color: white;
margin-top: 3rem;
}
@@ -679,15 +679,13 @@
<nav class="navbar navbar-expand-lg navbar-light sticky-top">
<div class="container">
<a class="navbar-brand d-flex align-items-center" href="/">
<img src="/images/Logo_round.jpg" alt="Logo" style="
width: 40px;
height: 40px;
<img src="/img/logo/logo-hai-learning.png" alt="Logo" style="
width: 45px;
height: 45px;
border-radius: 50%;
margin-right: 10px;
background-color: var(--primary-color);
padding: 5px;
" />
CMS-GGCamp
CMS.HAILearning
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
@@ -784,10 +782,6 @@
<a class="nav-link <%= currentPath === '/admin/pricing' ? 'active' : '' %>"
href="/admin/pricing">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link <%= currentPath === '/admin/camp-location' ? 'active' : '' %>"
href="/admin/camp-location">Camp Location</a>
</li>
</ul>
<div class="d-flex align-items-center">
<% if (locals.user) { %>
@@ -824,7 +818,7 @@
<div class="container py-4">
<div class="row">
<div class="col-md-4 mb-4 mb-md-0">
<h5 class="mb-3">CMS-GGCamp</h5>
<h5 class="mb-3">CMS.HAILearning</h5>
<p>Simple and effective API management system.</p>
</div>
<div class="col-md-4 mb-4 mb-md-0">
@@ -844,17 +838,20 @@
<div class="col-md-4">
<h5 class="mb-3">Contact</h5>
<p class="mb-2">
<i class="fas fa-envelope me-2"></i> office@ggcamp.org
<i class="fas fa-map-marker-alt me-2"></i> 734 Luy Ban Bich St., Tan Thanh Ward, Tan Phu Dist, HCMC
</p>
<p class="mb-2">
<i class="fas fa-phone me-2"></i> 12345678
<i class="fas fa-envelope me-2"></i> <a href="mailto:get-info@hai.edu.vn" class="text-decoration-none hover-opacity">get-info@hai.edu.vn</a>
</p>
<p class="mb-2">
<i class="fas fa-globe me-2"></i> <a href="https://hai.edu.vn" target="_blank" class="text-decoration-none hover-opacity">hai.edu.vn</a>
</p>
</div>
</div>
<hr class="my-4" />
<div class="text-center">
<p class="mb-0">
&copy; <%= new Date().getFullYear() %> CMS-GGCamp. All rights
&copy; <%= new Date().getFullYear() %> CMS.HAILearning. All rights
reserved.
</p>
</div>