From c86b78e1bb4fe0ed15ebfdae394a1145256afc2a Mon Sep 17 00:00:00 2001 From: Silvan Verhoeven Date: Thu, 8 Aug 2024 21:09:38 +0200 Subject: [PATCH] fix: hot fix toc button display with attachments and no toc --- .../core/templates/core/information_page.html | 2 +- myhpi/core/templates/core/minutes.html | 2 +- myhpi/core/templates/core/sidebar.html | 2 +- myhpi/core/templates/core/toc_button.html | 6 +- myhpi/locale/de/LC_MESSAGES/django.po | 85 +++++++++++-------- 5 files changed, 54 insertions(+), 43 deletions(-) diff --git a/myhpi/core/templates/core/information_page.html b/myhpi/core/templates/core/information_page.html index dc34609a..f50d3dd3 100644 --- a/myhpi/core/templates/core/information_page.html +++ b/myhpi/core/templates/core/information_page.html @@ -5,7 +5,7 @@ {% block content %} {% with page.body|markdown as parsed_md %} - {% include "core/toc_button.html" with toc=parsed_md.1 %} + {% include "core/toc_button.html" with toc=parsed_md.1 attachments=page.attachments.all %}

diff --git a/myhpi/core/templates/core/minutes.html b/myhpi/core/templates/core/minutes.html index 6380b5d4..c4c6a33b 100644 --- a/myhpi/core/templates/core/minutes.html +++ b/myhpi/core/templates/core/minutes.html @@ -7,7 +7,7 @@ {% block content %} {% with page.body|markdown as parsed_md %} - {% include "core/toc_button.html" with toc=parsed_md.1 %} + {% include "core/toc_button.html" with toc=parsed_md.1 attachments=page.attachments.all %}

diff --git a/myhpi/core/templates/core/sidebar.html b/myhpi/core/templates/core/sidebar.html index 0dc68b11..491284b8 100644 --- a/myhpi/core/templates/core/sidebar.html +++ b/myhpi/core/templates/core/sidebar.html @@ -40,7 +40,7 @@

{% translate "Attachments" %}

{% endif %}

-{%if parsed_md.1|hasTocContent %} +{%if parsed_md.1|hasTocContent or page.attachments.all %}