From 22effae1e4d1488720af4592adb59bccbe374a80 Mon Sep 17 00:00:00 2001 From: Adam Rambousek Date: Sat, 13 Apr 2019 15:23:17 +0200 Subject: [PATCH] optional terms of use, fix #94 --- website/lexonomy.js | 2 +- website/libs/screenful/screenful-consent.js | 4 ++-- website/libs/screenful/screenful-loc-en.js | 2 -- website/siteconfig.json.template | 1 + website/views/consent.ejs | 2 ++ 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/website/lexonomy.js b/website/lexonomy.js index 0aa9dd11..a4b000d2 100644 --- a/website/lexonomy.js +++ b/website/lexonomy.js @@ -60,7 +60,7 @@ app.get(siteconfig.rootPath+":dictID/en/", function(req, res){ res.redirect("/"+ //SITEWIDE UI: app.get(siteconfig.rootPath, function(req, res){ ops.verifyLogin(req.cookies.email, req.cookies.sessionkey, function(user){ - if (user.loggedin && !user.consent) { + if (user.loggedin && siteconfig.consent != null && siteconfig.consent.terms != null && !user.consent) { res.redirect(siteconfig.baseUrl + 'consent/'); } ops.getDictsByUser(user.email, function(dicts){ diff --git a/website/libs/screenful/screenful-consent.js b/website/libs/screenful/screenful-consent.js index b187caac..d08d24af 100644 --- a/website/libs/screenful/screenful-consent.js +++ b/website/libs/screenful/screenful-consent.js @@ -3,8 +3,8 @@ Screenful.Consent={ Screenful.createEnvelope(true); $("#envelope").html("
"); $("#middlebox").append("
"+Screenful.Loc.termsTitle+"
"); - $("#middlebox").append("
"+Screenful.Loc.termsOfUse+"
"); - $("#middlebox").append(""); + $("#middlebox").append("
"+(Screenful.Consentterms.replace(/</g,'<').replace(/>/g,'>'))+"
"); + $("#middlebox").append(""); $("#middlebox").append("
"); $("#middlebox").append(""); diff --git a/website/libs/screenful/screenful-loc-en.js b/website/libs/screenful/screenful-loc-en.js index 81753bbe..b6fc2fad 100644 --- a/website/libs/screenful/screenful-loc-en.js +++ b/website/libs/screenful/screenful-loc-en.js @@ -92,8 +92,6 @@ Screenful.Loc={ partialMatches: "Partial matches", termsTitle: "Terms of Use", - termsOfUse: "Lexonomy is a service provided by Lexical Computing CZ s.r.o.. This service is provided free of charge for non-commercial purposes only. Lexonomy is still in the development phase and no warranties are given as for service availability or fitness for particular purpose.

Commercial users as well as users interested in a guaranteed service level need to contact us in order to obtain a subscription.", - termsConsent: "My usage is non-commercial and I agree to the terms of use", confirm: "Confirm", termsError: "Please, confirm Terms of Use before using Lexonomy.", }; diff --git a/website/siteconfig.json.template b/website/siteconfig.json.template index b0f3a749..32db9c9a 100644 --- a/website/siteconfig.json.template +++ b/website/siteconfig.json.template @@ -11,6 +11,7 @@ "mailconfig": {"host": "smtp.server.example", "port": 465,"secure": true, "from": "noreply@example.com"}, "sketchengineKey": null, "sketchengineLoginPage": null, + "consent": {"terms": null, "confirm": null}, "licences": { "cc-by-4.0": { "title": "Creative Commons Attribution 4.0 International", diff --git a/website/views/consent.ejs b/website/views/consent.ejs index a2bf57a4..b49f1c93 100644 --- a/website/views/consent.ejs +++ b/website/views/consent.ejs @@ -15,6 +15,8 @@