forked from UKSOURCE/cms.hailearning.edu.vn
feat: Add initial admin dashboard, login page, and main layout, including a new logo and updated gitignore.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,5 @@
|
||||
# dependencies
|
||||
node_modules/
|
||||
/public
|
||||
|
||||
# environment
|
||||
.env
|
||||
|
||||
BIN
public/img/logo/logo-hai-learning.png
Normal file
BIN
public/img/logo/logo-hai-learning.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 91 KiB |
@@ -103,24 +103,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- FAQ -->
|
||||
<div class="col-md-4 border-top">
|
||||
<div class="p-4">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<div class="rounded-circle d-flex align-items-center justify-content-center me-3"
|
||||
style="width: 50px; height: 50px; background-color: rgba(184, 183, 106, 0.1);">
|
||||
<i class="fas fa-question-circle fa-lg" style="color: var(--primary-color);"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h5 class="mb-0">FAQ</h5>
|
||||
<p class="text-muted mb-0 small">Manage FAQ</p>
|
||||
</div>
|
||||
</div>
|
||||
<a href="/admin/home/faq" class="btn btn-sm btn-primary w-100 mt-2">
|
||||
<i class="fas fa-edit me-2"></i>Edit
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Appointment -->
|
||||
<div class="col-md-4 border-end border-top">
|
||||
@@ -159,83 +142,6 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Terms & Conditions -->
|
||||
<div class="col-md-4 border-top">
|
||||
<div class="p-4">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<div class="rounded-circle d-flex align-items-center justify-content-center me-3"
|
||||
style="width: 50px; height: 50px; background-color: rgba(184, 183, 106, 0.1);">
|
||||
<i class="fas fa-file-contract fa-lg" style="color: var(--primary-color);"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h5 class="mb-0">Terms & Conditions</h5>
|
||||
<p class="text-muted mb-0 small">Manage terms</p>
|
||||
</div>
|
||||
</div>
|
||||
<a href="/admin/terms-conditions" class="btn btn-sm btn-primary w-100 mt-2">
|
||||
<i class="fas fa-edit me-2"></i>Edit
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Travel -->
|
||||
<div class="col-md-4 border-end border-top">
|
||||
<div class="p-4">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<div class="rounded-circle d-flex align-items-center justify-content-center me-3"
|
||||
style="width: 50px; height: 50px; background-color: rgba(184, 183, 106, 0.1);">
|
||||
<i class="fas fa-plane fa-lg" style="color: var(--primary-color);"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h5 class="mb-0">Travel</h5>
|
||||
<p class="text-muted mb-0 small">Manage travel</p>
|
||||
</div>
|
||||
</div>
|
||||
<a href="/admin/travel" class="btn btn-sm btn-primary w-100 mt-2">
|
||||
<i class="fas fa-edit me-2"></i>Edit
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Safety -->
|
||||
<div class="col-md-4 border-end border-top">
|
||||
<div class="p-4">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<div class="rounded-circle d-flex align-items-center justify-content-center me-3"
|
||||
style="width: 50px; height: 50px; background-color: rgba(184, 183, 106, 0.1);">
|
||||
<i class="fas fa-shield-alt fa-lg" style="color: var(--primary-color);"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h5 class="mb-0">Safety</h5>
|
||||
<p class="text-muted mb-0 small">Manage safety</p>
|
||||
</div>
|
||||
</div>
|
||||
<a href="/admin/safety" class="btn btn-sm btn-primary w-100 mt-2">
|
||||
<i class="fas fa-edit me-2"></i>Edit
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Activities -->
|
||||
<div class="col-md-4 border-end border-top">
|
||||
<div class="p-4">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<div class="rounded-circle d-flex align-items-center justify-content-center me-3"
|
||||
style="width: 50px; height: 50px; background-color: rgba(184, 183, 106, 0.1);">
|
||||
<i class="fas fa-running fa-lg" style="color: var(--primary-color);"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h5 class="mb-0">Activities</h5>
|
||||
<p class="text-muted mb-0 small">Manage activities</p>
|
||||
</div>
|
||||
</div>
|
||||
<a href="/admin/activity" class="btn btn-sm btn-primary w-100 mt-2">
|
||||
<i class="fas fa-edit me-2"></i>Edit
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Services -->
|
||||
<div class="col-md-4 border-end border-top">
|
||||
<div class="p-4">
|
||||
@@ -300,7 +206,7 @@
|
||||
<div class="card mb-4">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h5 class="mb-0">API Endpoints</h5>
|
||||
<span class="badge bg-primary">12 APIs</span>
|
||||
<span class="badge bg-primary">6 APIs</span>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div class="table-responsive">
|
||||
@@ -399,133 +305,9 @@
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="rounded-circle d-flex align-items-center justify-content-center me-2"
|
||||
style="width: 32px; height: 32px; background-color: rgba(184, 183, 106, 0.1);">
|
||||
<i class="fas fa-question-circle" style="color: var(--primary-color);"></i>
|
||||
</div>
|
||||
<span>FAQ API</span>
|
||||
</div>
|
||||
</td>
|
||||
<td><code>/api/faq</code></td>
|
||||
<td>
|
||||
<span class="badge" style="background-color: var(--primary-color)">GET</span>
|
||||
</td>
|
||||
<td>API to get FAQ data</td>
|
||||
<td>
|
||||
<a href="/api/faq" class="btn btn-sm btn-outline-primary" target="_blank">
|
||||
<i class="fas fa-external-link-alt me-1"></i>View
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="rounded-circle d-flex align-items-center justify-content-center me-2"
|
||||
style="width: 32px; height: 32px; background-color: rgba(184, 183, 106, 0.1);">
|
||||
<i class="fas fa-file-contract" style="color: var(--primary-color);"></i>
|
||||
</div>
|
||||
<span>Terms & Conditions API</span>
|
||||
</div>
|
||||
</td>
|
||||
<td><code>/api/terms</code></td>
|
||||
<td>
|
||||
<span class="badge" style="background-color: var(--primary-color)">GET</span>
|
||||
</td>
|
||||
<td>API to get terms & conditions data</td>
|
||||
<td>
|
||||
<a href="/api/terms" class="btn btn-sm btn-outline-primary" target="_blank">
|
||||
<i class="fas fa-external-link-alt me-1"></i>View
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="rounded-circle d-flex align-items-center justify-content-center me-2"
|
||||
style="width: 32px; height: 32px; background-color: rgba(184, 183, 106, 0.1);">
|
||||
<i class="fas fa-plane" style="color: var(--primary-color);"></i>
|
||||
</div>
|
||||
<span>Travel API</span>
|
||||
</div>
|
||||
</td>
|
||||
<td><code>/api/travel</code></td>
|
||||
<td>
|
||||
<span class="badge" style="background-color: var(--primary-color)">GET</span>
|
||||
</td>
|
||||
<td>API to get travel data</td>
|
||||
<td>
|
||||
<a href="/api/travel" class="btn btn-sm btn-outline-primary" target="_blank">
|
||||
<i class="fas fa-external-link-alt me-1"></i>View
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="rounded-circle d-flex align-items-center justify-content-center me-2"
|
||||
style="width: 32px; height: 32px; background-color: rgba(184, 183, 106, 0.1);">
|
||||
<i class="fas fa-shield-alt" style="color: var(--primary-color);"></i>
|
||||
</div>
|
||||
<span>Safety API</span>
|
||||
</div>
|
||||
</td>
|
||||
<td><code>/api/safety</code></td>
|
||||
<td>
|
||||
<span class="badge" style="background-color: var(--primary-color)">GET</span>
|
||||
</td>
|
||||
<td>API to get safety data</td>
|
||||
<td>
|
||||
<a href="/api/safety" class="btn btn-sm btn-outline-primary" target="_blank">
|
||||
<i class="fas fa-external-link-alt me-1"></i>View
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="rounded-circle d-flex align-items-center justify-content-center me-2"
|
||||
style="width: 32px; height: 32px; background-color: rgba(184, 183, 106, 0.1);">
|
||||
<i class="fas fa-campground" style="color: var(--primary-color);"></i>
|
||||
</div>
|
||||
<span>Camp Location API</span>
|
||||
</div>
|
||||
</td>
|
||||
<td><code>/api/camp-location</code></td>
|
||||
<td>
|
||||
<span class="badge" style="background-color: var(--primary-color)">GET</span>
|
||||
</td>
|
||||
<td>API to get camp location data</td>
|
||||
<td>
|
||||
<a href="/api/camp-location" class="btn btn-sm btn-outline-primary" target="_blank">
|
||||
<i class="fas fa-external-link-alt me-1"></i>View
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="rounded-circle d-flex align-items-center justify-content-center me-2"
|
||||
style="width: 32px; height: 32px; background-color: rgba(184, 183, 106, 0.1);">
|
||||
<i class="fas fa-sitemap" style="color: var(--primary-color);"></i>
|
||||
</div>
|
||||
<span>Menu Tree API</span>
|
||||
</div>
|
||||
</td>
|
||||
<td><code>/api/menu-tree</code></td>
|
||||
<td>
|
||||
<span class="badge" style="background-color: var(--primary-color)">GET</span>
|
||||
</td>
|
||||
<td>API to get menu tree data</td>
|
||||
<td>
|
||||
<a href="/api/menu-tree" class="btn btn-sm btn-outline-primary" target="_blank">
|
||||
<i class="fas fa-external-link-alt me-1"></i>View
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><%= title %> | CMS-SIMS</title>
|
||||
<title>
|
||||
<%= title %> | CMS-SIMS
|
||||
</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<!-- Font Awesome -->
|
||||
@@ -11,12 +14,12 @@
|
||||
<!-- Custom CSS -->
|
||||
<style>
|
||||
:root {
|
||||
--primary-color: #b8b76a;
|
||||
--primary-light: #c9c88a;
|
||||
--primary-dark: #9a994a;
|
||||
--primary-color: #2563eb;
|
||||
--primary-light: #3b82f6;
|
||||
--primary-dark: #1d4ed8;
|
||||
--text-on-primary: #ffffff;
|
||||
}
|
||||
|
||||
|
||||
body {
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
min-height: 100vh;
|
||||
@@ -24,7 +27,7 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
background-color: #3e1e00;
|
||||
background-color: #0f172a;
|
||||
}
|
||||
|
||||
body::before {
|
||||
@@ -51,7 +54,7 @@
|
||||
background-color: #f6f6f6;
|
||||
padding: 40px;
|
||||
border-radius: 15px;
|
||||
box-shadow: 0 4px 15px rgba(0,0,0,0.2);
|
||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.logo-container {
|
||||
@@ -83,7 +86,7 @@
|
||||
left: -100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
|
||||
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
|
||||
transition: all 0.5s ease;
|
||||
}
|
||||
|
||||
@@ -103,7 +106,7 @@
|
||||
.form-control:focus {
|
||||
outline: none;
|
||||
border-color: var(--primary-color) !important;
|
||||
box-shadow: 0 0 0 2px rgba(255,106,0,0.12);
|
||||
box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
|
||||
}
|
||||
|
||||
.form-label {
|
||||
@@ -114,7 +117,7 @@
|
||||
}
|
||||
|
||||
.btn-shine {
|
||||
background: linear-gradient(90deg, #9a994a, #b8b76a, #c9c88a, #d9d8aa);
|
||||
background: linear-gradient(90deg, #1d4ed8, #2563eb, #3b82f6, #60a5fa);
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 12px 30px;
|
||||
@@ -132,7 +135,7 @@
|
||||
|
||||
.btn-shine:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 5px 15px rgba(255,106,0,0.28);
|
||||
box-shadow: 0 5px 15px rgba(37, 99, 235, 0.35);
|
||||
}
|
||||
|
||||
.btn-shine::after {
|
||||
@@ -142,14 +145,14 @@
|
||||
left: -100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
|
||||
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
|
||||
transition: all 0.5s ease;
|
||||
}
|
||||
|
||||
.btn-shine:hover::after {
|
||||
left: 100%;
|
||||
}
|
||||
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.main-content {
|
||||
padding: 15px;
|
||||
@@ -161,62 +164,66 @@
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="main-content">
|
||||
<!-- Flash Messages Data (Hidden) -->
|
||||
<% if(typeof success_msg !== 'undefined' || typeof error_msg !== 'undefined' || typeof error !== 'undefined') { %>
|
||||
<div id="flash-messages-data" style="display: none;"><%- JSON.stringify({
|
||||
success_msg: typeof success_msg !== 'undefined' && success_msg ? success_msg : null,
|
||||
error_msg: typeof error_msg !== 'undefined' && error_msg ? error_msg : null,
|
||||
error: typeof error !== 'undefined' && error ? error : null
|
||||
}) %></div>
|
||||
<% } %>
|
||||
|
||||
<div class="login-container">
|
||||
<div class="logo-container img-shine">
|
||||
<img src="/images/Logo_round.jpg" alt="Logo">
|
||||
</div>
|
||||
<% if(typeof success_msg !=='undefined' || typeof error_msg !=='undefined' || typeof error !=='undefined' ) { %>
|
||||
<div id="flash-messages-data" style="display: none;"><%- JSON.stringify({ success_msg: typeof success_msg
|
||||
!=='undefined' && success_msg ? success_msg : null, error_msg: typeof error_msg !=='undefined' && error_msg ?
|
||||
error_msg : null, error: typeof error !=='undefined' && error ? error : null }) %></div>
|
||||
<% } %>
|
||||
|
||||
<div style="text-align: center; margin-bottom: 30px;">
|
||||
<h4 style="color: var(--primary-color); font-weight: 600; margin-bottom: 10px;">CMS Management System</h4>
|
||||
<p style="color: var(--text-color); font-size: 14px;">Welcome to Content Management System</p>
|
||||
</div>
|
||||
<div class="login-container">
|
||||
<div class="logo-container img-shine">
|
||||
<img src="/img/logo/logo-hai-learning.png" alt="Logo">
|
||||
</div>
|
||||
|
||||
<form action="/auth/login" method="POST" class="login-form">
|
||||
<div class="form-group" style="margin-bottom: 20px;">
|
||||
<label for="username" class="form-label">Username</label>
|
||||
<input type="text" class="form-control" id="username" name="username" required autocomplete="username" autofocus>
|
||||
<div style="text-align: center; margin-bottom: 30px;">
|
||||
<h4 style="color: var(--primary-color); font-weight: 600; margin-bottom: 10px;">CMS Management System</h4>
|
||||
<p style="color: var(--text-color); font-size: 14px;">Welcome to Content Management System</p>
|
||||
</div>
|
||||
|
||||
<form action="/auth/login" method="POST" class="login-form">
|
||||
<div class="form-group" style="margin-bottom: 20px;">
|
||||
<label for="username" class="form-label">Username</label>
|
||||
<input type="text" class="form-control" id="username" name="username" required autocomplete="username"
|
||||
autofocus>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-bottom: 20px;">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password" required
|
||||
autocomplete="current-password">
|
||||
|
||||
<a href="/auth/forgot-password"
|
||||
style="display: block; text-align: right; margin-top: 8px; color: #2563eb; text-decoration: none; font-size: 13px;">
|
||||
Forgot Your Password?
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center; margin-top: 30px;">
|
||||
<button type="submit" class="btn-shine">
|
||||
Login
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-bottom: 20px;">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password" required autocomplete="current-password">
|
||||
|
||||
<a href="/auth/forgot-password" style="display: block; text-align: right; margin-top: 8px; color: #b8b76a; text-decoration: none; font-size: 13px;">
|
||||
Forgot Your Password?
|
||||
</a>
|
||||
<div style="margin-top: 20px; text-align: center;">
|
||||
<p style="font-size: 12px; color: #fff;">© 2024 Swiss Institute of Management and Sciences. All rights
|
||||
reserved.</p>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center; margin-top: 30px;">
|
||||
<button type="submit" class="btn-shine">
|
||||
Login
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 20px; text-align: center;">
|
||||
<p style="font-size: 12px; color: #fff;">© 2024 Swiss Institute of Management and Sciences. All rights reserved.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
|
||||
<!-- Toast JS -->
|
||||
<script src="/js/toast.js"></script>
|
||||
|
||||
|
||||
<!-- Flash Handler JS -->
|
||||
<script src="/js/flash-handler.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -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.`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user