mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-05 01:16:27 +00:00
Merge branch 'cookie_awareness' into 'master'
Fix #13 Closes #13 See merge request rezo/re2o!27
This commit is contained in:
commit
e5d559d4e4
2 changed files with 20 additions and 0 deletions
|
@ -49,6 +49,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
{% include "cookie_banner.html" %}
|
||||||
<div id="wrap">
|
<div id="wrap">
|
||||||
<nav class="navbar navbar-inverse">
|
<nav class="navbar navbar-inverse">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
|
|
19
templates/cookie_banner.html
Normal file
19
templates/cookie_banner.html
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{% if not 'accept_cookies' in request.COOKIES%}
|
||||||
|
<script>
|
||||||
|
function accept_cookie() {
|
||||||
|
var d = new Date();
|
||||||
|
var expiration_time = 7 * 24 * 60 * 60 * 1000; // Accepte les cookies pendant 7 jours.
|
||||||
|
d.setTime(d.getTime() + expiration_time);
|
||||||
|
var expires = "expires="+ d.toUTCString();
|
||||||
|
document.cookie = "accept_cookies=1;" + expires + ";path=/";
|
||||||
|
var banner = document.getElementById("cookie_banner");
|
||||||
|
banner.parentNode.removeChild(banner);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<div class="navbar text-center" id="cookie_banner">
|
||||||
|
<p>Ce site utilise des cookies. En poursuivant sur ce site j'accepte l'utilisation des cookies sur ce site.</p>
|
||||||
|
<a class="btn btn-primary btn-sm" role="button" onclick="accept_cookie();" title="Accepter">
|
||||||
|
J'ai compris !
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
Loading…
Reference in a new issue