.
This commit is contained in:
@ -1,9 +1,10 @@
|
||||
import router from "../router.mjs";
|
||||
import cfg from "../../../config.json";
|
||||
import fs from "fs";
|
||||
import sql from "../sql.mjs";
|
||||
import swig from "swig";
|
||||
import url from "url";
|
||||
import sql from "../sql.mjs";
|
||||
import lib from "../lib.mjs";
|
||||
import tpl from "../tpl.mjs";
|
||||
|
||||
const templates = {
|
||||
contact: fs.readFileSync("./views/contact.html", "utf-8"),
|
||||
@ -21,7 +22,7 @@ router.get("/", async (req, res) => {
|
||||
};
|
||||
|
||||
res.reply({
|
||||
body: swig.compile(templates.index)(data)
|
||||
body: tpl.render(templates.index, data)
|
||||
});
|
||||
});
|
||||
|
||||
@ -74,7 +75,7 @@ router.get(/^\/([0-9]+)$/, async (req, res) => {
|
||||
data.thumb = `${cfg.websrv.paths.thumbnails}/${e.id}.png`;
|
||||
data.dest = `${cfg.websrv.paths.images}/${e.dest}`;
|
||||
data.mime = e.mime;
|
||||
data.size = e.size;//lib.formatSize(e.size);
|
||||
data.size = lib.formatSize(e.size);
|
||||
data.userchannel = e.userchannel;
|
||||
data.usernetwork = e.usernetwork;
|
||||
data.timestamp = new Date(e.stamp * 1000).toISOString();
|
||||
@ -84,7 +85,7 @@ router.get(/^\/([0-9]+)$/, async (req, res) => {
|
||||
data.prev = query[2][0].id;
|
||||
}
|
||||
res.reply({
|
||||
body: swig.compile(templates.item)(data)
|
||||
body: tpl.render(templates.item, data)
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user