Private
Public Access
1
0

Added cookie law banner

This commit is contained in:
Sander Roosendaal
2016-12-21 13:14:08 +01:00
parent ddc6a32606
commit a03848e568
5 changed files with 52 additions and 0 deletions

View File

@@ -1,7 +1,9 @@
{% load cookielaw_tags %}
{% load analytical %}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<script src="/static/cookielaw/js/cookielaw.js"></script>
{% analytical_head_top %}
<link rel="stylesheet" href="/static/css/bokeh-0.12.3.min.css" type="text/css" />
<link rel="stylesheet" href="/static/css/bokeh-widgets-0.12.3.min.css" type="text/css" />
@@ -16,6 +18,7 @@
<link rel="stylesheet" href="/static/css/text.css" />
<link rel="stylesheet" href="/static/css/960_12_col.css" />
<link rel="stylesheet" href="/static/css/rowsandall.css" />
<link rel="stylesheet" href="static/css/cookiecuttr.css" />
{% block meta %} {% endblock %}
{% analytical_head_bottom %}
</head>
@@ -180,6 +183,7 @@
</div>
{% endblock %}
</div>
{% cookielaw_banner %}
</div>
<!-- end container -->
{% analytical_body_bottom %}

View File

@@ -52,6 +52,7 @@ INSTALLED_APPS = [
'oauth2_provider',
'corsheaders',
'analytical',
'cookielaw'
]
AUTHENTICATION_BACKENDS = (
@@ -282,3 +283,6 @@ REST_FRAMEWORK = {
# Analytics
CLICKY_SITE_ID = '101011008'
# Cookie Law

View File

@@ -0,0 +1,19 @@
#CookielawBanner {
background: #fff;
padding: 15px 0;
}
#CookielawBanner .container {
position: relative;
}
#CookielawBanner #CookielawCross {
background: url('../img/close.png') no-repeat 0 0;
cursor: pointer;
display: block;
position: absolute;
top: 0;
right: 0;
width: 15px;
height: 15px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

View File

@@ -0,0 +1,25 @@
var Cookielaw = {
createCookie: function (name, value, days) {
var date = new Date(),
expires = '';
if (days) {
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toGMTString();
} else {
expires = "";
}
document.cookie = name + "=" + value + expires + "; path=/";
},
createCookielawCookie: function () {
this.createCookie('cookielaw_accepted', '1', 10 * 365);
if (typeof (window.jQuery) === 'function') {
jQuery('#CookielawBanner').slideUp();
} else {
document.getElementById('CookielawBanner').style.display = 'none';
}
}
};