Code refactor

This commit is contained in:
2025-06-07 10:12:47 +02:00
parent c85b918f71
commit 1e5cd0790b
10 changed files with 38 additions and 19 deletions
+5
View File
@@ -13,6 +13,7 @@ const router = express.Router();
function errorPageRenderer(res, emoji, message) {
res.render("error", {
page_title: app_conf.name,
program: app_conf.program,
css_path: path.join(app_conf.paths.css.web, "stylesheet.css"),
js_path: path.join(app_conf.paths.js.web, "error.js"),
error_emoji: emoji,
@@ -180,6 +181,7 @@ router.get("/add", async (req, res) => {
table_data += "</tr>";
res.render("add", {
page_title: app_conf.name,
program: app_conf.program,
css_path: path.join(app_conf.paths.css.web, "stylesheet.css"),
js_path: path.join(app_conf.paths.js.web, "add.js"),
column_options: JSON.stringify(column_options),
@@ -246,6 +248,7 @@ router.get("/edit", async (req, res) => {
res.render("edit", {
page_title: app_conf.name,
program: app_conf.program,
css_path: path.join(app_conf.paths.css.web, "stylesheet.css"),
js_path: path.join(app_conf.paths.js.web, "edit.js"),
column_options: JSON.stringify(column_options),
@@ -293,6 +296,7 @@ router.get("/", async (req, res) => {
res.render("index", {
page_title: app_conf.name,
program: app_conf.program,
css_path: path.join(app_conf.paths.css.web, "stylesheet.css"),
js_path: path.join(app_conf.paths.js.web, "index.js"),
table_header: table_header,
@@ -310,6 +314,7 @@ router.get("/", async (req, res) => {
router.get("/about", (req, res) => {
res.render("about", {
page_title: app_conf.name,
program: app_conf.program,
css_path: path.join(app_conf.paths.css.web, "stylesheet.css"),
version: app_conf.version
});