Skip to content

Commit 61ba5b2

Browse files
[IMP] website_cookiefirst: Replace deprecated Cookiefirst functionality
- replace banner.js with new consent.js script using domain and identifier - remove www. prefix from domain in cookiefirst script URL - back ported from V17 PR (#1110 & #1117)
1 parent 83fcd63 commit 61ba5b2

File tree

4 files changed

+24
-17
lines changed

4 files changed

+24
-17
lines changed

website_cookiefirst/README.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ Configuration
4242

4343
To configure this module, you need to:
4444

45-
#. Go to **Website > Configuration > Settings**
46-
#. Search 'Cookiefirst' option.
47-
#. Fill in your 'Cookiefirst ID' (e.g. '00000000-0000-0000-0000-000000000000').
48-
#. Click on "Save" button.
45+
1. Go to **Website \> Configuration \> Settings**
46+
2. Search 'Cookiefirst' option.
47+
3. Enable Use Cookiefirst checkbox
48+
4. Enter your Cookiefirst **API Key** into **Cookiefirst ID** field (e.g.
49+
'00000000-0000-0000-0000-000000000000').
50+
5. Click on "Save" button.
4951

5052
Bug Tracker
5153
===========
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
To configure this module, you need to:
22

3-
#. Go to **Website > Configuration > Settings**
4-
#. Search 'Cookiefirst' option.
5-
#. Fill in your 'Cookiefirst ID' (e.g. '00000000-0000-0000-0000-000000000000').
6-
#. Click on "Save" button.
3+
1. Go to **Website \> Configuration \> Settings**
4+
2. Search 'Cookiefirst' option.
5+
3. Enable Use Cookiefirst checkbox
6+
4. Enter your Cookiefirst **API Key** into **Cookiefirst ID** field (e.g.
7+
'00000000-0000-0000-0000-000000000000').
8+
5. Click on "Save" button.

website_cookiefirst/static/description/index.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml version="1.0" encoding="utf-8"?>
21
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
32
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
43
<head>
@@ -9,10 +8,11 @@
98

109
/*
1110
:Author: David Goodger (goodger@python.org)
12-
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
11+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
1312
:Copyright: This stylesheet has been placed in the public domain.
1413
1514
Default cascading style sheet for the HTML output of Docutils.
15+
Despite the name, some widely supported CSS2 features are used.
1616
1717
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1818
customize this style sheet.
@@ -275,7 +275,7 @@
275275
margin-left: 2em ;
276276
margin-right: 2em }
277277

278-
pre.code .ln { color: grey; } /* line numbers */
278+
pre.code .ln { color: gray; } /* line numbers */
279279
pre.code, code { background-color: #eeeeee }
280280
pre.code .comment, code .comment { color: #5C6576 }
281281
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +301,7 @@
301301
span.pre {
302302
white-space: pre }
303303

304-
span.problematic {
304+
span.problematic, pre.problematic {
305305
color: red }
306306

307307
span.section-subtitle {
@@ -392,7 +392,9 @@ <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
392392
<ol class="arabic simple">
393393
<li>Go to <strong>Website &gt; Configuration &gt; Settings</strong></li>
394394
<li>Search ‘Cookiefirst’ option.</li>
395-
<li>Fill in your ‘Cookiefirst ID’ (e.g. ‘00000000-0000-0000-0000-000000000000’).</li>
395+
<li>Enable Use Cookiefirst checkbox</li>
396+
<li>Enter your Cookiefirst <strong>API Key</strong> into <strong>Cookiefirst ID</strong> field (e.g.
397+
‘00000000-0000-0000-0000-000000000000’).</li>
396398
<li>Click on “Save” button.</li>
397399
</ol>
398400
</div>
@@ -428,7 +430,9 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
428430
<div class="section" id="maintainers">
429431
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
430432
<p>This module is maintained by the OCA.</p>
431-
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
433+
<a class="reference external image-reference" href="https://odoo-community.org">
434+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
435+
</a>
432436
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
433437
mission is to support the collaborative development of Odoo features and
434438
promote its widespread use.</p>

website_cookiefirst/views/portal_template.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
<attribute name="data-cookiefirst-category">performance</attribute>
1818
</xpath>
1919
<xpath expr="//script[last()]" position="after">
20-
<t t-if="website.cookiefirst_identifier">
20+
<t t-if="website.cookiefirst_identifier and website.domain">
2121
<script
22-
src="https://consent.cookiefirst.com/banner.js"
23-
t-att-data-cookiefirst-key="website.cookiefirst_identifier"
22+
t-attf-src="https://consent.cookiefirst.com/sites/{{ (website.domain or '').replace('http://', '').replace('https://', '').replace('www.', '') }}-{{ website.cookiefirst_identifier }}/consent.js"
2423
/>
2524
</t>
2625
</xpath>

0 commit comments

Comments
 (0)