Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions setup/website_legal_page/odoo/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
1 change: 1 addition & 0 deletions setup/website_legal_page/odoo/addons/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
1 change: 1 addition & 0 deletions setup/website_legal_page/odoo/addons/website_legal_page
6 changes: 6 additions & 0 deletions setup/website_legal_page/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
15 changes: 7 additions & 8 deletions website_legal_page/README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

==================
Website legal page
==================

Expand Down Expand Up @@ -48,13 +50,9 @@ relationship by providing information to you.
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:%20
website_legal_page%0Aversion:%2
08.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
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 smash it by providing detailed and welcomed feedback.


Credits
Expand Down Expand Up @@ -85,6 +83,7 @@ Contributors
* Igor Pastor <igorpg@antiun.com>
* Jairo Llopis <jairo.llopis@tecnativa.com>
* Dave Lasley <dave@laslabs.com>
* Nicola Malcontenti <nicola.malcontenti@agilebg.com>

Maintainer
----------
Expand Down
4 changes: 2 additions & 2 deletions website_legal_page/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# © 2015 Antiun Ingeniería S.L. (http://www.antiun.com)
# © 2015 Antonio Espinosa <antonioea@antiun.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import controllers
6 changes: 3 additions & 3 deletions website_legal_page/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
'name': "Website Legal Page",
'description': 'Add legal information, such as privacy policy',
'category': 'Website',
'version': '9.0.1.0.0',
'version': '10.0.1.0.0',
'depends': [
'website',
],
Expand All @@ -19,9 +19,9 @@
],
'author': 'Antiun Ingeniería S.L., '
'Tecnativa, '
'LasLabs Inc, '
'LasLabs, '
'Odoo Community Association (OCA)',
'website': 'http://www.antiun.com',
'license': 'AGPL-3',
'installable': False,
'installable': True,
}
4 changes: 4 additions & 0 deletions website_legal_page/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import main
20 changes: 20 additions & 0 deletions website_legal_page/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Copyright 2017 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import http
from odoo.addons.website.controllers.main import Website


class Legal(Website):

@http.route([
'/legal',
'/legal/<string:page>',
],
auth='public',
type='http',
website=True,
)
def show(self, page='legal'):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SEO-wise, if you have a /legal and a /legal/legal page that are the same, you get penalized.

I think you should better not add a default page and require it (404 error otherwise), or make it redirect to /legal/legal if not page.

Remember to add **kwargs so that we can add ?debug=assets and so on.

Also, this controller's name should be legal instead of show IMHO.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/legal is the default route here. I guess technically /legal/legal would work too, but I'm pretty sure I rigged everything up as /legal

@lasley lasley Jun 13, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, you're recommending explicitly denying (still early here, need coffee).

What about /legal/overview or something? I don't like the one duplicated

