From 2653de6a8541078dc5dc8c4dbac920651c296439 Mon Sep 17 00:00:00 2001 From: Silvan Verhoeven Date: Fri, 9 Aug 2024 21:45:40 +0200 Subject: [PATCH] refactor: use attachments.exists --- myhpi/core/templates/core/information_page.html | 2 +- myhpi/core/templates/core/minutes.html | 2 +- myhpi/core/templates/core/sidebar.html | 12 +++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/myhpi/core/templates/core/information_page.html b/myhpi/core/templates/core/information_page.html index f50d3dd3..398b34c1 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 attachments=page.attachments.all %} + {% include "core/toc_button.html" with toc=parsed_md.1 attachments=page.attachments.exists %}

diff --git a/myhpi/core/templates/core/minutes.html b/myhpi/core/templates/core/minutes.html index c4c6a33b..25d64e2b 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 attachments=page.attachments.all %} + {% include "core/toc_button.html" with toc=parsed_md.1 attachments=page.attachments.exists %}

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

{% translate "Table of contents" %}

{{ parsed_md.1 }} {% endif %} - {% if page.attachments.all %} + {% if page.attachments.exists %} {% endif %}

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