Update pages title
This commit is contained in:
parent
2e8228be7e
commit
4ebe5880c4
11 changed files with 17 additions and 12 deletions
4
app.js
4
app.js
|
@ -10,7 +10,7 @@ let registerRouter = require("./routes/register");
|
|||
let loginRouter = require("./routes/login");
|
||||
let logoutRouter = require("./routes/logout");
|
||||
let commandRouter = require("./routes/command");
|
||||
let ordersRouter = require("./routes/orders");
|
||||
let ordersRouter = require("./routes/commands");
|
||||
let sandwichesRouter = require("./routes/sandwiches");
|
||||
let profileRouter = require("./routes/profile");
|
||||
let adminRouter = require("./routes/admin");
|
||||
|
@ -43,7 +43,7 @@ app.use("/register", registerRouter);
|
|||
app.use("/login", loginRouter);
|
||||
app.use("/logout", logoutRouter);
|
||||
app.use("/command", commandRouter);
|
||||
app.use("/orders", ordersRouter);
|
||||
app.use("/commands", ordersRouter);
|
||||
app.use("/sandwiches", sandwichesRouter);
|
||||
app.use("/profile", profileRouter);
|
||||
app.use("/admin", adminRouter);
|
||||
|
|
|
@ -6,7 +6,7 @@ let models = require("../../models");
|
|||
|
||||
router.get("/", sessionCheck(3), async (req, res) => {
|
||||
res.render("admin/commands", {
|
||||
title: "SOD",
|
||||
title: "SOD - Commands administration",
|
||||
user: req.session.user,
|
||||
commands: await models.Command.findAll({include: models.Sandwich, order: ["date"]})
|
||||
});
|
||||
|
|
|
@ -5,7 +5,12 @@ let models = require("../../models");
|
|||
|
||||
|
||||
router.get("/", sessionCheck(3), async (req, res) => {
|
||||
res.render("admin/index", {title: "SOD", user: req.session.user, sandwiches: await models.Sandwich.findAll(), users: await models.User.findAll()});
|
||||
res.render("admin/index", {
|
||||
title: "SOD - Administration",
|
||||
user: req.session.user,
|
||||
sandwiches: await models.Sandwich.findAll(),
|
||||
users: await models.User.findAll()
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
|
|
|
@ -23,7 +23,7 @@ router.get("/", sessionCheck(2), async (req, res) => {
|
|||
commands[i.Command.DepartmentName][name][i.Command.id] = []
|
||||
commands[i.Command.DepartmentName][name][i.Command.id].push(i);
|
||||
}
|
||||
res.render("orders", {title: "SOD", user: req.session.user, commands: commands, date: date});
|
||||
res.render("commands", {title: "SOD - Commands", user: req.session.user, commands: commands, date: date});
|
||||
});
|
||||
|
||||
module.exports = router;
|
|
@ -5,7 +5,7 @@ let models = require("../models");
|
|||
router.get("/", async (req, res) => {
|
||||
let departments = await models.Department.findAll();
|
||||
let sandwiches = await models.Sandwich.findAll();
|
||||
res.render("index", { title: "SOD", user: req.session.user, departments: departments, sandwiches: sandwiches });
|
||||
res.render("index", { title: "SOD - Home", user: req.session.user, departments: departments, sandwiches: sandwiches });
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
|
|
|
@ -6,7 +6,7 @@ router.get("/", async (req, res) => {
|
|||
if (req.session.user)
|
||||
res.redirect("/")
|
||||
else
|
||||
res.render("login", { title: "Kfet - Login" });
|
||||
res.render("login", { title: "SOD - Login" });
|
||||
})
|
||||
.post("/", async (req, res) => {
|
||||
if (!req.body.username || !req.body.password)
|
||||
|
|
|
@ -5,7 +5,7 @@ let models = require("../models");
|
|||
|
||||
router.get("/", sessionCheck(0), async (req, res) => {
|
||||
res.render("profile", {
|
||||
title: "SOD",
|
||||
title: "SOD - Profile",
|
||||
user: req.session.user,
|
||||
departments: await models.Department.findAll(),
|
||||
commands: await models.Command.findAll({
|
||||
|
|
|
@ -7,7 +7,7 @@ router.get("/", async (req, res) => {
|
|||
if (req.session.user)
|
||||
res.redirect("/");
|
||||
else
|
||||
res.render("register", {title: "SOD", departments: await models.Department.findAll()});
|
||||
res.render("register", {title: "SOD - register", departments: await models.Department.findAll()});
|
||||
})
|
||||
.post("/", async (req, res) => {
|
||||
if (!req.body.username || !req.body.email || !req.body.firstName || !req.body.lastName ||
|
||||
|
|
|
@ -9,7 +9,7 @@ router.get("/", sessionCheck(1), async (req, res) => {
|
|||
let date = req.query.date ? req.query.date : (new Date()).toISOString().substring(0,10);
|
||||
|
||||
res.render("sandwiches", {
|
||||
title: "SOD",
|
||||
title: "SOD - Sandwiches",
|
||||
user: req.session.user,
|
||||
sandwiches: await models.SandwichCommand.findAll({
|
||||
attributes: ["SandwichName", [sequelize.fn("COUNT", sequelize.col("SandwichName")), "number"]],
|
||||
|
|
|
@ -19,4 +19,4 @@ block content
|
|||
div.sandwich
|
||||
h4= sandwich.Sandwich.name
|
||||
|
||||
script(src="javascripts/orders.js")
|
||||
script(src="javascripts/commands.js")
|
|
@ -14,7 +14,7 @@ html
|
|||
a(href="/sandwiches") Sandwiches
|
||||
if user.permissions >= 2
|
||||
p -
|
||||
a(href="/orders") Commands
|
||||
a(href="/commands") Commands
|
||||
if user.permissions >= 3
|
||||
p -
|
||||
a(href="/admin") Administration
|
||||
|
|
Reference in a new issue