forked from UKSOURCE/cms.hailearning.edu.vn
refactor: update primary color scheme and remove camp location functionality from admin routes and views
This commit is contained in:
@@ -10,7 +10,6 @@ const footerController = require("../controllers/footerController");
|
||||
const aboutUsController = require("../controllers/aboutUsController");
|
||||
const formController = require("../controllers/formController");
|
||||
const contactController = require("../controllers/contactController");
|
||||
const campLocationController = require("../controllers/campLocationController");
|
||||
const pageController = require("../controllers/pageController");
|
||||
const settingController = require("../controllers/settingController");
|
||||
const faqController = require("../controllers/faqController"); // Thêm import này
|
||||
@@ -224,13 +223,6 @@ router.put(
|
||||
// Safety routes
|
||||
router.get("/safety", ensureAuthenticated, safetyController.index);
|
||||
router.post("/safety/update", ensureAuthenticated, safetyController.update);
|
||||
// Camp Location routes
|
||||
router.get("/camp-location", ensureAuthenticated, campLocationController.index);
|
||||
router.post(
|
||||
"/camp-location/update",
|
||||
ensureAuthenticated,
|
||||
campLocationController.update,
|
||||
);
|
||||
|
||||
//Insurance routes
|
||||
router.get("/insurance", ensureAuthenticated, insuranceController.index);
|
||||
@@ -265,65 +257,6 @@ router.post(
|
||||
serviceController.updateDetails,
|
||||
);
|
||||
|
||||
// Test Image Paths route
|
||||
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) => {
|
||||
if (camp.image) {
|
||||
imagePaths.push({
|
||||
type: "Camp",
|
||||
name: camp.title,
|
||||
path: camp.image,
|
||||
exists: fs.existsSync(path.join(__dirname, "../public", camp.image)),
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Locations images
|
||||
if (campLocationData.locations) {
|
||||
campLocationData.locations.forEach((location) => {
|
||||
if (location.imageSrc) {
|
||||
imagePaths.push({
|
||||
type: "Location",
|
||||
name: location.title,
|
||||
path: location.imageSrc,
|
||||
exists: fs.existsSync(path.join(__dirname, "../public", location.imageSrc)),
|
||||
});
|
||||
}
|
||||
|
||||
// Program images
|
||||
if (location.programOptions) {
|
||||
location.programOptions.forEach((program) => {
|
||||
if (program.imageSrc) {
|
||||
imagePaths.push({
|
||||
type: "Program",
|
||||
name: program.title,
|
||||
path: program.imageSrc,
|
||||
exists: fs.existsSync(path.join(__dirname, "../public", program.imageSrc)),
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
res.render("admin/test-images", {
|
||||
layout: "layouts/admin",
|
||||
title: "Test Image Paths",
|
||||
images: imagePaths,
|
||||
user: req.session.user,
|
||||
});
|
||||
});
|
||||
|
||||
// Display visa management page
|
||||
router.get("/visa", ensureAuthenticated, visaController.index);
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ const faqController = require("../controllers/faqController");
|
||||
const visaController = require("../controllers/visaController");
|
||||
const headerMenuController = require("../controllers/headerMenuController");
|
||||
const safetyController = require("../controllers/safetyController");
|
||||
const campLocationController = require("../controllers/campLocationController");
|
||||
// Booking flow removed
|
||||
|
||||
const insuranceController = require("../controllers/insuranceController");
|
||||
@@ -83,10 +82,6 @@ router.get("/api/safety", safetyController.api);
|
||||
// Activity API routes
|
||||
router.get("/api/activities", activityController.api);
|
||||
router.get("/api/activities/:id", activityController.apiDetail);
|
||||
|
||||
// Camp Location API route
|
||||
router.get("/api/camp-location", campLocationController.api);
|
||||
// Booking routes removed
|
||||
// Insurance APi route
|
||||
router.get("/api/insurance", insuranceController.api);
|
||||
|
||||
@@ -127,16 +122,6 @@ router.get(
|
||||
bookingSubmissionController.getSessionAvailability,
|
||||
);
|
||||
|
||||
// New API for creating bookings directly into camp sessions (by program)
|
||||
router.post("/api/camps/:program/sessions/:sessionId/bookings", activityController.createSessionBookingByProgram);
|
||||
router.get("/api/camps/:program/sessions/:sessionId/bookings", activityController.getSessionBookingsByProgram);
|
||||
// Keep admin-style update/delete by activityId (protected) if needed
|
||||
router.put("/api/camps/:activityId/sessions/:sessionId/bookings/:bookingId", activityController.updateSessionBooking);
|
||||
router.delete(
|
||||
"/api/camps/:activityId/sessions/:sessionId/bookings/:bookingId",
|
||||
activityController.deleteSessionBooking,
|
||||
);
|
||||
|
||||
// Demo booking form
|
||||
router.get("/demo/booking-form", (req, res) => {
|
||||
res.sendFile(path.join(__dirname, "../views/demo/booking-form.html"));
|
||||
|
||||
Reference in New Issue
Block a user