This commit is contained in:
2024-05-21 00:12:19 +02:00
parent 9e0466f78b
commit 963987278a
22 changed files with 1025 additions and 90 deletions

View File

@@ -5,6 +5,7 @@ from wagtail.admin.menu import MenuItem
from associations.models import AssociationIndex
from events.models import EventIndex
from news.models import NewsIndex
@hooks.register("register_rich_text_features")
@@ -30,6 +31,15 @@ def register_associations_menu_item():
return MenuItem("Foreninger", associations_url, icon_name="group", order=2)
@hooks.register("register_admin_menu_item")
def register_associations_menu_item():
page = NewsIndex.objects.first()
news_url = "#"
if page:
news_url = reverse("wagtailadmin_explore", args=(quote(page.pk),))
return MenuItem("Nyheter", news_url, icon_name="info-circle", order=3)
@hooks.register("construct_page_action_menu")
def make_publish_default_action(menu_items, request, context):
for index, item in enumerate(menu_items):