themes im backend etzala

This commit is contained in:
Flummi
2021-04-17 19:55:25 +02:00
parent 65454961ce
commit 97519de05b
7 changed files with 63 additions and 23 deletions

View File

@ -46,7 +46,8 @@ router.get(/^\/(audio\/?|image\/?|video\/?)?(p\/\d+)?$/, async (req, res) => {
link: `/${mime ? mime + "/" : ""}p/`
},
last: query[query.length - 1].id,
filter: mime ? mime : undefined
filter: mime ? mime : undefined,
theme: (typeof req.cookies.theme !== "undefined" && cfg.websrv.themes.includes(req.cookies.theme)) ? req.cookies.theme : cfg.websrv.themes[0]
};
res.reply({ body: tpl.render("views/index", data) });
@ -117,11 +118,16 @@ router.get(/^\/((audio\/|video\/|image\/)?[0-9]+)$/, async (req, res) => {
cheat: cheat,
link: `/${mime ? mime + "/" : ""}`
},
filter: mime ? mime : undefined
filter: mime ? mime : undefined,
theme: (typeof req.cookies.theme !== "undefined" && cfg.websrv.themes.includes(req.cookies.theme)) ? req.cookies.theme : cfg.websrv.themes[0]
};
res.reply({ body: tpl.render("views/item", data) });
});
router.get(/^\/(contact|help|about)$/, (req, res) => {
res.reply({ body: tpl.render(`views/${req.url.split[0]}`) });
res.reply({
body: tpl.render(`views/${req.url.split[0]}`, {
theme: (typeof req.cookies.theme !== "undefined" && cfg.websrv.themes.includes(req.cookies.theme)) ? req.cookies.theme : cfg.websrv.themes[0]
})
});
});