From 3e59d199a326fe514be0c55da28434b4abe7661b Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Tue, 15 Dec 2020 10:15:30 +0100 Subject: [PATCH] cookie consent moved to npm dependency --- debian-template/copyright | 1 + smash/package-lock.json | 5 +++++ smash/package.json | 1 + smash/smash/settings.py | 1 + smash/web/templates/_base.html | 4 ++-- 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/debian-template/copyright b/debian-template/copyright index fc3c7dec..0d6a69c0 100644 --- a/debian-template/copyright +++ b/debian-template/copyright @@ -25,6 +25,7 @@ License: Django Files: smash/node_modules/admin-lte/* smash/node_modules/awesomplete/* smash/node_modules/bootstrap/* + smash/node_modules/cookieconsent/* smash/node_modules/datatables.net-bs/* smash/node_modules/datatables.net-buttons-bs/* smash/node_modules/datatables.net-buttons/* diff --git a/smash/package-lock.json b/smash/package-lock.json index 28b1e784..7cb491fa 100644 --- a/smash/package-lock.json +++ b/smash/package-lock.json @@ -224,6 +224,11 @@ "safe-buffer": "~5.1.1" } }, + "cookieconsent": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/cookieconsent/-/cookieconsent-3.1.1.tgz", + "integrity": "sha512-v8JWLJcI7Zs9NWrs8hiVldVtm3EBF70TJI231vxn6YToBGj0c9dvdnYwltydkAnrbBMOM/qX1xLFrnTfm5wTag==" + }, "core-js": { "version": "2.6.12", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", diff --git a/smash/package.json b/smash/package.json index 2aaeef0d..12afa34f 100644 --- a/smash/package.json +++ b/smash/package.json @@ -13,6 +13,7 @@ "awesomplete": "^1.1.5", "bootstrap": "^3.3.6", "bootstrap-datepicker": "^1.7.0", + "cookieconsent": "^3.1.1", "datatables.net-bs": "^1.10.22", "datatables.net-buttons": "^1.6.5", "datatables.net-buttons-bs": "^1.6.5", diff --git a/smash/smash/settings.py b/smash/smash/settings.py index f5e1896f..a33761bc 100644 --- a/smash/smash/settings.py +++ b/smash/smash/settings.py @@ -126,6 +126,7 @@ NPM_FILE_PATTERNS = { 'awesomplete': ['awesomplete.css', 'awesomplete.css.map', 'awesomplete.min.js', 'awesomplete.min.js.map'], 'bootstrap': ['dist/*'], 'bootstrap-datepicker': ['dist/*'], + 'cookieconsent': ['build/*'], 'datatables.net': ['js/*'], 'datatables.net-bs': ['css/*', 'js/*'], 'datatables.net-buttons': ['js/*'], diff --git a/smash/web/templates/_base.html b/smash/web/templates/_base.html index 641b1987..406c4511 100644 --- a/smash/web/templates/_base.html +++ b/smash/web/templates/_base.html @@ -25,8 +25,7 @@ <link rel="stylesheet" href="{% static 'npm/jquery-ui-dist/jquery-ui.min.css' %}"> - <script src="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js"></script> - <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css"> + <link rel="stylesheet" href="{% static 'npm/cookieconsent/build/cookieconsent.min.css' %}"> {% endblock styles %} </head> <!-- @@ -363,6 +362,7 @@ desired effect <script src="{% static 'js/smash.js' %}"></script> <script src="{% static 'npm/moment/min/moment.min.js' %}"></script> <script src="{% static 'npm/moment-range/dist/moment-range.js' %}"></script> + <script src="{% static 'npm/cookieconsent/build/cookieconsent.min.js' %}"></script> <script type="text/javascript"> window['moment-range'].extendMoment(moment); </script> -- GitLab