Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] website_cookie_notice #41

Merged
merged 12 commits into from Jun 24, 2015
55 changes: 55 additions & 0 deletions website_cookie_notice/README.rst
@@ -0,0 +1,55 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3

Cookie notice
=============

This module adds the cookie notice, according to the `cookie law <http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=CELEX:32002L0058:en:HTML>`_, to your website


Configuration
=============

To change default options, go to your company form, click on 'cookie notice' tab and edit module options


Known issues / Roadmap
======================

TODO
----

* Add to company form remaining options https://github.com/eLBati/website/blob/cookie_law/website_cookie_notice/static/src/js/jquery.cookiecuttr.js#L27


Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/website/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 <https://github.com/OCA/website/issues/new?body=module:%20website_cookie_notice%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.


Credits
=======

Contributors
------------

* Lorenzo Battistini <lorenzo.battistini@agilebg.com>

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

To contribute to this module, please visit http://odoo-community.org.
21 changes: 21 additions & 0 deletions website_cookie_notice/__init__.py
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Agile Business Group sagl (<http://www.agilebg.com>)
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import controllers
from . import models
40 changes: 40 additions & 0 deletions website_cookie_notice/__openerp__.py
@@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Agile Business Group sagl (<http://www.agilebg.com>)
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################

{
'name': 'Cookie notice',
'summary': 'Show cookie notice according to cookie law',
'version': '1.0',
'category': 'Website',
'author': "Agile Business Group,Odoo Community Association (OCA)",
'website': 'http://www.agilebg.com',
'license': 'AGPL-3',
'depends': [
'website',
],
'data': [
'website.xml',
'views/res_company_view.xml',
],
'qweb': [
],
'installable': True,
'auto_install': False,
}
20 changes: 20 additions & 0 deletions website_cookie_notice/controllers/__init__.py
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Agile Business Group sagl (<http://www.agilebg.com>)
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import main
56 changes: 56 additions & 0 deletions website_cookie_notice/controllers/main.py
@@ -0,0 +1,56 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2015 Lorenzo Battistini <lorenzo.battistini@agilebg.com>
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################

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',
]


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
149 changes: 149 additions & 0 deletions website_cookie_notice/i18n/es.po
@@ -0,0 +1,149 @@
# 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 "ACEPTAR"

#. module: website_cookie_notice
#: model:ir.model,name:website_cookie_notice.model_res_company
msgid "Companies"
msgstr "Compañías"

#. 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 <a href=\"{{cookiePolicyLink}}\" title=\"read about our cookies\">read about them here</a>. To use the website as intended please..."
msgstr "Usamos cookies en este sitio web, usted puede saber más sobre ellas en"
" <a href=\"{{cookiePolicyLink}}\" title=\"lea nuestra política de privacidad\">"
" nuestra politica de privacidad</a>. 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. <br>To continue using this functionality, please"
msgstr "Lo sentimos, esta funcionalidad almacena cookies en su navegador"
" y ha sido deshabilitada. <br> 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'"