-
-
Notifications
You must be signed in to change notification settings - Fork 754
[10.0] Migrate website legal page to version 10.0 #310
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
Changes from all commits
a2dc5df
a46c1a0
9082adb
8928f1c
311c6ca
7baea79
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| __import__('pkg_resources').declare_namespace(__name__) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| __import__('pkg_resources').declare_namespace(__name__) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../../website_legal_page |
| 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, | ||
| ) |
| 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 |
| 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 |
| 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'): | ||
| return self.page('website_legal_page.%s' % page) | ||
| 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 "" |
| 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" |
| 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 |
| 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, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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, | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> | ||
|
|
||
There was a problem hiding this comment.
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
/legaland a/legal/legalpage 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/legalifnot page.Remember to add
**kwargsso that we can add?debug=assetsand so on.Also, this controller's name should be
legalinstead ofshowIMHO.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/legalis the default route here. I guess technically/legal/legalwould work too, but I'm pretty sure I rigged everything up as/legalUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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/overviewor something? I don't like the one duplicated