Skip to content

Commit 59a6060

Browse files
authored
Merge pull request #461 from Callino/10.0-add_accepted_cookie-WP
[10.0][IMP] website_cookie_notice: use specific cookie "accepted_cookie"
2 parents 16d6599 + 4a1b239 commit 59a6060

File tree

7 files changed

+5
-34
lines changed

7 files changed

+5
-34
lines changed

website_cookie_notice/README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Contributors
6868
* Nicola Malcontenti <nicola.malcontenti@agilebg.com>
6969
* Rafael Blasco <rafael.blasco@tecnativa.com>
7070
* Jairo Llopis <jairo.llopis@tecnativa.com>
71+
* Wolfgang Pichler <wpichler@callino.at>
7172

7273
Maintainer
7374
----------

website_cookie_notice/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
# Copyright 2015-2016 Lorenzo Battistini - Agile Business Group
33
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
44

5-
from . import controllers

website_cookie_notice/controllers/__init__.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

website_cookie_notice/controllers/main.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

website_cookie_notice/i18n/de.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ msgstr ""
2323
msgid ""
2424
". To disable them, configure your browser properly. If you keep using this "
2525
"website, you are accepting those."
26-
msgstr ""
26+
msgstr ". Um diese zu deaktivieren, konfigurieren Sie Bitte Ihren Browser entsprechend. Indem Sie fortfahren akzeptieren Sie diese."
2727

2828
#. module: website_cookie_notice
2929
#: model:ir.ui.view,arch_db:website_cookie_notice.message

website_cookie_notice/static/src/js/accept_cookies.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,13 @@
66
odoo.define('website_cookie_notice.cookie_notice', function (require) {
77
"use strict";
88

9-
var ajax = require('web.ajax');
109
var base = require('web_editor.base');
1110

1211
base.ready().done(function() {
1312
$(".cc-cookies .btn-primary").click(function(e) {
1413
e.preventDefault();
15-
ajax.jsonRpc('/website_cookie_notice/ok', 'call').then(function (data) {
16-
if (data.result == 'ok') {
17-
$(e.target).closest(".cc-cookies").hide("fast");
18-
}
19-
});
14+
document.cookie = 'accepted_cookies=1; path=/';
15+
$(e.target).closest(".cc-cookies").hide("fast");
2016
});
2117
});
2218
}

website_cookie_notice/templates/website.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010

1111
<template id="message" name="Cookies notice">
12-
<div t-if="request and
13-
not request.session.get('accepted_cookies')"
12+
<div t-if="request and not request.httprequest.cookies.get('accepted_cookies')"
1413
id="website_cookie_notice"
1514
class="container-fluid bg-warning cc-cookies">
1615
<div class="container">

0 commit comments

Comments
 (0)