[IMP] legal page display

This commit is contained in:
Victor Feyens 2021-03-15 16:05:29 +01:00
parent 0a685bdb08
commit d2d3c3d8b7
3 changed files with 13 additions and 6 deletions

View File

@ -333,7 +333,7 @@ def _generate_alternate_urls(app, pagename, templatename, context, doctree):
def tag_toctrees(app, doctree, docname):
"""Add a 'is-toc-page' metadata entry to all documents containing only a toctree node"""
"""Add a 'has_only_toc' metadata entry to all documents containing only a toctree node"""
# document
# section
# title
@ -348,4 +348,6 @@ def tag_toctrees(app, doctree, docname):
if 'toctree-wrapper' not in compound['classes']:
return
app.env.metadata[docname]['has_only_toc'] = True
if 'show_content' not in app.env.metadata[docname]:
# If page contains custom content: we have to show github link and local toc
app.env.metadata[docname]['has_only_toc'] = True

View File

@ -1,7 +1,10 @@
:custom-css: legal.css
:show_content:
:hide_page_toc:
.. ^^: cheat to have a full-width table as if this was a real toc page
.. show_content makes Legal clickable on the global ToC
.. hide_page_toc hides the local page toc and widens the body place on the page
=====
Legal

View File

@ -79,8 +79,10 @@
{% set main_classes = main_classes + meta['classes'].split() %}
{% endif %}
{% if 'has_only_toc' in meta %} {# The page only contains a toctree #}
{% set main_classes = main_classes + ['doc-toc'] %} {# TODO EDI do you use this ?#}
{% if 'has_only_toc' in meta or 'hide_page_toc' in meta %}
{# The page only contains a toctree or the page toc is hidden #}
{# TODO EDI rename doc-toc class to sthg more meaningful explaining the result (body taking full page) #}
{% set main_classes = main_classes + ['doc-toc'] %} {# Increase body width, taking the place of the page toc #}
{% endif %}
<main class="container-fluid {{ ' '.join(main_classes) }}">
@ -104,7 +106,7 @@
<div id="mask"></div>
</main>
{# VFE TODO Check if this condition is still needed ??? #}
{% if pagename not in toc %}
{% if pagename not in toc and 'hide_page_toc' not in meta %}
<aside id="o_page_toc" class="o_page_toc">
{% include "layout_templates/page_toc.html" %}
</aside>