mirror of
https://github.com/odoo/documentation.git
synced 2025-12-12 07:29:27 +07:00
[FIX] legal: fix some broken links (pdfs, translations)
1) PDF files are generated and stored at the root of the CURRENT_BRANCH
directory. The links to those files are generated at different levels of
the doctree, which makes it impossible to use a relative path.
For example the same "Enterprise Agreement" doc in EN is published on:
- /16.0/legal/terms/enterprise.html
- /16.0/fr/legal/terms/enterprise.html
As a workaround, use absolute links for the PDFs. They won't work
locally for now. Can be improved later, as long as we don't break
those links located in various depths of the troctree.
2) The legal constracts aren't translated in all availables languages
(yet), so those links are 404s now. Introduced a conf.py variable
`legal_translations` with the list of languages where translated
contracts are indeed available, and falling back to the EN version
otherwise. Some languages don't have *all* the contracts translated, so
some 404 may remain temporarily.
Forward-port of f69dba70be
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
<p>{{ _("Applies to self-hosting, Odoo.SH and Odoo Cloud.") }}</p>
|
||||
<div>
|
||||
{%- set enterprise_agreement_path_en = 'legal/terms/enterprise.html' %}
|
||||
{%- if language_code == 'en' %}
|
||||
{%- if language_code not in legal_translations %}
|
||||
<a class="btn btn-primary" href="{{ enterprise_agreement_path_en }}" role="button">{{ _("Read") }}</a>
|
||||
{%- else %}
|
||||
<a class="btn btn-primary" href="{{ 'legal/terms/i18n/enterprise_%s.html' % language_code }}" role="button">{{ _("Read") }}</a>
|
||||
@@ -55,7 +55,7 @@
|
||||
</div>
|
||||
<div>
|
||||
{%- set partnership_agreement_path_en = 'legal/terms/partnership.html' %}
|
||||
{%- if language_code == 'en' %}
|
||||
{%- if language_code not in legal_translations %}
|
||||
<a class="btn btn-primary" href="{{ partnership_agreement_path_en }}" role="button">{{ _("Read") }}</a>
|
||||
{%- else %}
|
||||
<a class="btn btn-primary" href="{{ 'legal/terms/i18n/partnership_%s.html' % language_code }}" role="button">{{ _("Read") }}</a>
|
||||
@@ -74,7 +74,7 @@
|
||||
</div>
|
||||
<div>
|
||||
{%- set terms_of_sale_agreement_path_en = 'legal/terms/terms_of_sale.html' %}
|
||||
{%- if language_code == 'en' %}
|
||||
{%- if language_code not in legal_translations %}
|
||||
<a class="btn btn-primary" href="{{ terms_of_sale_agreement_path_en }}" role="button">{{ _("Read") }}</a>
|
||||
{%- else %}
|
||||
<a class="btn btn-primary" href="{{ 'legal/terms/i18n/terms_of_sale_%s.html' % language_code }}" role="button">{{ _("Read") }}</a>
|
||||
|
||||
Reference in New Issue
Block a user