diff --git a/website_cookieconsent/README.rst b/website_cookieconsent/README.rst
index 1dea2aa..e5f1b1c 100644
--- a/website_cookieconsent/README.rst
+++ b/website_cookieconsent/README.rst
@@ -1,6 +1,6 @@
-===================
+=====================
Website CookieConsent
-===================
+=====================
This module integrates Odoo website with [Orestbida's CookieConsent plugin](https://github.com/orestbida/cookieconsent).
@@ -15,9 +15,9 @@ Configuration
To configure this module, you need to:
# . Go to **Website > Configuration > Settings**
-# . Search 'CookieConsent' option.
-# . Toggle 'Use CookieConsent'.
-# . Click on "Save" button.
+# . Search `CookieConsent` option.
+# . Toggle `Use CookieConsent`.
+# . Click on `Save` button.
.. image:: static/description/cookieconsent.png
@@ -26,17 +26,22 @@ To configure this module, you need to:
Notes
=====
-The files inside '/static/src/js', '/static/src/css' and '/static/src/i18n' are the default configuration, stylesheets
+The files inside `/static/src/js`, `/static/src/css` and `/static/src/i18n` are the default configuration, stylesheets
and locales used by CookieConsent.
The [upstream maintainer](https://github.com/orestbida/cookieconsent) offers a [playground](https://playground.cookieconsent.orestbida.com/)
to test the extent of the customization.
-Credits
-=======
+Notice
+======
-Authors
+For the version 1.0.0, the configuration is only for the default native website.
-~~~~~~~
+Contributors
+============
-* Numigi
+* Numigi (tm) and all its contributors (https://bit.ly/numigiens)
+
+More information
+================
+* Meet us at https://bit.ly/numigi-com
diff --git a/website_cookieconsent/__init__.py b/website_cookieconsent/__init__.py
index ee58467..d403935 100644
--- a/website_cookieconsent/__init__.py
+++ b/website_cookieconsent/__init__.py
@@ -1,3 +1,4 @@
# Copyright 2024 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
+
from . import models
diff --git a/website_cookieconsent/__manifest__.py b/website_cookieconsent/__manifest__.py
index f62165c..dd54d05 100644
--- a/website_cookieconsent/__manifest__.py
+++ b/website_cookieconsent/__manifest__.py
@@ -5,8 +5,10 @@
"name": "Website CookieConsent",
"summary": "CookieConsent integration",
"category": "Website",
- "version": "14.0.1.1.0",
+ "version": "14.0.1.0.0",
"author": "Numigi",
+ "maintainer": "Numigi",
+ "website": "https://bit.ly/numigi-com",
"license": "AGPL-3",
"depends": ["website"],
"data": [
diff --git a/website_cookieconsent/i18n/fr.po b/website_cookieconsent/i18n/fr.po
index fb97974..52602f4 100644
--- a/website_cookieconsent/i18n/fr.po
+++ b/website_cookieconsent/i18n/fr.po
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-09-04 00:38+0000\n"
-"PO-Revision-Date: 2024-09-04 00:38+0000\n"
+"POT-Creation-Date: 2024-09-06 02:52+0000\n"
+"PO-Revision-Date: 2024-09-06 02:52+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -15,7 +15,47 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
+#. module: website_cookieconsent
+#: model:ir.model,name:website_cookieconsent.model_res_config_settings
+msgid "Config Settings"
+msgstr "Paramètres"
+
+#. module: website_cookieconsent
+#: model:ir.model.fields,field_description:website_cookieconsent.field_res_config_settings__display_name
+#: model:ir.model.fields,field_description:website_cookieconsent.field_website__display_name
+msgid "Display Name"
+msgstr "Nom affiché"
+
#. module: website_cookieconsent
#: model_terms:ir.ui.view,arch_db:website_cookieconsent.res_config_settings_view_form
-msgid "Add CookieConsent functionality"
-msgstr "Ajouter la fonction CookieConsent"
+msgid "Display a cookie banner on your website"
+msgstr "Afficher une bannière de cookies sur votre site web"
+
+#. module: website_cookieconsent
+#: model:ir.model.fields,help:website_cookieconsent.field_res_config_settings__website_cookieconsent_enabled
+#: model:ir.model.fields,help:website_cookieconsent.field_website__cookieconsent_enabled
+msgid "Display a cookie banner on your website."
+msgstr "Afficher une bannière de cookies sur votre site web."
+
+#. module: website_cookieconsent
+#: model:ir.model.fields,field_description:website_cookieconsent.field_res_config_settings__id
+#: model:ir.model.fields,field_description:website_cookieconsent.field_website__id
+msgid "ID"
+msgstr ""
+
+#. module: website_cookieconsent
+#: model:ir.model.fields,field_description:website_cookieconsent.field_res_config_settings____last_update
+#: model:ir.model.fields,field_description:website_cookieconsent.field_website____last_update
+msgid "Last Modified on"
+msgstr "Dernière modification le"
+
+#. module: website_cookieconsent
+#: model:ir.model.fields,field_description:website_cookieconsent.field_res_config_settings__website_cookieconsent_enabled
+#: model:ir.model.fields,field_description:website_cookieconsent.field_website__cookieconsent_enabled
+msgid "Use CookieConsent"
+msgstr "Utiliser CookieConsent"
+
+#. module: website_cookieconsent
+#: model:ir.model,name:website_cookieconsent.model_website
+msgid "Website"
+msgstr "Site web"
\ No newline at end of file
diff --git a/website_cookieconsent/models/__init__.py b/website_cookieconsent/models/__init__.py
index ba62e14..b4f3ff6 100644
--- a/website_cookieconsent/models/__init__.py
+++ b/website_cookieconsent/models/__init__.py
@@ -1,2 +1,5 @@
+# Copyright 2024 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
+
from . import res_config_settings
from . import website
diff --git a/website_cookieconsent/models/res_config_settings.py b/website_cookieconsent/models/res_config_settings.py
index a4d273b..2b2bfc0 100644
--- a/website_cookieconsent/models/res_config_settings.py
+++ b/website_cookieconsent/models/res_config_settings.py
@@ -1,20 +1,14 @@
-from odoo import api, fields, models
+# Copyright 2024 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-class ResConfigSettings(models.TransientModel):
- _inherit = "res.config.settings"
+from odoo import fields, models
- @api.depends("website_id.cookieconsent_enabled")
- def _compute_cookieconsent_enabled(self):
- for record in self:
- record.update({"cookieconsent_enabled": True})
- def _inverse_cookieconsent_enabled(self):
- for record in self:
- record.website_id.update({"cookieconsent_enabled": False})
+class ResConfigSettings(models.TransientModel):
+ _inherit = "res.config.settings"
website_cookieconsent_enabled = fields.Boolean(
related="website_id.cookieconsent_enabled",
string="Use CookieConsent",
- compute="_compute_cookieconsent_enabled",
- inverse="_inverse_cookieconsent_enabled",
+ readonly=False,
)
diff --git a/website_cookieconsent/models/website.py b/website_cookieconsent/models/website.py
index f119545..219c232 100644
--- a/website_cookieconsent/models/website.py
+++ b/website_cookieconsent/models/website.py
@@ -1,9 +1,12 @@
+# Copyright 2024 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
+
from odoo import fields, models
+
class Website(models.Model):
_inherit = "website"
cookieconsent_enabled = fields.Boolean(
- string="Use CookieConsent",
- help="Display a cookie banner on your website."
+ string="Use CookieConsent", help="Display a cookie banner on your website."
)
diff --git a/website_cookieconsent/static/src/i18n/en.json b/website_cookieconsent/static/src/i18n/en.json
index 4cfecbb..c994682 100644
--- a/website_cookieconsent/static/src/i18n/en.json
+++ b/website_cookieconsent/static/src/i18n/en.json
@@ -95,4 +95,4 @@
}
]
}
-}
\ No newline at end of file
+}
diff --git a/website_cookieconsent/static/src/i18n/fr.json b/website_cookieconsent/static/src/i18n/fr.json
new file mode 100644
index 0000000..e286aea
--- /dev/null
+++ b/website_cookieconsent/static/src/i18n/fr.json
@@ -0,0 +1,98 @@
+{
+ "consentModal": {
+ "title": "Avant de continuer",
+ "description": "Notre site utilise des cookies essentiels pour améliorer votre expérience de navigation, vous garder connecté et des cookies de suivi pour comprendre comment vous interagissez avec lui.",
+ "acceptAllBtn": "Tout accepter",
+ "acceptNecessaryBtn": "Tout rejeter",
+ "showPreferencesBtn": "Gérer les préférences"
+ },
+ "preferencesModal": {
+ "title": "Centre de consentement aux cookies",
+ "acceptAllBtn": "Tout accepter",
+ "acceptNecessaryBtn": "Tout rejeter",
+ "savePreferencesBtn": "Enregistrer les préférences",
+ "closeIconLabel": "Fermer",
+ "sections": [
+ {
+ "title": "Utilisation des cookies",
+ "description": "Nous utilisons des cookies pour assurer les fonctionnalités de base de notre site et améliorer votre expérience en ligne. Vous pouvez choisir pour chaque catégorie de vous inscrire ou de vous désinscrire à tout moment. Vos préférences en matière de cookies peuvent être gérées en visitant notre politique de cookies."
+ },
+ {
+ "title": "Cookies strictement nécessaires",
+ "description": "Fournir et maintenir des services, comme suivre les pannes ou vous garder connecté.",
+ "linkedCategory": "nécessaire",
+ "cookieTable": {
+ "headers": {
+ "name": "Nom",
+ "domain": "Service",
+ "description": "Description",
+ "expiration": "Expiration"
+ },
+ "body": [
+ {
+ "name": "session_id",
+ "domain": "Site Web",
+ "description": "Cookie défini par le site actuel.",
+ "expiration": "90 jours"
+ },
+ {
+ "name": "tz",
+ "domain": "Site Web",
+ "description": "Détecte le fuseau horaire de votre navigateur.",
+ "expiration": "N/A"
+ },
+ {
+ "name": "frontend_lang",
+ "domain": "Site Web",
+ "description": "Détecte la langue de votre navigateur.",
+ "expiration": "N/A"
+ },
+ {
+ "name": "cc_cookie",
+ "domain": "Site Web",
+ "description": "Stocke votre consentement aux cookies.",
+ "expiration": "N/A"
+ }
+ ]
+ }
+ },
+ {
+ "title": "Cookies d'analyse",
+ "description": "Ces cookies permettent au site de se souvenir des choix que vous avez faits dans le passé.",
+ "linkedCategory": "analyse",
+ "cookieTable": {
+ "headers": {
+ "name": "Nom",
+ "domain": "Service",
+ "description": "Description",
+ "expiration": "Expiration"
+ },
+ "body": [
+ {
+ "name": "_pk_id",
+ "domain": "Analyse",
+ "description": "Cookie défini par Analytics.",
+ "expiration": "13 mois"
+ },
+ {
+ "name": "_pk_ses",
+ "domain": "Analyse",
+ "description": "Cookie défini par Analytics.",
+ "expiration": "30 minutes"
+ },
+ {
+ "name": "foo",
+ "domain": "Salutations",
+ "description": "Cookie défini par Greetings.",
+ "expiration": "N/A"
+ }
+ ]
+ }
+ },
+ {
+ "title": "Plus d'informations",
+ "description": "Pour toute question concernant notre politique sur les cookies et vos choix, veuillez nous contacter."
+ }
+ ]
+ }
+}
diff --git a/website_cookieconsent/static/src/js/config.js b/website_cookieconsent/static/src/js/config.js
index ae624ee..620b056 100644
--- a/website_cookieconsent/static/src/js/config.js
+++ b/website_cookieconsent/static/src/js/config.js
@@ -1,42 +1,40 @@
import "https://cdn.jsdelivr.net/gh/orestbida/cookieconsent@3.0.1/dist/cookieconsent.umd.js";
CookieConsent.run({
- disablePageInteraction: false,
- guiOptions: {
- consentModal: {
- layout: "box",
- position: "bottom left",
- },
- },
+ disablePageInteraction: false,
- categories: {
- necessary: {
- enabled: true, // this category is enabled by default
- readOnly: true, // this category cannot be disabled
- },
- analytics: {},
- ads: {},
- },
+ guiOptions: {
+ consentModal: {
+ layout: "box",
+ position: "bottom left",
+ },
+ },
+
+ categories: {
+ necessary: {
+ enabled: true, // this category is enabled by default
+ readOnly: true, // this category cannot be disabled
+ },
+ analytics: {},
+ ads: {},
+ },
- language: {
- default: "en",
- translations: {
- en: async () => {
- const res = await fetch(
- "/website_cookieconsent/static/src/i18n/en.json"
- );
- return await res.json();
+ language: {
+ default: "en",
+ translations: {
+ en: async () => {
+ const res = await fetch(
+ "/website_cookieconsent/static/src/i18n/en.json"
+ );
+ return await res.json();
+ },
+ fr: async () => {
+ const res = await fetch(
+ "/website_cookieconsent/static/src/i18n/fr.json"
+ );
+ return await res.json();
+ },
+ },
},
- },
- },
- // Used for Matomo
- // onChange: ({ changedCategories }) => {
- // if (changedCategories.includes("analytics")) {
- // if (!CookieConsent.acceptedCategory("analytics")) {
- // _paq.push(["forgetConsentGiven"]);
- // } else {
- // _paq.push(["setConsentGiven"]);
- // }
- // }
- // },
+
});