Code refactor
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user