From c0ba7bc62e3838a34cf9ec1f880291bb7650fa5f Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 29 Oct 2022 14:50:01 +0100 Subject: [PATCH] Add guestbook link --- website/common/templates/common/navbar.html | 7 +++++++ website/common/templatetags/navbar_tags.py | 2 ++ 2 files changed, 9 insertions(+) diff --git a/website/common/templates/common/navbar.html b/website/common/templates/common/navbar.html index cd1f5cd..eb3864f 100644 --- a/website/common/templates/common/navbar.html +++ b/website/common/templates/common/navbar.html @@ -24,6 +24,13 @@ + {% if guestbook_page %} + + + + + + {% endif %} {% if search_page_url %} diff --git a/website/common/templatetags/navbar_tags.py b/website/common/templatetags/navbar_tags.py index cc6fc7f..025e5c8 100644 --- a/website/common/templatetags/navbar_tags.py +++ b/website/common/templatetags/navbar_tags.py @@ -1,4 +1,5 @@ from django.template import Library +from wagtail.models import Page from website.contrib.singleton_page.utils import SingletonPageCache from website.home.models import HomePage @@ -19,4 +20,5 @@ def navbar(context: dict) -> dict: .filter(show_in_menus=True) .order_by("title"), "search_page_url": SingletonPageCache.get_url(SearchPage, request), + "guestbook_page": Page.objects.filter(slug="guestbook").first(), }