General refactor
This commit is contained in:
@@ -15,6 +15,7 @@ function errorPageRenderer(res, emoji, message) {
|
||||
res.render("error", {
|
||||
page_title: app_conf.name,
|
||||
program: app_conf.program,
|
||||
app_url: app_conf.app_url,
|
||||
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,
|
||||
@@ -124,6 +125,7 @@ router.get("/add", async (req, res) => {
|
||||
res.render("add", {
|
||||
page_title: app_conf.name,
|
||||
program: app_conf.program,
|
||||
app_url: app_conf.app_url,
|
||||
css_path: path.join(app_conf.paths.css.web, "stylesheet.css"),
|
||||
js_path: path.join(app_conf.paths.js.web, "add.js"),
|
||||
chartjs: app_conf.paths.chartjs.web + "/chart.umd.js",
|
||||
@@ -143,6 +145,7 @@ router.get("/edit", async (req, res) => {
|
||||
res.render("edit", {
|
||||
page_title: app_conf.name,
|
||||
program: app_conf.program,
|
||||
app_url: app_conf.app_url,
|
||||
css_path: path.join(app_conf.paths.css.web, "stylesheet.css"),
|
||||
js_path: path.join(app_conf.paths.js.web, "edit.js"),
|
||||
chartjs: app_conf.paths.chartjs.web + "/chart.umd.js",
|
||||
@@ -203,6 +206,7 @@ router.get("/", async (req, res) => {
|
||||
res.render("index", {
|
||||
page_title: app_conf.name,
|
||||
program: app_conf.program,
|
||||
app_url: app_conf.app_url,
|
||||
css_path: path.join(app_conf.paths.css.web, "stylesheet.css"),
|
||||
js_path: path.join(app_conf.paths.js.web, "index.js"),
|
||||
map_name_msg: (selected_map_name != "" ? "Using: " + selected_map_name : ""),
|
||||
@@ -222,6 +226,7 @@ router.get("/about", (req, res) => {
|
||||
res.render("about", {
|
||||
page_title: app_conf.name,
|
||||
program: app_conf.program,
|
||||
app_url: app_conf.app_url,
|
||||
css_path: path.join(app_conf.paths.css.web, "stylesheet.css"),
|
||||
version: app_conf.version
|
||||
});
|
||||
|
||||
@@ -12,15 +12,7 @@ router.use(app_conf.paths.chartjs.web, express.static(path.join(path.dirname(req
|
||||
* Main endpoint - might implement authentication step here...
|
||||
*/
|
||||
router.get("/", (req, res) => {
|
||||
res.render("auth", {
|
||||
page_title: app_conf.name,
|
||||
|
||||
program: app_conf.program,
|
||||
css_path: path.join(app_conf.paths.css.web, "stylesheet.css"),
|
||||
protocol: app_conf.protocol,
|
||||
host: app_conf.host,
|
||||
port: app_conf.port
|
||||
});
|
||||
res.redirect(`${app_conf.protocol}://${app_conf.host}:${app_conf.port}${app_conf.app_url}`);
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user