add event organizer models, changes to associations

This commit is contained in:
2024-05-14 23:01:09 +02:00
parent cff4f5555c
commit 3522620cea
8 changed files with 206 additions and 24 deletions

View File

@@ -3,6 +3,7 @@ from django.urls import reverse
from wagtail import hooks
from wagtail.admin.menu import MenuItem
from associations.models import AssociationIndex
from events.models import EventIndex
@@ -14,5 +15,16 @@ def enable_additional_rich_text_features(features):
@hooks.register("register_admin_menu_item")
def register_events_menu_item():
page = EventIndex.objects.first()
events_url = reverse("wagtailadmin_explore", args=(quote(page.pk),))
events_url = "#"
if page:
events_url = reverse("wagtailadmin_explore", args=(quote(page.pk),))
return MenuItem("Arrangementer", events_url, icon_name="date", order=1)
@hooks.register("register_admin_menu_item")
def register_associations_menu_item():
page = AssociationIndex.objects.first()
associations_url = "#"
if page:
associations_url = reverse("wagtailadmin_explore", args=(quote(page.pk),))
return MenuItem("Foreninger", associations_url, icon_name="group", order=2)