feat: Add initial admin dashboard, login page, and main layout, including a new logo and updated gitignore.

This commit is contained in:
LNHA
2026-02-07 10:29:10 +07:00
parent 84097e6ed6
commit 09f5c12a2f
5 changed files with 95 additions and 355 deletions

View File

@@ -2,7 +2,7 @@
<html lang="en">
<head>
<link rel="icon" type="image/png" href="/uploads/layout/favicon.png" />
<link rel="icon" type="image/png" href="/img/favicon.png" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>
@@ -701,7 +701,7 @@
<span class="nav-link text-muted px-2">|</span>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle <%= currentPath === '/admin/home' || currentPath === '/admin/header' || currentPath === '/admin/footer' || currentPath === '/admin/home/faq' || currentPath === '/admin/home/testimonials' || currentPath === '/admin/home/video-gallery' ? 'active' : '' %>"
<a class="nav-link dropdown-toggle <%= currentPath === '/admin/home' || currentPath === '/admin/header' || currentPath === '/admin/footer' ? 'active' : '' %>"
href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Home
</a>
@@ -710,18 +710,6 @@
<a class="dropdown-item <%= currentPath === '/admin/home' ? 'active' : '' %>"
href="/admin/home">Homepage</a>
</li>
<li>
<a class="dropdown-item <%= currentPath === '/admin/home/faq' ? 'active' : '' %>"
href="/admin/home/faq">FAQ</a>
</li>
<li>
<a class="dropdown-item <%= currentPath === '/admin/home/testimonials' ? 'active' : '' %>"
href="/admin/home/testimonials">Testimonials</a>
</li>
<li>
<a class="dropdown-item <%= currentPath === '/admin/home/video-gallery' ? 'active' : '' %>"
href="/admin/home/video-gallery">Video Gallery</a>
</li>
<li>
<a class="dropdown-item <%= currentPath === '/admin/header' ? 'active' : '' %>"
href="/admin/header">Header & Menu</a>
@@ -732,49 +720,13 @@
</li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle <%= currentPath === '/admin/about-us' || currentPath === '/admin/safety' || currentPath === '/admin/faq' || currentPath === '/admin/insurance' || currentPath === '/admin/travel' || currentPath === '/admin/terms-conditions' ? 'active' : '' %>"
href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
About
</a>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item <%= currentPath === '/admin/about-us' ? 'active' : '' %>"
href="/admin/about-us">About us</a>
</li>
<li>
<a class="dropdown-item <%= currentPath === '/admin/safety' ? 'active' : '' %>"
href="/admin/safety">Safety</a>
</li>
<li>
<a class="dropdown-item <%= currentPath === '/admin/insurance' ? 'active' : '' %>"
href="/admin/insurance">Insurance</a>
</li>
<li>
<a class="dropdown-item <%= currentPath === '/admin/travel' ? 'active' : '' %>"
href="/admin/travel">Travel</a>
</li>
<li>
<a class="dropdown-item <%= currentPath === '/admin/terms-conditions' ? 'active' : '' %>"
href="/admin/terms-conditions">Terms & Conditions</a>
</li>
</ul>
<li class="nav-item">
<a class="nav-link <%= currentPath === '/admin/about-us' ? 'active' : '' %>"
href="/admin/about-us">About</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle <%= currentPath === '/admin/service' || currentPath === '/admin/activity' ? 'active' : '' %>"
href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Services
</a>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item <%= currentPath === '/admin/service' ? 'active' : '' %>"
href="/admin/service">Service</a>
</li>
<li>
<a class="dropdown-item <%= currentPath === '/admin/activity' ? 'active' : '' %>"
href="/admin/activity">Activity & Booking</a>
</li>
</ul>
<li class="nav-item">
<a class="nav-link <%= currentPath === '/admin/service' ? 'active' : '' %>"
href="/admin/service">Services</a>
</li>
<li class="nav-item">
<a class="nav-link <%= currentPath === '/admin/blog' ? 'active' : '' %>" href="/admin/blog">Blog</a>
@@ -1006,7 +958,7 @@
if (!response.ok) {
throw new Error('Failed to load footer data');
}
const footerData = await response.json();
renderFooter(footerData);
} catch (error) {
@@ -1019,7 +971,7 @@
function renderFooter(data) {
const footerContent = document.getElementById('footerContent');
const footerCopyright = document.getElementById('footerCopyright');
if (!footerContent || !footerCopyright) return;
let footerHTML = '';
@@ -1030,8 +982,8 @@
<div class="col-md-4 mb-4 mb-md-0">
<h5 class="mb-3">${escapeHtml(data.about.title || 'About Us')}</h5>
${data.about.description ? `<p>${escapeHtml(data.about.description)}</p>` : ''}
${data.about.mapLink && data.about.mapLink.url ?
`<p><a href="${escapeHtml(data.about.mapLink.url)}" target="_blank" class="text-decoration-none hover-opacity">
${data.about.mapLink && data.about.mapLink.url ?
`<p><a href="${escapeHtml(data.about.mapLink.url)}" target="_blank" class="text-decoration-none hover-opacity">
<i class="fas fa-map-marker-alt me-2"></i>${escapeHtml(data.about.mapLink.text || 'View on Map')}
</a></p>` : ''}
</div>
@@ -1042,7 +994,7 @@
if (data.columns && Array.isArray(data.columns)) {
// Sort columns by order if available, otherwise maintain array order
const sortedColumns = data.columns.sort((a, b) => (a.order || 0) - (b.order || 0));
sortedColumns.forEach(column => {
if (column.title || (column.links && column.links.length > 0)) {
footerHTML += `
@@ -1050,13 +1002,13 @@
${column.title ? `<h5 class="mb-3">${escapeHtml(column.title)}</h5>` : ''}
${column.links && column.links.length > 0 ? `
<ul class="list-unstyled">
${column.links.map(link =>
`<li class="mb-2">
${column.links.map(link =>
`<li class="mb-2">
<a href="${escapeHtml(link.url || '#')}" class="text-decoration-none hover-opacity">
${escapeHtml(link.title || 'Link')}
</a>
</li>`
).join('')}
).join('')}
</ul>
` : ''}
</div>
@@ -1094,12 +1046,12 @@
${data.address && data.address.text ? `
<p class="mb-2">
<i class="fas fa-map-marker-alt me-2"></i>
${data.address.mapUrl ?
`<a href="${escapeHtml(data.address.mapUrl)}" target="_blank" class="text-decoration-none">
${data.address.mapUrl ?
`<a href="${escapeHtml(data.address.mapUrl)}" target="_blank" class="text-decoration-none">
${escapeHtml(data.address.text)}
</a>` :
escapeHtml(data.address.text)
}
</a>` :
escapeHtml(data.address.text)
}
</p>
` : ''}
</div>
@@ -1110,19 +1062,19 @@
if (data.social && data.social.links && Array.isArray(data.social.links) && data.social.links.length > 0) {
// Sort social links by order if available
const sortedSocials = data.social.links.sort((a, b) => (a.order || 0) - (b.order || 0));
footerHTML += `
<div class="col-12 mt-3">
<div class="text-center">
<h6 class="mb-3">Follow Us</h6>
<div class="d-flex justify-content-center gap-3">
${sortedSocials.map(social =>
`<a href="${escapeHtml(social.url || '#')}" target="_blank"
${sortedSocials.map(social =>
`<a href="${escapeHtml(social.url || '#')}" target="_blank"
class="text-decoration-none hover-opacity"
title="${escapeHtml(social.platform || 'Social Link')}">
<i class="fab fa-${escapeHtml(social.icon || 'link')} fa-lg"></i>
</a>`
).join('')}
).join('')}
</div>
</div>
</div>
@@ -1134,10 +1086,10 @@
// Update copyright
const currentYear = new Date().getFullYear();
const copyrightText = data.copyright && data.copyright.text ?
data.copyright.text :
const copyrightText = data.copyright && data.copyright.text ?
data.copyright.text :
`© ${currentYear} Website. All rights reserved.`;
footerCopyright.innerHTML = copyrightText;
}
@@ -1145,7 +1097,7 @@
function renderFallbackFooter() {
const footerContent = document.getElementById('footerContent');
const footerCopyright = document.getElementById('footerCopyright');
if (footerContent) {
footerContent.innerHTML = `
<div class="col-md-4 mb-4 mb-md-0">
@@ -1171,7 +1123,7 @@
</div>
`;
}
if (footerCopyright) {
footerCopyright.innerHTML = `© ${new Date().getFullYear()} CMS-GGCamp. All rights reserved.`;
}