From b8913702ae9c4851386c4e6dada7d1992f0d9e92 Mon Sep 17 00:00:00 2001 From: Holly Date: Sat, 28 Sep 2024 10:32:33 +0100 Subject: [PATCH] move templates to views --- server/index.ts | 2 +- server/objects/RequestCtx.ts | 2 +- server/package-lock.json | 16 ++++++++-------- server/package.json | 4 ++-- server/{templates => views}/404.ejs | 0 .../account/changeusername.ejs | 0 server/{templates => views}/account/login.ejs | 0 server/{templates => views}/account/register.ejs | 0 server/{templates => views}/admin/badge.ejs | 0 server/{templates => views}/admin/badges.ejs | 0 server/{templates => views}/admin/index.ejs | 0 server/{templates => views}/admin/parties.ejs | 0 server/{templates => views}/admin/users.ejs | 0 server/{templates => views}/base/footer.ejs | 0 server/{templates => views}/base/header.ejs | 0 server/{templates => views}/home/home.ejs | 0 server/{templates => views}/home/index.ejs | 0 server/{templates => views}/party/createEdit.ejs | 0 server/{templates => views}/party/join.ejs | 0 19 files changed, 12 insertions(+), 12 deletions(-) rename server/{templates => views}/404.ejs (100%) rename server/{templates => views}/account/changeusername.ejs (100%) rename server/{templates => views}/account/login.ejs (100%) rename server/{templates => views}/account/register.ejs (100%) rename server/{templates => views}/admin/badge.ejs (100%) rename server/{templates => views}/admin/badges.ejs (100%) rename server/{templates => views}/admin/index.ejs (100%) rename server/{templates => views}/admin/parties.ejs (100%) rename server/{templates => views}/admin/users.ejs (100%) rename server/{templates => views}/base/footer.ejs (100%) rename server/{templates => views}/base/header.ejs (100%) rename server/{templates => views}/home/home.ejs (100%) rename server/{templates => views}/home/index.ejs (100%) rename server/{templates => views}/party/createEdit.ejs (100%) rename server/{templates => views}/party/join.ejs (100%) diff --git a/server/index.ts b/server/index.ts index ef4fbb3..3067366 100644 --- a/server/index.ts +++ b/server/index.ts @@ -78,7 +78,7 @@ fastify.register(FastifyStatic, { }); fastify.setNotFoundHandler(async (req, res) => { - return res.status(404).view("templates/404.ejs", { }); + return res.status(404).view("views/404.ejs", { }); }); Controller.FastifyInstance = fastify; diff --git a/server/objects/RequestCtx.ts b/server/objects/RequestCtx.ts index 7b451d9..5607fe3 100644 --- a/server/objects/RequestCtx.ts +++ b/server/objects/RequestCtx.ts @@ -32,7 +32,7 @@ export default class RequestCtx { viewModel["session"] = this.session; // @ts-ignore inject enums viewModel["UserLevel"] = UserLevel; - return this.res.view(`templates/${this.controllerName}/${viewName}.ejs`, viewModel); + return this.res.view(`views/${this.controllerName}/${viewName}.ejs`, viewModel); } // TODO: query params diff --git a/server/package-lock.json b/server/package-lock.json index 82034a2..a056d75 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -23,13 +23,13 @@ }, "devDependencies": { "@types/ejs": "^3.1.5", - "@types/node": "^22.6.0", + "@types/node": "^22.7.4", "@types/ws": "^8.5.12", "@vercel/ncc": "^0.38.2", "check-outdated": "^2.12.0", "nodemon": "^3.1.7", "npm-run-all": "^4.1.5", - "terser": "^5.33.0", + "terser": "^5.34.1", "ts-node": "^10.9.2", "typescript": "^5.6.2" } @@ -279,9 +279,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "22.6.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.6.0.tgz", - "integrity": "sha512-QyR8d5bmq+eR72TwQDfujwShHMcIrWIYsaQFtXRE58MHPTEKUNxjxvl0yS0qPMds5xbSDWtp7ZpvGFtd7dfMdQ==", + "version": "22.7.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.4.tgz", + "integrity": "sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==", "dev": true, "license": "MIT", "dependencies": { @@ -3237,9 +3237,9 @@ } }, "node_modules/terser": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.33.0.tgz", - "integrity": "sha512-JuPVaB7s1gdFKPKTelwUyRq5Sid2A3Gko2S0PncwdBq7kN9Ti9HPWDQ06MPsEDGsZeVESjKEnyGy68quBk1w6g==", + "version": "5.34.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.34.1.tgz", + "integrity": "sha512-FsJZ7iZLd/BXkz+4xrRTGJ26o/6VTjQytUk8b8OxkwcD2I+79VPJlz7qss1+zE7h8GNIScFqXcDyJ/KqBYZFVA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { diff --git a/server/package.json b/server/package.json index 23a7c81..e8466eb 100644 --- a/server/package.json +++ b/server/package.json @@ -29,13 +29,13 @@ }, "devDependencies": { "@types/ejs": "^3.1.5", - "@types/node": "^22.6.0", + "@types/node": "^22.7.4", "@types/ws": "^8.5.12", "@vercel/ncc": "^0.38.2", "check-outdated": "^2.12.0", "nodemon": "^3.1.7", "npm-run-all": "^4.1.5", - "terser": "^5.33.0", + "terser": "^5.34.1", "ts-node": "^10.9.2", "typescript": "^5.6.2" } diff --git a/server/templates/404.ejs b/server/views/404.ejs similarity index 100% rename from server/templates/404.ejs rename to server/views/404.ejs diff --git a/server/templates/account/changeusername.ejs b/server/views/account/changeusername.ejs similarity index 100% rename from server/templates/account/changeusername.ejs rename to server/views/account/changeusername.ejs diff --git a/server/templates/account/login.ejs b/server/views/account/login.ejs similarity index 100% rename from server/templates/account/login.ejs rename to server/views/account/login.ejs diff --git a/server/templates/account/register.ejs b/server/views/account/register.ejs similarity index 100% rename from server/templates/account/register.ejs rename to server/views/account/register.ejs diff --git a/server/templates/admin/badge.ejs b/server/views/admin/badge.ejs similarity index 100% rename from server/templates/admin/badge.ejs rename to server/views/admin/badge.ejs diff --git a/server/templates/admin/badges.ejs b/server/views/admin/badges.ejs similarity index 100% rename from server/templates/admin/badges.ejs rename to server/views/admin/badges.ejs diff --git a/server/templates/admin/index.ejs b/server/views/admin/index.ejs similarity index 100% rename from server/templates/admin/index.ejs rename to server/views/admin/index.ejs diff --git a/server/templates/admin/parties.ejs b/server/views/admin/parties.ejs similarity index 100% rename from server/templates/admin/parties.ejs rename to server/views/admin/parties.ejs diff --git a/server/templates/admin/users.ejs b/server/views/admin/users.ejs similarity index 100% rename from server/templates/admin/users.ejs rename to server/views/admin/users.ejs diff --git a/server/templates/base/footer.ejs b/server/views/base/footer.ejs similarity index 100% rename from server/templates/base/footer.ejs rename to server/views/base/footer.ejs diff --git a/server/templates/base/header.ejs b/server/views/base/header.ejs similarity index 100% rename from server/templates/base/header.ejs rename to server/views/base/header.ejs diff --git a/server/templates/home/home.ejs b/server/views/home/home.ejs similarity index 100% rename from server/templates/home/home.ejs rename to server/views/home/home.ejs diff --git a/server/templates/home/index.ejs b/server/views/home/index.ejs similarity index 100% rename from server/templates/home/index.ejs rename to server/views/home/index.ejs diff --git a/server/templates/party/createEdit.ejs b/server/views/party/createEdit.ejs similarity index 100% rename from server/templates/party/createEdit.ejs rename to server/views/party/createEdit.ejs diff --git a/server/templates/party/join.ejs b/server/views/party/join.ejs similarity index 100% rename from server/templates/party/join.ejs rename to server/views/party/join.ejs