diff --git a/website_cookie_notice/README.rst b/website_cookie_notice/README.rst index 98bc69d49a..921a6f16bc 100644 --- a/website_cookie_notice/README.rst +++ b/website_cookie_notice/README.rst @@ -4,32 +4,49 @@ Cookie notice ============= -This module adds the cookie notice, according to the `cookie law `_, to your website - +This module adds the cookie notice, according to the `european cookie law +`_, +to your website. Configuration ============= -To change default options, go to your company form, click on 'cookie notice' tab and edit module options +To change the cookie message: + +* Go to *Settings > Technical > User Interface > Views*. +* Search for the view called *cookiebanner*. +* Change as you wish. Remember that you will probably lose translations then. +If you are developing a theme for Odoo, remember that this message has the +``cc-cookies`` class. You can style it at will too. -Known issues / Roadmap +Known Issues / Roadmap ====================== -TODO ----- +* If you are using this module in version < 8.0.2.0.0 and update it, any other + module that modifies the ``res.company`` view will break in the next update + if Odoo decides to update it before this one. To avoid that: -* Add to company form remaining options https://github.com/eLBati/website/blob/cookie_law/website_cookie_notice/static/src/js/jquery.cookiecuttr.js#L27 + 1. Stop your server. + 2. Update only this module: ``odoo.py -u website_cookie_notice``. + 3. Stop your server. + 4. Update all other modules: ``odoo.py -u all``. + 5. Start your server. +* Before version 8.0.2.0.0 of this module, users had the ability to configure + the message functionality and appearance from the main company form. + + Now, the message is generated in a view. This means that after upgrading to + >= 8.0.2.0.0 you will lose your previous customized messages. If you want to + customize it, please follow steps in the configuration section. Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. -In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed feedback -`here `_. - +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed feedback. Credits ======= @@ -38,6 +55,8 @@ Contributors ------------ * Lorenzo Battistini +* Rafael Blasco +* Jairo Llopis Maintainer ---------- diff --git a/website_cookie_notice/__init__.py b/website_cookie_notice/__init__.py index 9dfb13907a..904be4b16b 100644 --- a/website_cookie_notice/__init__.py +++ b/website_cookie_notice/__init__.py @@ -1,21 +1,5 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2015 Agile Business Group sagl () -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2015-2016 Lorenzo Battistini - Agile Business Group +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from . import controllers -from . import models diff --git a/website_cookie_notice/__openerp__.py b/website_cookie_notice/__openerp__.py index e9edc08740..4951e5b670 100644 --- a/website_cookie_notice/__openerp__.py +++ b/website_cookie_notice/__openerp__.py @@ -1,39 +1,22 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2015 Agile Business Group sagl () -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2015-2016 Lorenzo Battistini - Agile Business Group +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Cookie notice', 'summary': 'Show cookie notice according to cookie law', - 'version': '8.0.1.0.0', + 'version': '9.0.1.0.0', 'category': 'Website', - 'author': "Agile Business Group,Odoo Community Association (OCA)", + 'author': "Agile Business Group, " + "Tecnativa, " + "Odoo Community Association (OCA)", 'website': 'http://www.agilebg.com', 'license': 'AGPL-3', 'depends': [ - 'website', + 'website_legal_page', ], 'data': [ - 'website.xml', - 'views/res_company_view.xml', - ], - 'qweb': [ + 'views/website.xml', ], 'installable': False, 'auto_install': False, diff --git a/website_cookie_notice/controllers/__init__.py b/website_cookie_notice/controllers/__init__.py index b51ccb618c..6c07b25d8a 100644 --- a/website_cookie_notice/controllers/__init__.py +++ b/website_cookie_notice/controllers/__init__.py @@ -1,20 +1,5 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2015 Agile Business Group sagl () -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2015-2016 Lorenzo Battistini - Agile Business Group +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from . import main diff --git a/website_cookie_notice/controllers/main.py b/website_cookie_notice/controllers/main.py index 1a41eb61d7..1dc7a3e7bf 100644 --- a/website_cookie_notice/controllers/main.py +++ b/website_cookie_notice/controllers/main.py @@ -1,56 +1,19 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2015 Agile Business Group sagl () -# Copyright (C) 2015 Lorenzo Battistini -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2015-2016 Lorenzo Battistini - Agile Business Group +# Copyright 2015 Antiun Ingeniería S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp.addons.web import http -from openerp.http import request - -CONFIG_FIELDS = [ - 'cookieAnalytics', - 'cookieMessage', - 'cookiePolicyLink', - 'cookieOverlayEnabled', - 'cookieAnalyticsMessage', - 'cookieErrorMessage', - 'cookieDeclineButton', - 'cookieAcceptButton', - 'cookieResetButton', - 'cookieWhatAreTheyLink', - 'cookieAcceptButtonText', - 'cookieDeclineButtonText', - 'cookieResetButtonText', - ] +from openerp import http class CookieNotice(http.Controller): @http.route( - ['/cookie_notice/get_config'], type='json', auth="public", - website=True) - def get_cookie_notice_config(self): - cr, uid, context, pool = ( - request.cr, request.uid, request.context, request.registry) - user_model = pool['res.users'] - company_model = pool['res.company'] - company_id = user_model._get_company(cr, uid, context) - company = company_model.browse(cr, uid, company_id, context) - res = {} - for field in CONFIG_FIELDS: - res[field] = getattr(company, field) - return res + "/website_cookie_notice/ok", auth="public", website=True, type='json', + methods=['POST']) + def accept_cookies(self): + """Stop spamming with cookie banner.""" + http.request.httpsession["accepted_cookies"] = True + http.request.env['ir.ui.view'].search([ + ('type', '=', 'qweb') + ]).clear_caches() + return {'result': 'ok'} diff --git a/website_cookie_notice/i18n/ca.po b/website_cookie_notice/i18n/ca.po new file mode 100644 index 0000000000..c4d6c541e7 --- /dev/null +++ b/website_cookie_notice/i18n/ca.po @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_cookie_notice +# +# Translators: +# Carles Antolí , 2016 +msgid "" +msgstr "" +"Project-Id-Version: website (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-02-25 14:25+0000\n" +"PO-Revision-Date: 2016-02-24 11:52+0000\n" +"Last-Translator: Pedro M. Baeza \n" +"Language-Team: Catalan (http://www.transifex.com/oca/OCA-website-8-0/language/ca/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: ca\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "" +". To disable them, configure your browser properly. If you keep using this " +"website, you are accepting those." +msgstr "" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "We use cookies in this website. Read about them in our" +msgstr "Utilitzem cookies en aquest lloc web. Llegir sobre elles en el nostre" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "privacy policy" +msgstr "Política privacitat" diff --git a/website_cookie_notice/i18n/de.po b/website_cookie_notice/i18n/de.po new file mode 100644 index 0000000000..2a7d497ff2 --- /dev/null +++ b/website_cookie_notice/i18n/de.po @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_cookie_notice +# +# Translators: +# Rudolf Schnapka , 2016 +msgid "" +msgstr "" +"Project-Id-Version: website (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-02-25 14:25+0000\n" +"PO-Revision-Date: 2016-02-24 11:52+0000\n" +"Last-Translator: Pedro M. Baeza \n" +"Language-Team: German (http://www.transifex.com/oca/OCA-website-8-0/language/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "" +". To disable them, configure your browser properly. If you keep using this " +"website, you are accepting those." +msgstr "" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "We use cookies in this website. Read about them in our" +msgstr "Wir verwenden Cookies in dieser Webseite. Lesen Sie mehr zu diesen in unserer" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "privacy policy" +msgstr "Datenschutzerklärung" diff --git a/website_cookie_notice/i18n/el_GR.po b/website_cookie_notice/i18n/el_GR.po new file mode 100644 index 0000000000..a0c0707cf6 --- /dev/null +++ b/website_cookie_notice/i18n/el_GR.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_cookie_notice +# +# Translators: +# Goutoudis Kostas , 2015 +msgid "" +msgstr "" +"Project-Id-Version: website (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-11-28 02:04+0000\n" +"PO-Revision-Date: 2015-11-24 16:05+0000\n" +"Last-Translator: Goutoudis Kostas \n" +"Language-Team: Greek (Greece) (http://www.transifex.com/oca/OCA-website-8-0/language/el_GR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: el_GR\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid ". To disable them, configure your browser properly. If you keep using this website, you are accepting those." +msgstr ". Για να απενεργοποιήσετε τα cookies, ρυθμίσετε κατάλληλα τον browser σας. Εάν συνεχίσετε τη χρήση αυτού του ιστότοπου, αποδέχεστε αυτούς τους όρους." + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "We use cookies in this website. Read about them in our" +msgstr "Χρησιμοποιούμε cookies σε αυτόν τον ιστότοπο. Διαβάστε σχετικά την" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "privacy policy" +msgstr "πολιτική απορρήτου" diff --git a/website_cookie_notice/i18n/es.po b/website_cookie_notice/i18n/es.po index 1e3365e37b..6bfe06bfa6 100644 --- a/website_cookie_notice/i18n/es.po +++ b/website_cookie_notice/i18n/es.po @@ -1,149 +1,33 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * website_cookie_notice +# * website_cookie_notice # +# Translators: msgid "" msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" +"Project-Id-Version: website (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-06-23 19:38+0000\n" -"PO-Revision-Date: 2015-06-23 19:38+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" +"POT-Creation-Date: 2016-01-19 11:34+0000\n" +"PO-Revision-Date: 2016-01-28 15:39+0000\n" +"Last-Translator: Antonio Espinosa \n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-website-8-0/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: website_cookie_notice -#: code:addons/website_cookie_notice/models/res_company.py:67 -#, python-format -msgid "ACCEPT COOKIES" -msgstr "ACEPTAR" +#: view:website:website_cookie_notice.message +msgid ". To disable them, configure your browser properly. If you keep using this website, you are accepting those." +msgstr ". Para desactivarlas, configure adecuadamente su navegador. Si continúa usando este sitio web, está aceptándolas." #. module: website_cookie_notice -#: model:ir.model,name:website_cookie_notice.model_res_company -msgid "Companies" -msgstr "Compañías" +#: view:website:website_cookie_notice.message +msgid "We use cookies in this website. Read about them in our" +msgstr "Usamos cookies en este sitio web. Lea más acerca de ellas en nuestra" #. module: website_cookie_notice -#: view:res.company:website_cookie_notice.view_company_form -msgid "Cookie notice" -msgstr "Aviso de uso de cookies" - -#. module: website_cookie_notice -#: code:addons/website_cookie_notice/models/res_company.py:70 -#, python-format -msgid "DECLINE COOKIES" -msgstr "RECHAZAR" - -#. module: website_cookie_notice -#: code:addons/website_cookie_notice/models/res_company.py:74 -#, python-format -msgid "RESET COOKIES FOR THIS WEBSITE" -msgstr "ELIMINAR COOKIES" - -#. module: website_cookie_notice -#: code:addons/website_cookie_notice/models/res_company.py:33 -#, python-format -msgid "We use cookies on this website, you can read about them here. To use the website as intended please..." -msgstr "Usamos cookies en este sitio web, usted puede saber más sobre ellas en" -" " -" nuestra politica de privacidad. Para continuar por favor pulse en ..." - -#. module: website_cookie_notice -#: code:addons/website_cookie_notice/models/res_company.py:47 -#, python-format -msgid "We use cookies, just to track visits to our website, we store no personal details." -msgstr "Usamos cookies sólo para analizar las visitas a este sitio web," -" no almacenamos ningún dato personal." - -#. module: website_cookie_notice -#: code:addons/website_cookie_notice/models/res_company.py:52 -#, python-format -msgid "We're sorry, this feature places cookies in your browser and has been disabled.
To continue using this functionality, please" -msgstr "Lo sentimos, esta funcionalidad almacena cookies en su navegador" -" y ha sido deshabilitada.
Para seguir utilizando esta funcionalidad," -" por favor pulse en ..." - -#. module: website_cookie_notice -#: field:res.company,cookieAcceptButton:0 -msgid "cookieAcceptButton" -msgstr "cookieAcceptButton" - -#. module: website_cookie_notice -#: field:res.company,cookieAcceptButtonText:0 -msgid "cookieAcceptButtonText" -msgstr "cookieAcceptButtonText" - -#. module: website_cookie_notice -#: field:res.company,cookieAnalytics:0 -msgid "cookieAnalytics" -msgstr "cookieAnalytics" - -#. module: website_cookie_notice -#: field:res.company,cookieAnalyticsMessage:0 -msgid "cookieAnalyticsMessage" -msgstr "cookieAnalyticsMessage" - -#. module: website_cookie_notice -#: field:res.company,cookieDeclineButton:0 -msgid "cookieDeclineButton" -msgstr "cookieDeclineButton" - -#. module: website_cookie_notice -#: field:res.company,cookieDeclineButtonText:0 -msgid "cookieDeclineButtonText" -msgstr "cookieDeclineButtonText" - -#. module: website_cookie_notice -#: field:res.company,cookieErrorMessage:0 -msgid "cookieErrorMessage" -msgstr "cookieErrorMessage" - -#. module: website_cookie_notice -#: field:res.company,cookieMessage:0 -msgid "cookieMessage" -msgstr "cookieMessage" - -#. module: website_cookie_notice -#: field:res.company,cookieOverlayEnabled:0 -msgid "cookieOverlayEnabled" -msgstr "cookieOverlayEnabled" - -#. module: website_cookie_notice -#: field:res.company,cookiePolicyLink:0 -msgid "cookiePolicyLink" -msgstr "cookiePolicyLink" - -#. module: website_cookie_notice -#: field:res.company,cookieResetButton:0 -msgid "cookieResetButton" -msgstr "cookieResetButton" - -#. module: website_cookie_notice -#: field:res.company,cookieResetButtonText:0 -msgid "cookieResetButtonText" -msgstr "cookieResetButtonText" - -#. module: website_cookie_notice -#: field:res.company,cookieWhatAreTheyLink:0 -msgid "cookieWhatAreTheyLink" -msgstr "cookieWhatAreTheyLink" - -#. module: website_cookie_notice -#: help:res.company,cookieOverlayEnabled:0 -msgid "don't want a discreet toolbar? Fine, set this to true" -msgstr "¿No quiere una barra discreta? Entonces, active esta opción" - -#. module: website_cookie_notice -#: help:res.company,cookiePolicyLink:0 -msgid "if applicable, enter the link to your privacy policy here..." -msgstr "Si aplica, introduce el enlace a la página de Política de Privacidad aquí ..." - -#. module: website_cookie_notice -#: help:res.company,cookieAnalytics:0 -msgid "just using a simple analytics package? change this to true" -msgstr "¿Está usando sólo cookies para medir las visitas?" -" Entonces, activa esta opción y se mostrará el mensaje configurado en 'cookieAnalyticsMessage'" - +#: view:website:website_cookie_notice.message +msgid "privacy policy" +msgstr "política de privacidad" diff --git a/website_cookie_notice/i18n/fr.po b/website_cookie_notice/i18n/fr.po new file mode 100644 index 0000000000..fe492c523b --- /dev/null +++ b/website_cookie_notice/i18n/fr.po @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_cookie_notice +# +# Translators: +# Christophe CHAUVET , 2016 +msgid "" +msgstr "" +"Project-Id-Version: website (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-05-06 02:53+0000\n" +"PO-Revision-Date: 2016-05-06 08:53+0000\n" +"Last-Translator: Christophe CHAUVET \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-website-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "" +". To disable them, configure your browser properly. If you keep using this " +"website, you are accepting those." +msgstr ". Pour les désactivés, configurer votre navigateur correctement. SI vous utilisez ce site web, vous devez les accepter." + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "We use cookies in this website. Read about them in our" +msgstr "Nous utilisons les cookies sur ce site web. En savoir plus de nos" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "privacy policy" +msgstr "politique de vie privée" diff --git a/website_cookie_notice/i18n/hr_HR.po b/website_cookie_notice/i18n/hr_HR.po new file mode 100644 index 0000000000..450c658e2a --- /dev/null +++ b/website_cookie_notice/i18n/hr_HR.po @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_cookie_notice +# +# Translators: +# Bole , 2016 +msgid "" +msgstr "" +"Project-Id-Version: website (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-06-04 02:47+0000\n" +"PO-Revision-Date: 2016-05-31 20:31+0000\n" +"Last-Translator: Bole \n" +"Language-Team: Croatian (Croatia) (http://www.transifex.com/oca/OCA-website-8-0/language/hr_HR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr_HR\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "" +". To disable them, configure your browser properly. If you keep using this " +"website, you are accepting those." +msgstr "Za onemogućavanje, potrebno je podesiti vaš pretraživač. Ukoliko nastavite koristiti website, prihvaćate ih." + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "We use cookies in this website. Read about them in our" +msgstr "Na ovim stranicama koristimo kolačiće, o kojima možete više saznati u našoj " + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "privacy policy" +msgstr "izjavi o privatnosti" diff --git a/website_cookie_notice/i18n/it.po b/website_cookie_notice/i18n/it.po new file mode 100644 index 0000000000..da0bc485c1 --- /dev/null +++ b/website_cookie_notice/i18n/it.po @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_cookie_notice +# +# Translators: +# Paolo Valier, 2016 +msgid "" +msgstr "" +"Project-Id-Version: website (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-12 02:17+0000\n" +"PO-Revision-Date: 2016-03-11 10:04+0000\n" +"Last-Translator: Paolo Valier\n" +"Language-Team: Italian (http://www.transifex.com/oca/OCA-website-8-0/language/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "" +". To disable them, configure your browser properly. If you keep using this " +"website, you are accepting those." +msgstr ". Per disabilitarli configura il tuo browser di conseguenza. L'utilizzo del sito implica l'accettazione degli stessi." + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "We use cookies in this website. Read about them in our" +msgstr "Questo sito utilizza cookie. Leggi di più nell'" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "privacy policy" +msgstr "Informativa sulla Privacy" diff --git a/website_cookie_notice/i18n/pt_BR.po b/website_cookie_notice/i18n/pt_BR.po new file mode 100644 index 0000000000..1314e55525 --- /dev/null +++ b/website_cookie_notice/i18n/pt_BR.po @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_cookie_notice +# +# Translators: +# danimaribeiro , 2016 +msgid "" +msgstr "" +"Project-Id-Version: website (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-12 02:17+0000\n" +"PO-Revision-Date: 2016-03-05 18:09+0000\n" +"Last-Translator: danimaribeiro \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-website-8-0/language/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "" +". To disable them, configure your browser properly. If you keep using this " +"website, you are accepting those." +msgstr ", Para desabilitar eles, configure seu browser adequadamente. Se você continuar usando este site, você aceita eles." + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "We use cookies in this website. Read about them in our" +msgstr "Nós usamos cookies neste site. Leia mais sobre em nosso" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "privacy policy" +msgstr "política de privacidade" diff --git a/website_cookie_notice/i18n/ru.po b/website_cookie_notice/i18n/ru.po new file mode 100644 index 0000000000..b90d088976 --- /dev/null +++ b/website_cookie_notice/i18n/ru.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_cookie_notice +# +# Translators: +# Mikhail - , 2016 +msgid "" +msgstr "" +"Project-Id-Version: website (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-01-19 11:34+0000\n" +"PO-Revision-Date: 2016-01-15 21:23+0000\n" +"Last-Translator: Mikhail - \n" +"Language-Team: Russian (http://www.transifex.com/oca/OCA-website-8-0/language/ru/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: ru\n" +"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid ". To disable them, configure your browser properly. If you keep using this website, you are accepting those." +msgstr ". Чтобы отключить их, настройте свой браузер. Если Вы продолжите просматривать данный сайт, Вы автоматически соглашаетесь с этим." + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "We use cookies in this website. Read about them in our" +msgstr "Мы используем куки на этом сайте. Узнайте о них на нашем" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "privacy policy" +msgstr "политика конфиденциальности" diff --git a/website_cookie_notice/i18n/sl.po b/website_cookie_notice/i18n/sl.po new file mode 100644 index 0000000000..01748399be --- /dev/null +++ b/website_cookie_notice/i18n/sl.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_cookie_notice +# +# Translators: +# Matjaž Mozetič , 2015 +msgid "" +msgstr "" +"Project-Id-Version: website (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-11-23 10:22+0000\n" +"PO-Revision-Date: 2015-11-04 05:32+0000\n" +"Last-Translator: Matjaž Mozetič \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-website-8-0/language/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid ". To disable them, configure your browser properly. If you keep using this website, you are accepting those." +msgstr ". Da bi jih onemogočili, temu primerno nastavite svoj brskalnik. Če boste nadaljevali z uporabo te spletne strani, smatramo, da jih sprejemate." + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "We use cookies in this website. Read about them in our" +msgstr "Naša spletna stran uporablja piškotke. Več o njih preberite v naših" + +#. module: website_cookie_notice +#: view:website:website_cookie_notice.message +msgid "privacy policy" +msgstr "pravilih o zasebnosti" diff --git a/website_cookie_notice/i18n/website_cookie_notice.pot b/website_cookie_notice/i18n/website_cookie_notice.pot deleted file mode 100644 index 5db3b50a9b..0000000000 --- a/website_cookie_notice/i18n/website_cookie_notice.pot +++ /dev/null @@ -1,143 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * website_cookie_notice -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-06-23 19:38+0000\n" -"PO-Revision-Date: 2015-06-23 19:38+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: website_cookie_notice -#: code:addons/website_cookie_notice/models/res_company.py:67 -#, python-format -msgid "ACCEPT COOKIES" -msgstr "" - -#. module: website_cookie_notice -#: model:ir.model,name:website_cookie_notice.model_res_company -msgid "Companies" -msgstr "" - -#. module: website_cookie_notice -#: view:res.company:website_cookie_notice.view_company_form -msgid "Cookie notice" -msgstr "" - -#. module: website_cookie_notice -#: code:addons/website_cookie_notice/models/res_company.py:70 -#, python-format -msgid "DECLINE COOKIES" -msgstr "" - -#. module: website_cookie_notice -#: code:addons/website_cookie_notice/models/res_company.py:74 -#, python-format -msgid "RESET COOKIES FOR THIS WEBSITE" -msgstr "" - -#. module: website_cookie_notice -#: code:addons/website_cookie_notice/models/res_company.py:33 -#, python-format -msgid "We use cookies on this website, you can read about them here. To use the website as intended please..." -msgstr "" - -#. module: website_cookie_notice -#: code:addons/website_cookie_notice/models/res_company.py:47 -#, python-format -msgid "We use cookies, just to track visits to our website, we store no personal details." -msgstr "" - -#. module: website_cookie_notice -#: code:addons/website_cookie_notice/models/res_company.py:52 -#, python-format -msgid "We're sorry, this feature places cookies in your browser and has been disabled.
To continue using this functionality, please" -msgstr "" - -#. module: website_cookie_notice -#: field:res.company,cookieAcceptButton:0 -msgid "cookieAcceptButton" -msgstr "" - -#. module: website_cookie_notice -#: field:res.company,cookieAcceptButtonText:0 -msgid "cookieAcceptButtonText" -msgstr "" - -#. module: website_cookie_notice -#: field:res.company,cookieAnalytics:0 -msgid "cookieAnalytics" -msgstr "" - -#. module: website_cookie_notice -#: field:res.company,cookieAnalyticsMessage:0 -msgid "cookieAnalyticsMessage" -msgstr "" - -#. module: website_cookie_notice -#: field:res.company,cookieDeclineButton:0 -msgid "cookieDeclineButton" -msgstr "" - -#. module: website_cookie_notice -#: field:res.company,cookieDeclineButtonText:0 -msgid "cookieDeclineButtonText" -msgstr "" - -#. module: website_cookie_notice -#: field:res.company,cookieErrorMessage:0 -msgid "cookieErrorMessage" -msgstr "" - -#. module: website_cookie_notice -#: field:res.company,cookieMessage:0 -msgid "cookieMessage" -msgstr "" - -#. module: website_cookie_notice -#: field:res.company,cookieOverlayEnabled:0 -msgid "cookieOverlayEnabled" -msgstr "" - -#. module: website_cookie_notice -#: field:res.company,cookiePolicyLink:0 -msgid "cookiePolicyLink" -msgstr "" - -#. module: website_cookie_notice -#: field:res.company,cookieResetButton:0 -msgid "cookieResetButton" -msgstr "" - -#. module: website_cookie_notice -#: field:res.company,cookieResetButtonText:0 -msgid "cookieResetButtonText" -msgstr "" - -#. module: website_cookie_notice -#: field:res.company,cookieWhatAreTheyLink:0 -msgid "cookieWhatAreTheyLink" -msgstr "" - -#. module: website_cookie_notice -#: help:res.company,cookieOverlayEnabled:0 -msgid "don't want a discreet toolbar? Fine, set this to true" -msgstr "" - -#. module: website_cookie_notice -#: help:res.company,cookiePolicyLink:0 -msgid "if applicable, enter the link to your privacy policy here..." -msgstr "" - -#. module: website_cookie_notice -#: help:res.company,cookieAnalytics:0 -msgid "just using a simple analytics package? change this to true" -msgstr "" - diff --git a/website_cookie_notice/models/__init__.py b/website_cookie_notice/models/__init__.py deleted file mode 100644 index 663eb71784..0000000000 --- a/website_cookie_notice/models/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2015 Agile Business Group sagl () -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## -from . import res_company diff --git a/website_cookie_notice/models/res_company.py b/website_cookie_notice/models/res_company.py deleted file mode 100644 index 801e2ad24e..0000000000 --- a/website_cookie_notice/models/res_company.py +++ /dev/null @@ -1,75 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2015 Agile Business Group sagl () -# Copyright (C) 2015 Lorenzo Battistini -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp import models, fields -from openerp.tools.translate import _ - - -class Company(models.Model): - _inherit = "res.company" - cookieAnalytics = fields.Boolean( - string="cookieAnalytics", - help="just using a simple analytics package? change this to true") - cookieMessage = fields.Char( - string="cookieMessage", - default=_('We use cookies on this website, you can ' - 'read about them here. To use the website as ' - 'intended please...'), - translate=True) - cookiePolicyLink = fields.Char( - string="cookiePolicyLink", - help="if applicable, enter the link to your privacy policy here...", - default='/page/privacy') - cookieOverlayEnabled = fields.Boolean( - string="cookieOverlayEnabled", - help="don't want a discreet toolbar? Fine, set this to true") - cookieAnalyticsMessage = fields.Char( - string="cookieAnalyticsMessage", - default=_('We use cookies, just to track visits to our website, we ' - 'store no personal details.'), - translate=True) - cookieErrorMessage = fields.Char( - string="cookieErrorMessage", - default=_("We\'re sorry, this feature places cookies in your browser " - "and has been disabled.
To continue using this " - "functionality, please"), - translate=True) - cookieDeclineButton = fields.Boolean( - string="cookieDeclineButton") - cookieAcceptButton = fields.Boolean( - string="cookieAcceptButton", - default=True) - cookieResetButton = fields.Boolean( - string="cookieResetButton") - cookieWhatAreTheyLink = fields.Char( - string="cookieWhatAreTheyLink", - default="http://www.allaboutcookies.org/") - cookieAcceptButtonText = fields.Char( - string="cookieAcceptButtonText", default=_("ACCEPT COOKIES"), - translate=True) - cookieDeclineButtonText = fields.Char( - string="cookieDeclineButtonText", default=_("DECLINE COOKIES"), - translate=True) - cookieResetButtonText = fields.Char( - string="cookieResetButtonText", - default=_("RESET COOKIES FOR THIS WEBSITE"), - translate=True) diff --git a/website_cookie_notice/static/src/css/cookiecuttr.css b/website_cookie_notice/static/src/css/cookiecuttr.css deleted file mode 100644 index 99f38c3e20..0000000000 --- a/website_cookie_notice/static/src/css/cookiecuttr.css +++ /dev/null @@ -1,20 +0,0 @@ -/* To be used with cookieCuttr by Chris Wharton (http://cookiecuttr.com) */ - -.cc-cookies { width: 100%; left: 0; top: 0; padding: 0.5em 5%; background: #565656; background: rgba(86,86,86,0.95); color: #fff; font-size: 13px; font-weight: 700; text-shadow: 0 -1px 0 rgba(0,0,0,0.35); z-index: 99999; text-align: center; color: #fff; } -.cc-cookies a, .cc-cookies a:hover { color: #fff; text-decoration: underline; } -.cc-cookies a:hover { text-decoration: none; } -.cc-overlay { height: 100%; padding-top: 25%; } -.cc-cookies-error { float: left; width: 100%; text-align: center; margin: 1em 0 2em 0; background: #fff; padding: 2em 5%; border: 1px solid #ccc; font-size: 18px; color: #333; } -.cc-cookies a.cc-cookie-accept, .cc-cookies-error a.cc-cookie-accept, .cc-cookies a.cc-cookie-decline, .cc-cookies-error a.cc-cookie-decline, .cc-cookies a.cc-cookie-reset { display: inline-block; color: #fff; text-decoration: none; background: #7DAF3B; padding: 0.5em 0.75em; border-radius: 3px; box-shadow: 0 0 2px rgba(0,0,0,0.25); text-shadow: 0 -1px 0 rgba(0,0,0,0.35); -o-transition: background 0.5s ease-in; -webkit-transition: background 0.25s ease-in; -moz-transition: background 0.25s ease-in; } -.cc-cookies a.cc-cookie-decline, .cc-cookies-error a.cc-cookie-decline { background: #af3b3b; margin-left: 0.5em; } -.cc-cookies a.cc-cookie-reset { background: #f15b00; } -.cc-cookies a:hover.cc-cookie-accept, .cc-cookies-error a:hover.cc-cookie-accept, .cc-cookies a:hover.cc-cookie-decline, .cc-cookies-error a:hover.cc-cookie-decline, .cc-cookies a:hover.cc-cookie-reset { background: #000; -o-transition: background 0.5s ease-in; -webkit-transition: background 0.25s ease-in; -moz-transition: background 0.25s ease-in; } -.cc-cookies-error a.cc-cookie-accept, .cc-cookies-error a.cc-cookie-decline { display: block; margin-top: 1em; } -.cc-cookies.cc-discreet { width: auto; padding: 0.5em 1em; left: auto; top: auto; } -.cc-cookies.cc-discreet a.cc-cookie-reset { background: none; text-shadow: none; padding: 0; text-decoration: underline; } -.cc-cookies.cc-discreet a:hover.cc-cookie-reset { text-decoration: none; } - -@media screen and (max-width: 768px) { -.cc-cookies a.cc-cookie-accept, .cc-cookies a.cc-cookie-decline, .cc-cookies a.cc-cookie-reset { display: block; margin: 1em 0; } -} - diff --git a/website_cookie_notice/static/src/js/accept_cookies.js b/website_cookie_notice/static/src/js/accept_cookies.js new file mode 100644 index 0000000000..3c1954c8b3 --- /dev/null +++ b/website_cookie_notice/static/src/js/accept_cookies.js @@ -0,0 +1,23 @@ +/* © 2015 Antiun Ingeniería, S.L. + * © 2015 Lorenzo Battistini - Agile Business Group + * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + */ + +odoo.define('website_cookie_notice.cookie_notice', function (require) { + "use strict"; + + var ajax = require('web.ajax'); + var base = require('web_editor.base'); + + base.ready().done(function() { + $(".cc-cookies .btn-primary").click(function(e) { + e.preventDefault(); + ajax.jsonRpc('/website_cookie_notice/ok', 'call').then(function (data) { + if (data.result == 'ok') { + $(e.target).closest(".cc-cookies").hide("fast"); + } + }); + }); + }); +} +); diff --git a/website_cookie_notice/static/src/js/jquery.cookiecuttr.js b/website_cookie_notice/static/src/js/jquery.cookiecuttr.js deleted file mode 100644 index d90bccd1f1..0000000000 --- a/website_cookie_notice/static/src/js/jquery.cookiecuttr.js +++ /dev/null @@ -1,280 +0,0 @@ -/** - * Copyright (C) 2012 Chris Wharton (chris@weare2ndfloor.com) - * Copyright (C) 2015 Lorenzo Battistini - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT - * HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR - * FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE - * OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.COPYRIGHT HOLDERS WILL NOT - * BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL - * DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - - Documentation available at http://cookiecuttr.com - - */ -(function ($) { - $.cookieCuttr = function () { - var defaults = { - cookieCutter: false, // you'd like to enable the div/section/span etc. hide feature? change this to true - cookieCutterDeclineOnly: false, // you'd like the CookieCutter to only hide when someone has clicked declined set this to true - cookieDisable: '', - cookieExpires: 365, - cookieWhatAreLinkText: "What are cookies?", - cookieNotificationLocationBottom: false, // top or bottom - they are your only options, so true for bottom, false for top - cookiePolicyPage: false, - cookiePolicyPageMessage: 'Please read the information below and then choose from the following options', - cookieDiscreetLink: false, - cookieDiscreetReset: false, - cookieDiscreetLinkText: "Cookies?", - cookieDiscreetPosition: "topleft", //options: topleft, topright, bottomleft, bottomright - cookieNoMessage: false, // change to true hide message from all pages apart from your policy page - cookieDomain: "" - }; - openerp.jsonRpc("/cookie_notice/get_config", 'call', {}) - .then(function (options) { - var options = $.extend(defaults, options); - var message = options.cookieMessage.replace('{{cookiePolicyLink}}', options.cookiePolicyLink); - //convert options - var cookiePolicyLinkIn = options.cookiePolicyLink; - var cookieCutter = options.cookieCutter; - var cookieCutterDeclineOnly = options.cookieCutterDeclineOnly; - var cookieAnalytics = options.cookieAnalytics; - var cookieDeclineButton = options.cookieDeclineButton; - var cookieAcceptButton = options.cookieAcceptButton; - var cookieResetButton = options.cookieResetButton; - var cookieOverlayEnabled = options.cookieOverlayEnabled; - var cookiePolicyLink = options.cookiePolicyLink; - var cookieMessage = message; - var cookieAnalyticsMessage = options.cookieAnalyticsMessage; - var cookieErrorMessage = options.cookieErrorMessage; - var cookieDisable = options.cookieDisable; - var cookieWhatAreTheyLink = options.cookieWhatAreTheyLink; - var cookieExpires = options.cookieExpires; - var cookieAcceptButtonText = options.cookieAcceptButtonText; - var cookieDeclineButtonText = options.cookieDeclineButtonText; - var cookieResetButtonText = options.cookieResetButtonText; - var cookieWhatAreLinkText = options.cookieWhatAreLinkText; - var cookieNotificationLocationBottom = options.cookieNotificationLocationBottom; - var cookiePolicyPage = options.cookiePolicyPage; - var cookiePolicyPageMessage = options.cookiePolicyPageMessage; - var cookieDiscreetLink = options.cookieDiscreetLink; - var cookieDiscreetReset = options.cookieDiscreetReset; - var cookieDiscreetLinkText = options.cookieDiscreetLinkText; - var cookieDiscreetPosition = options.cookieDiscreetPosition; - var cookieNoMessage = options.cookieNoMessage; - // cookie identifier - var $cookieAccepted = $.cookie('cc_cookie_accept') == "cc_cookie_accept"; - $.cookieAccepted = function () { - return $cookieAccepted; - }; - var $cookieDeclined = $.cookie('cc_cookie_decline') == "cc_cookie_decline"; - $.cookieDeclined = function () { - return $cookieDeclined; - }; - // write cookie accept button - if (cookieAcceptButton) { - var cookieAccept = ' ' + cookieAcceptButtonText + ' '; - } else { - var cookieAccept = ""; - } - // write cookie decline button - if (cookieDeclineButton) { - var cookieDecline = ' ' + cookieDeclineButtonText + ' '; - } else { - var cookieDecline = ""; - } - // write extra class for overlay - if (cookieOverlayEnabled) { - var cookieOverlay = 'cc-overlay'; - } else { - var cookieOverlay = ""; - } - // to prepend or append, that is the question? - if ((cookieNotificationLocationBottom) || (cookieDiscreetPosition == "bottomright") || (cookieDiscreetPosition == "bottomleft")) { - var appOrPre = true; - } else { - var appOrPre = false; - } - if (($cookieAccepted) || ($cookieDeclined)) { - // write cookie reset button - if ((cookieResetButton) && (cookieDiscreetReset)) { - if (appOrPre) { - $('body').append(''); - } else { - $('body').prepend(''); - } - //add appropriate CSS depending on position chosen - if (cookieDiscreetPosition == "topleft") { - $('div.cc-cookies').css("top", "0"); - $('div.cc-cookies').css("left", "0"); - } - if (cookieDiscreetPosition == "topright") { - $('div.cc-cookies').css("top", "0"); - $('div.cc-cookies').css("right", "0"); - } - if (cookieDiscreetPosition == "bottomleft") { - $('div.cc-cookies').css("bottom", "0"); - $('div.cc-cookies').css("left", "0"); - } - if (cookieDiscreetPosition == "bottomright") { - $('div.cc-cookies').css("bottom", "0"); - $('div.cc-cookies').css("right", "0"); - } - } else if (cookieResetButton) { - if (appOrPre) { - $('body').append(''); - } else { - $('body').prepend(''); - } - } else { - var cookieResetButton = ""; - } - } else { - // add message to just after opening body tag - if ((cookieNoMessage) && (!cookiePolicyPage)) { - // show no link on any pages APART from the policy page - } else if ((cookieDiscreetLink) && (!cookiePolicyPage)) { // show discreet link - if (appOrPre) { - $('body').append(''); - } else { - $('body').prepend(''); - } - //add appropriate CSS depending on position chosen - if (cookieDiscreetPosition == "topleft") { - $('div.cc-cookies').css("top", "0"); - $('div.cc-cookies').css("left", "0"); - } - if (cookieDiscreetPosition == "topright") { - $('div.cc-cookies').css("top", "0"); - $('div.cc-cookies').css("right", "0"); - } - if (cookieDiscreetPosition == "bottomleft") { - $('div.cc-cookies').css("bottom", "0"); - $('div.cc-cookies').css("left", "0"); - } - if (cookieDiscreetPosition == "bottomright") { - $('div.cc-cookies').css("bottom", "0"); - $('div.cc-cookies').css("right", "0"); - } - } else if (cookieAnalytics) { // show analytics overlay - if (appOrPre) { - $('body').append('
' + cookieAnalyticsMessage + cookieAccept + cookieDecline + '' + cookieWhatAreLinkText + '
'); - } else { - $('body').prepend('
' + cookieAnalyticsMessage + cookieAccept + cookieDecline + '' + cookieWhatAreLinkText + '
'); - } - } - if (cookiePolicyPage) { // show policy page overlay - if (appOrPre) { - $('body').append('
' + cookiePolicyPageMessage + " " + ' ' + cookieAcceptButtonText + ' ' + ' ' + cookieDeclineButtonText + ' ' + '
'); - } else { - $('body').prepend('
' + cookiePolicyPageMessage + " " + ' ' + cookieAcceptButtonText + ' ' + ' ' + cookieDeclineButtonText + ' ' + '
'); - } - } else if ((!cookieAnalytics) && (!cookieDiscreetLink)) { // show privacy policy option - if (appOrPre) { - $('body').append('
' + cookieMessage + cookieAccept + cookieDecline + '
'); - } else { - $('body').prepend('
' + cookieMessage + cookieAccept + cookieDecline + '
'); - } - } - } - if ((cookieCutter) && (!cookieCutterDeclineOnly) && (($cookieDeclined) || (!$cookieAccepted))) { - $(cookieDisable).html('
' + cookieErrorMessage + ' ' + cookieAcceptButtonText + ' ' + '
'); - } - if ((cookieCutter) && (cookieCutterDeclineOnly) && ($cookieDeclined)) { - $(cookieDisable).html('
' + cookieErrorMessage + ' ' + cookieAcceptButtonText + ' ' + '
'); - } - // if bottom is true, switch div to bottom if not in discreet mode - if ((cookieNotificationLocationBottom) && (!cookieDiscreetLink)) { - $('div.cc-cookies').css("top", "auto"); - $('div.cc-cookies').css("bottom", "0"); - } - if ((cookieNotificationLocationBottom) && (cookieDiscreetLink) && (cookiePolicyPage)) { - $('div.cc-cookies').css("top", "auto"); - $('div.cc-cookies').css("bottom", "0"); - } - // setting the cookies - - // for top bar - $('.cc-cookie-accept, .cc-cookie-decline').click(function (e) { - e.preventDefault(); - if ($(this).is('[href$=#decline]')) { - $.cookie("cc_cookie_accept", null, { - path: '/' - }); - $.cookie("cc_cookie_decline", "cc_cookie_decline", { - expires: cookieExpires, - path: '/' - }); - if (options.cookieDomain) { - // kill google analytics cookies - $.cookie("__utma", null, { - domain: '.' + options.cookieDomain, - path: '/' - }); - $.cookie("__utmb", null, { - domain: '.' + options.cookieDomain, - path: '/' - }); - $.cookie("__utmc", null, { - domain: '.' + options.cookieDomain, - path: '/' - }); - $.cookie("__utmz", null, { - domain: '.' + options.cookieDomain, - path: '/' - }); - } - } else { - $.cookie("cc_cookie_decline", null, { - path: '/' - }); - $.cookie("cc_cookie_accept", "cc_cookie_accept", { - expires: cookieExpires, - path: '/' - }); - } - $(".cc-cookies").fadeOut(function () { - // reload page to activate cookies - location.reload(); - }); - }); - //reset cookies - $('a.cc-cookie-reset').click(function (f) { - f.preventDefault(); - $.cookie("cc_cookie_accept", null, { - path: '/' - }); - $.cookie("cc_cookie_decline", null, { - path: '/' - }); - $(".cc-cookies").fadeOut(function () { - // reload page to activate cookies - location.reload(); - }); - }); - //cookie error accept - $('.cc-cookies-error a.cc-cookie-accept').click(function (g) { - g.preventDefault(); - $.cookie("cc_cookie_accept", "cc_cookie_accept", { - expires: cookieExpires, - path: '/' - }); - $.cookie("cc_cookie_decline", null, { - path: '/' - }); - // reload page to activate cookies - location.reload(); - }); - }); - }; -})(jQuery); diff --git a/website_cookie_notice/static/src/js/js.cookie.js b/website_cookie_notice/static/src/js/js.cookie.js deleted file mode 100644 index 3354a1c9e9..0000000000 --- a/website_cookie_notice/static/src/js/js.cookie.js +++ /dev/null @@ -1,147 +0,0 @@ -/*! - * Javascript Cookie v1.5.1 - * https://github.com/js-cookie/js-cookie - * - * Copyright 2006, 2014 Klaus Hartl - * Released under the MIT license - */ -(function (factory) { - var jQuery; - if (typeof define === 'function' && define.amd) { - // AMD (Register as an anonymous module) - define(['jquery'], factory); - } else if (typeof exports === 'object') { - // Node/CommonJS - try { - jQuery = require('jquery'); - } catch(e) {} - module.exports = factory(jQuery); - } else { - // Browser globals - var _OldCookies = window.Cookies; - var api = window.Cookies = factory(window.jQuery); - api.noConflict = function() { - window.Cookies = _OldCookies; - return api; - }; - } -}(function ($) { - - var pluses = /\+/g; - - function encode(s) { - return api.raw ? s : encodeURIComponent(s); - } - - function decode(s) { - return api.raw ? s : decodeURIComponent(s); - } - - function stringifyCookieValue(value) { - return encode(api.json ? JSON.stringify(value) : String(value)); - } - - function parseCookieValue(s) { - if (s.indexOf('"') === 0) { - // This is a quoted cookie as according to RFC2068, unescape... - s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); - } - - try { - // Replace server-side written pluses with spaces. - // If we can't decode the cookie, ignore it, it's unusable. - // If we can't parse the cookie, ignore it, it's unusable. - s = decodeURIComponent(s.replace(pluses, ' ')); - return api.json ? JSON.parse(s) : s; - } catch(e) {} - } - - function read(s, converter) { - var value = api.raw ? s : parseCookieValue(s); - return isFunction(converter) ? converter(value) : value; - } - - function extend() { - var key, options; - var i = 0; - var result = {}; - for (; i < arguments.length; i++) { - options = arguments[ i ]; - for (key in options) { - result[key] = options[key]; - } - } - return result; - } - - function isFunction(obj) { - return Object.prototype.toString.call(obj) === '[object Function]'; - } - - var api = function (key, value, options) { - - // Write - - if (arguments.length > 1 && !isFunction(value)) { - options = extend(api.defaults, options); - - if (typeof options.expires === 'number') { - var days = options.expires, t = options.expires = new Date(); - t.setMilliseconds(t.getMilliseconds() + days * 864e+5); - } - - return (document.cookie = [ - encode(key), '=', stringifyCookieValue(value), - options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE - options.path ? '; path=' + options.path : '', - options.domain ? '; domain=' + options.domain : '', - options.secure ? '; secure' : '' - ].join('')); - } - - // Read - - var result = key ? undefined : {}, - // To prevent the for loop in the first place assign an empty array - // in case there are no cookies at all. Also prevents odd result when - // calling "get()". - cookies = document.cookie ? document.cookie.split('; ') : [], - i = 0, - l = cookies.length; - - for (; i < l; i++) { - var parts = cookies[i].split('='), - name = decode(parts.shift()), - cookie = parts.join('='); - - if (key === name) { - // If second argument (value) is a function it's a converter... - result = read(cookie, value); - break; - } - - // Prevent storing a cookie that we couldn't decode. - if (!key && (cookie = read(cookie)) !== undefined) { - result[name] = cookie; - } - } - - return result; - }; - - api.get = api.set = api; - api.defaults = {}; - - api.remove = function (key, options) { - // Must not alter options, thus extending a fresh object... - api(key, '', extend(options, { expires: -1 })); - return !api(key); - }; - - if ( $ ) { - $.cookie = api; - $.removeCookie = api.remove; - } - - return api; -})); diff --git a/website_cookie_notice/static/src/js/load_cookiecuttr.js b/website_cookie_notice/static/src/js/load_cookiecuttr.js deleted file mode 100644 index 580fb2da58..0000000000 --- a/website_cookie_notice/static/src/js/load_cookiecuttr.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Copyright (C) 2015 Lorenzo Battistini - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - */ -$(document).ready(function () { - $.cookieCuttr(); -}); diff --git a/website_cookie_notice/views/res_company_view.xml b/website_cookie_notice/views/res_company_view.xml deleted file mode 100644 index 95b908a323..0000000000 --- a/website_cookie_notice/views/res_company_view.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - res.company.form - res.company - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/website_cookie_notice/views/website.xml b/website_cookie_notice/views/website.xml new file mode 100644 index 0000000000..751efd4193 --- /dev/null +++ b/website_cookie_notice/views/website.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + diff --git a/website_cookie_notice/website.xml b/website_cookie_notice/website.xml deleted file mode 100644 index 489d085aee..0000000000 --- a/website_cookie_notice/website.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - -