diff --git a/website/package.json b/website/package.json index bfb7568..6a3ba8c 100644 --- a/website/package.json +++ b/website/package.json @@ -1,4 +1,15 @@ { + "name": "terminologue", + "displayName": "Terminologue", + "version": "1.0.0", + "description": "Open-source terminology management tool", + "author": "Gaois Research Group, Fiontar & Scoil na Gaeilge, Dublin City University", + "license": "MIT", + "homepage": "https://www.terminologue.org", + "main": "terminologue.js", + "scripts": { + "start": "node terminologue.js" + }, "dependencies": { "@sendgrid/mail": "^7.7.0", "cookie-parser": "^1.4.6", diff --git a/website/terminologue.js b/website/terminologue.js index 25df1f6..cf29ecf 100644 --- a/website/terminologue.js +++ b/website/terminologue.js @@ -88,7 +88,11 @@ app.get(siteconfig.rootPath, function(req, res){ ops.verifyLogin(req.cookies.email, req.cookies.sessionkey, function(user){ ops.getTermbasesByUser(user.email, function(termbases){ var uilang=user.uilang || req.cookies.uilang || siteconfig.uilangDefault; - res.render("sitewide/home.ejs", {siteconfig: siteconfig, user: user, termbases: termbases, uilang: uilang, uilangs: siteconfig.uilangs, L: localizer[uilang].L}); + fs.readFile(path.join(__dirname, "package.json"), "utf8", function(err, packageJson){ + packageJson=JSON.parse(packageJson); + packageJson.version = packageJson.version || "0.0.0"; + res.render("sitewide/home.ejs", {siteconfig: siteconfig, user: user, termbases: termbases, uilang: uilang, uilangs: siteconfig.uilangs, L: localizer[uilang].L, version: packageJson.version}); + }); }); }); }); @@ -243,7 +247,11 @@ app.get(siteconfig.rootPath+"docs/:docID.:uilang/", function(req, res){ if(user.loggedin) ops.saveUilang(req.cookies.email, uilang, function(){}); ops.getDoc(req.params.docID, uilang, function(doc){ - res.render("sitewide/doc.ejs", {doc: doc, siteconfig: siteconfig, user: user, uilang: uilang, uilangs: siteconfig.uilangs, L: localizer[uilang].L}); + fs.readFile(path.join(__dirname, "package.json"), "utf8", function(err, packageJson){ + packageJson=JSON.parse(packageJson); + packageJson.version = packageJson.version || "0.0.0"; + res.render("sitewide/doc.ejs", {doc: doc, siteconfig: siteconfig, user: user, uilang: uilang, uilangs: siteconfig.uilangs, L: localizer[uilang].L, version: packageJson.version}); + }); }); }); }); diff --git a/website/views/sitewide/doc.ejs b/website/views/sitewide/doc.ejs index 4dabd3d..a7013d1 100644 --- a/website/views/sitewide/doc.ejs +++ b/website/views/sitewide/doc.ejs @@ -69,6 +69,7 @@
+