diff --git a/app/config.js b/app/config.js new file mode 100644 index 000000000..4f41d2ea2 --- /dev/null +++ b/app/config.js @@ -0,0 +1,10 @@ +// Use this file to change prototype configuration. + +// Note: this config can be overridden using environment variables (eg on heroku) + +module.exports = { + + // Cookie warning + cookieText: 'GOV.UK uses cookies to make the site simpler. Find out more about cookies' + +}; diff --git a/app/views/layout.html b/app/views/layout.html index c51b8bdb3..c59623a2d 100755 --- a/app/views/layout.html +++ b/app/views/layout.html @@ -7,6 +7,10 @@ {% include "includes/snippets_scripts.html" %} {% endblock %} +{% block cookie_message %} +

{{cookieText | safe }}

+{% endblock %} + {% block proposition_header %} {% include "includes/service_manual_navigation.html" %} {% endblock %} diff --git a/app/views/layout_example.html b/app/views/layout_example.html index 17549c1a4..bb36174bc 100644 --- a/app/views/layout_example.html +++ b/app/views/layout_example.html @@ -32,6 +32,10 @@ {% include "includes/elements_tracking.html" %} {% endblock %} +{% block cookie_message %} +

{{cookieText | safe }}

+{% endblock %} + {% block proposition_header %} {% include "includes/service_manual_navigation.html" %} {% endblock %} diff --git a/server.js b/server.js index 2a89881f7..28694dc6e 100755 --- a/server.js +++ b/server.js @@ -1,4 +1,5 @@ var bodyParser = require('body-parser'), + config = require(__dirname + '/app/config.js'), express = require('express'), nunjucks = require('express-nunjucks'), path = require('path'), @@ -34,6 +35,12 @@ app.use(function (req, res, next) { next(); }); +// Add variables that are available in all views +app.use(function (req, res, next) { + res.locals.cookieText=config.cookieText; + next(); +}); + // routes (found in routes.js) routes.bind(app, '/public/');