Add guestbook link

This commit is contained in:
Jake Howard 2022-10-29 14:50:01 +01:00
parent a031adefda
commit c0ba7bc62e
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 9 additions and 0 deletions

View file

@ -24,6 +24,13 @@
<i class="fa-solid fa-circle-half-stroke" aria-hidden="true"></i> <i class="fa-solid fa-circle-half-stroke" aria-hidden="true"></i>
</span> </span>
</a> </a>
{% if guestbook_page %}
<a class="navbar-item navbar-icon" href="{% pageurl guestbook_page %}" title="{{ guestbook_page.title }}">
<span class="icon">
<i class="fas fa-book" aria-hidden="true"></i>
</span>
</a>
{% endif %}
{% if search_page_url %} {% if search_page_url %}
<a class="navbar-item navbar-icon" href="{{ search_page_url }}" title="search"> <a class="navbar-item navbar-icon" href="{{ search_page_url }}" title="search">
<span class="icon"> <span class="icon">

View file

@ -1,4 +1,5 @@
from django.template import Library from django.template import Library
from wagtail.models import Page
from website.contrib.singleton_page.utils import SingletonPageCache from website.contrib.singleton_page.utils import SingletonPageCache
from website.home.models import HomePage from website.home.models import HomePage
@ -19,4 +20,5 @@ def navbar(context: dict) -> dict:
.filter(show_in_menus=True) .filter(show_in_menus=True)
.order_by("title"), .order_by("title"),
"search_page_url": SingletonPageCache.get_url(SearchPage, request), "search_page_url": SingletonPageCache.get_url(SearchPage, request),
"guestbook_page": Page.objects.filter(slug="guestbook").first(),
} }