feat: Implement core admin panel functionalities including appointment, contact, and pricing management with associated models, controllers, views, and routes.

This commit is contained in:
LNHA
2026-02-03 14:58:00 +07:00
parent d1b931d547
commit df8e1f9665
25 changed files with 4574 additions and 659 deletions

View File

@@ -151,6 +151,52 @@ router.get(
contactController.getContactData
);
// Contact submissions management
router.get(
"/contact/submissions",
ensureAuthenticated,
contactController.getSubmissions
);
router.put(
"/contact/submissions/:id",
ensureAuthenticated,
contactController.updateSubmissionStatus
);
// Appointment management
const appointmentController = require("../controllers/appointmentController");
router.get(
"/appointments",
ensureAuthenticated,
appointmentController.getAppointments
);
router.get(
"/appointments/:id",
ensureAuthenticated,
appointmentController.getAppointmentById
);
router.put(
"/appointments/:id",
ensureAuthenticated,
appointmentController.updateAppointmentStatus
);
router.delete(
"/appointments/:id",
ensureAuthenticated,
appointmentController.deleteAppointment
);
// Appointment CMS page management
router.get("/appointment", ensureAuthenticated, appointmentController.index);
router.post("/appointment/update", ensureAuthenticated, appointmentController.update);
router.get("/appointment/data", ensureAuthenticated, appointmentController.getAppointmentData);
// Pricing CMS page management
const pricingController = require("../controllers/pricingController");
router.get("/pricing", ensureAuthenticated, pricingController.index);
router.post("/pricing/update", ensureAuthenticated, pricingController.update);
router.get("/pricing/data", ensureAuthenticated, pricingController.getPricingData);
// Activity CRUD routes
router.get("/activity", ensureAuthenticated, activityController.index);
router.get(
@@ -290,10 +336,10 @@ router.get("/test-images", ensureAuthenticated, (req, res) => {
const fs = require('fs');
const path = require('path');
const campLocationData = require('../data/camp-location.json');
// Collect all image paths
const imagePaths = [];
// Camps images
if (campLocationData.camps) {
campLocationData.camps.forEach(camp => {
@@ -307,7 +353,7 @@ router.get("/test-images", ensureAuthenticated, (req, res) => {
}
});
}
// Locations images
if (campLocationData.locations) {
campLocationData.locations.forEach(location => {
@@ -319,7 +365,7 @@ router.get("/test-images", ensureAuthenticated, (req, res) => {
exists: fs.existsSync(path.join(__dirname, '../public', location.imageSrc))
});
}
// Program images
if (location.programOptions) {
location.programOptions.forEach(program => {
@@ -335,7 +381,7 @@ router.get("/test-images", ensureAuthenticated, (req, res) => {
}
});
}
res.render('admin/test-images', {
layout: 'layouts/admin',
title: 'Test Image Paths',