From f912a91e6d5d15d2ead7e3673889f0e7fee9999b Mon Sep 17 00:00:00 2001 From: krmax44 Date: Wed, 4 Oct 2023 13:15:38 +0200 Subject: [PATCH 01/18] =?UTF-8?q?=E2=9C=A8=20allow=20views=20to=20define?= =?UTF-8?q?=20breadcrumbs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../helper/templatetags/breadcrumb_helper.py | 8 +++ froide/templates/base.html | 50 ++++++++++--------- froide/templates/snippets/breadcrumbs.html | 17 +++++++ 3 files changed, 52 insertions(+), 23 deletions(-) create mode 100644 froide/helper/templatetags/breadcrumb_helper.py create mode 100644 froide/templates/snippets/breadcrumbs.html diff --git a/froide/helper/templatetags/breadcrumb_helper.py b/froide/helper/templatetags/breadcrumb_helper.py new file mode 100644 index 000000000..a1957dc50 --- /dev/null +++ b/froide/helper/templatetags/breadcrumb_helper.py @@ -0,0 +1,8 @@ +from django import template + +register = template.Library() + + +@register.filter +def is_tuple(value): + return type(value) == tuple diff --git a/froide/templates/base.html b/froide/templates/base.html index f0f324c76..4dbf2ff48 100644 --- a/froide/templates/base.html +++ b/froide/templates/base.html @@ -3,29 +3,33 @@ {% load static %} {% load frontendbuild %} {% block body_tag %} - {% if request.user.is_authenticated and request.session.impostor %} - {% include "account/includes/impostor.html" %} - {% endif %} - {% block top_block %}{% endblock %} - {% block navbar %} - {% include "header.html" %} - {% endblock %} - {% block body_wrapper %} -
- {% block index_banner %}{% endblock %} - {% block foisite_advice %}{% endblock %} - {% block messages %} - {% include "snippets/messages.html" %} - {% endblock messages %} - {% block body %} -
- {% block app_body %}{% endblock %} -
- {% endblock %} -
- {% endblock %} - {% block footer_container %} - {% include "footer.html" %} + {% if request.user.is_authenticated and request.session.impostor %} + {% include "account/includes/impostor.html" %} + {% endif %} + + {% block top_block %} + {% endblock %} + + {% block navbar %} + {% include "header.html" %} + {% endblock %} + + {% include "snippets/breadcrumbs.html" %} + + {% block body_wrapper %} +
+ + {% block index_banner %}{% endblock %} + {% block foisite_advice %}{% endblock %} + + {% block messages %} + {% include "snippets/messages.html" %} + {% endblock messages %} + + {% block body %} +
+ {% block app_body %}{% endblock %} +
{% endblock %} {% endblock body_tag %} {% block scripts %} diff --git a/froide/templates/snippets/breadcrumbs.html b/froide/templates/snippets/breadcrumbs.html new file mode 100644 index 000000000..9fc8a6206 --- /dev/null +++ b/froide/templates/snippets/breadcrumbs.html @@ -0,0 +1,17 @@ +{% load breadcrumb_helper %} + +{% if view.breadcrumbs != None %} + +{% endif %} \ No newline at end of file From c0b9dd9b455957ed01ee3c61858f0b99f815d4e7 Mon Sep 17 00:00:00 2001 From: krmax44 Date: Wed, 4 Oct 2023 16:40:37 +0200 Subject: [PATCH 02/18] =?UTF-8?q?=F0=9F=92=84=20adjust=20breadcrumb=20sizi?= =?UTF-8?q?ng?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- froide/templates/snippets/breadcrumbs.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/froide/templates/snippets/breadcrumbs.html b/froide/templates/snippets/breadcrumbs.html index 9fc8a6206..31904595a 100644 --- a/froide/templates/snippets/breadcrumbs.html +++ b/froide/templates/snippets/breadcrumbs.html @@ -1,7 +1,7 @@ {% load breadcrumb_helper %} {% if view.breadcrumbs != None %} -