From 41a36e2e1877b4a2ab6751c011e80582f8ccbcf2 Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Wed, 23 May 2018 01:14:52 +0200 Subject: [PATCH 01/74] Add privacy and ToS links To be GDPR compliant we need to provide privacy statement. These should be linked on the index page. So as soon as a document exist under `public/docs/privacy.md` the link will show up. Since we already add legal links, we also add Terms of Use, which will show up as soon as `public/docs/terms-of-use.md` exists. This should allow everyone to provide the legal documents they need for GDPR and other privacy and business laws. Signed-off-by: Sheogorath --- lib/response.js | 5 ++++- locales/en.json | 6 ++++-- public/views/index/body.ejs | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/response.js b/lib/response.js index ae3e45f..2ea2f1c 100644 --- a/lib/response.js +++ b/lib/response.js @@ -2,6 +2,7 @@ // response // external modules var fs = require('fs') +var path = require('path') var markdownpdf = require('markdown-pdf') var shortId = require('shortid') var querystring = require('querystring') @@ -75,7 +76,9 @@ function showIndex (req, res, next) { allowPDFExport: config.allowPDFExport, signin: req.isAuthenticated(), infoMessage: req.flash('info'), - errorMessage: req.flash('error') + errorMessage: req.flash('error'), + privacyStatement: fs.existsSync(path.join(config.docsPath, 'privacy.md')), + termsOfUse: fs.existsSync(path.join(config.docsPath, 'terms-of-use.md')) }) } diff --git a/locales/en.json b/locales/en.json index 1aef3f6..b19089e 100644 --- a/locales/en.json +++ b/locales/en.json @@ -105,5 +105,7 @@ "Export to Snippet": "Export to Snippet", "Select Visibility Level": "Select Visibility Level", "Night Theme": "Night Theme", - "Follow us on %s and %s.": "Follow us on %s, and %s." -} + "Follow us on %s and %s.": "Follow us on %s, and %s.", + "Privacy": "Privacy", + "Terms of Use": "Terms of Use" +} \ No newline at end of file diff --git a/public/views/index/body.ejs b/public/views/index/body.ejs index d8766fe..e3a3a85 100644 --- a/public/views/index/body.ejs +++ b/public/views/index/body.ejs @@ -147,7 +147,7 @@

- © 2018 HackMD | <%= __('Releases') %> + © 2018 HackMD | <%= __('Releases') %><% if(privacyStatement) { %> | <%= __('Privacy') %><% } %><% if(termsOfUse) { %> | <%= __('Terms of Use') %><% } %>