From fd6209470b82e2655919136f967afadd2986f652 Mon Sep 17 00:00:00 2001 From: Artur Borecki Date: Wed, 18 Mar 2026 10:04:49 +0100 Subject: [PATCH] feat(wagtail_hooks.py): add admin chat dashboard to wagtail admin menu --- home/wagtail_hooks.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/home/wagtail_hooks.py b/home/wagtail_hooks.py index 17f5f9e..e4b11e9 100644 --- a/home/wagtail_hooks.py +++ b/home/wagtail_hooks.py @@ -1,7 +1,12 @@ +from wagtail.admin.menu import MenuItem import wagtail.admin.rich_text.editors.draftail.features as draftail_features from wagtail.admin.rich_text.converters.html_to_contentstate import BlockElementHandler from wagtail import hooks +from django.urls import path, reverse + +from . import views + @hooks.register("register_rich_text_features") def register_code_block_feature(features): @@ -39,3 +44,20 @@ def register_code_block_feature(features): # Optional: add to default features features.default_features.append(feature_name) + + +@hooks.register("register_admin_urls") +def register_admin_chat_dashboard_url(): + return [ + path("chat/", views.admin_chat_dashboard, name="admin_chat_dashboard"), + path( + "chat/user//", + views.admin_chat, + name="admin_chat", + ), + ] + + +@hooks.register("register_admin_menu_item") +def register_admin_chat_menu_item(): + return MenuItem("Chat", reverse("admin_chat_dashboard"), icon_name="mail")