return self.page('website_legal_page.%s' % page)
68 changes: 68 additions & 0 deletions website_legal_page/i18n/bg.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_legal_page
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: website (9.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-29 03:55+0000\n"
"PO-Revision-Date: 2016-05-26 15:27+0000\n"
"Last-Translator: <>\n"
"Language-Team: Bulgarian (http://www.transifex.com/oca/OCA-website-9-0/language/bg/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: bg\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid ", and the"
msgstr ""

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid ", the"
msgstr ""

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid "I accept the"
msgstr ""

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.legal_advice_link
msgid "Legal advice"
msgstr ""

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.privacy_policy_link
msgid "Privacy policy"
msgstr ""

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.terms_of_use_link
msgid "Terms of use"
msgstr ""

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid "legal advice"
msgstr ""

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid "of this website."
msgstr ""

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid "privacy policy"
msgstr "политика за личните данни"

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid "terms of use"
msgstr ""
8 changes: 4 additions & 4 deletions website_legal_page/i18n/el_GR.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: website (9.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-27 02:54+0000\n"
"PO-Revision-Date: 2016-05-26 15:27+0000\n"
"POT-Creation-Date: 2016-11-29 03:55+0000\n"
"PO-Revision-Date: 2016-10-11 11:48+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>\n"
"Language-Team: Greek (Greece) (http://www.transifex.com/oca/OCA-website-9-0/language/el_GR/)\n"
"MIME-Version: 1.0\n"
Expand All @@ -20,12 +20,12 @@ msgstr ""
#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid ", and the"
msgstr ""
msgstr ", και το"

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid ", the"
msgstr ""
msgstr ", το"

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
Expand Down
17 changes: 9 additions & 8 deletions website_legal_page/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
#
# Translators:
# Christophe CHAUVET <christophe.chauvet@gmail.com>, 2016
# Sébastien Alix <seb@usr-src.org>, 2016
msgid ""
msgstr ""
"Project-Id-Version: website (9.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-27 02:54+0000\n"
"PO-Revision-Date: 2016-05-26 15:43+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>\n"
"POT-Creation-Date: 2016-11-29 03:55+0000\n"
"PO-Revision-Date: 2016-11-10 14:06+0000\n"
"Last-Translator: Sébastien Alix <seb@usr-src.org>\n"
"Language-Team: French (http://www.transifex.com/oca/OCA-website-9-0/language/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand All @@ -21,17 +22,17 @@ msgstr ""
#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid ", and the"
msgstr ", et le"
msgstr ", et les"

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid ", the"
msgstr ", le"
msgstr ", la"

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid "I accept the"
msgstr ""
msgstr "J'accepte les"

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.legal_advice_link
Expand All @@ -46,7 +47,7 @@ msgstr "Politique de vie privée"
#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.terms_of_use_link
msgid "Terms of use"
msgstr "Condition d'utilisation"
msgstr "Conditions d'utilisation"

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
Expand All @@ -66,4 +67,4 @@ msgstr "politique de vie privée"
#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid "terms of use"
msgstr "condition d'utilisation"
msgstr "conditions d'utilisation"
69 changes: 69 additions & 0 deletions website_legal_page/i18n/pt_PT.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_legal_page
#
# Translators:
# Pedro Castro Silva <pedrocs@sossia.pt>, 2016
msgid ""
msgstr ""
"Project-Id-Version: website (9.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-24 04:17+0000\n"
"PO-Revision-Date: 2016-12-17 18:52+0000\n"
"Last-Translator: Pedro Castro Silva <pedrocs@sossia.pt>\n"
"Language-Team: Portuguese (Portugal) (http://www.transifex.com/oca/OCA-website-9-0/language/pt_PT/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: pt_PT\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid ", and the"
msgstr ", e o"

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid ", the"
msgstr ", o"

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid "I accept the"
msgstr "Aceitos os"

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.legal_advice_link
msgid "Legal advice"
msgstr "Aconselhamento jurídico"

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.privacy_policy_link
msgid "Privacy policy"
msgstr "Política de privacidade"

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.terms_of_use_link
msgid "Terms of use"
msgstr "Termos de utilização"

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid "legal advice"
msgstr "aconselhamento jurídico"

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid "of this website."
msgstr "deste website."

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid "privacy policy"
msgstr "política de privacidade"

#. module: website_legal_page
#: model:ir.ui.view,arch_db:website_legal_page.acceptance_full
msgid "terms of use"
msgstr "termos de utilização"
4 changes: 4 additions & 0 deletions website_legal_page/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import test_controller
32 changes: 32 additions & 0 deletions website_legal_page/tests/test_controller.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
# Copyright 2017 LasLabs Inc.
# License APL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo.tests.common import HttpCase


class TestController(HttpCase):

def test_legal(self):
""" It should return a 200 for the default page. """
response = self.url_open('/legal')
self.assertEqual(
response.getcode(),
200,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will change with my above comment.

)

def test_unknown(self):
""" It should return a 404 for unknown pages. """
response = self.url_open('/legal/no-page')
self.assertEqual(
response.getcode(),
404,
)

def test_privacy(self):
""" It should return a 200 for a defined page. """
response = self.url_open('/legal/privacy')
self.assertEqual(
response.getcode(),
200,
)
6 changes: 3 additions & 3 deletions website_legal_page/views/website_legal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
inherit_id="website.layout_footer_copyright"
name="Legal advice Link">
<xpath expr="//footer//div/span[@t-field='res_company.name']" position="after">
<span>- <a href="/page/legal">Legal advice</a></span>
<span>- <a href="/legal">Legal Advice</a></span>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/legal/advice maybe? Better than /legal/legal, right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 will solve above

</xpath>
</template>

<template id="website.legal" name="Legal advice" page="True">
<template id="legal" name="Legal Advice" page="True">
<t t-call="website.layout">
<div id="wrap">
<div class="oe_structure">
<section data-snippet-id="title">
<h1 class="text-center">
Legal advice
Legal Advice
</h1>
</section>
</div>
Expand Down
Loading