diff --git a/apps/hadis/admin/category.py b/apps/hadis/admin/category.py index 461d300..b628240 100644 --- a/apps/hadis/admin/category.py +++ b/apps/hadis/admin/category.py @@ -181,7 +181,7 @@ class HadisSectAdmin(ModelAdmin): display_title.short_description = _('Title') -class HadisCategoryAdmin(DraggableMPTTAdmin, ModelAdmin): +class HadisCategoryAdmin(ModelAdmin): """Admin for HadisCategory model with MPTT tree support""" form = HadisCategoryAdminForm list_display = ('indented_title', 'sect', 'source_type', 'order') diff --git a/config/settings/base.py b/config/settings/base.py index ba07263..4ea7321 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -321,13 +321,6 @@ UNFOLD = { # "SITE_TITLE": _("Imam Jawad Admin"), # "SITE_HEADER": _("Imam Jawad Admin"), # "SITE_SUBHEADER": _("Imam Jawad Online School"), - "SITE_DROPDOWN": [ - { - "icon": "diamond", - "title": _("Imam Javad Site"), - "link": "https://habibapp.com", - }, - ], "SITE_SYMBOL": "settings", "SHOW_HISTORY": True, "SHOW_LANGUAGES": True, diff --git a/utils/admin.py b/utils/admin.py index 84bc850..ea33d91 100644 --- a/utils/admin.py +++ b/utils/admin.py @@ -114,6 +114,18 @@ class FormulaAdminSite(UnfoldAdminSite): form = super().get_form(request, obj, **kwargs) return form + def each_context(self, request): + """Override to provide site-specific dropdown""" + context = super().each_context(request) + context["site_dropdown"] = [ + { + "title": _("Imam Javad Site"), + "link": "https://imamjavad.newhorizonco.uk/", + "icon": "diamond", + } + ] + return context + def get_urls(self): urls = super().get_urls() custom_urls = [ @@ -198,6 +210,18 @@ class DovoodiAdminSite(UnfoldAdminSite): form = super().get_form(request, obj, **kwargs) return form + def each_context(self, request): + """Override to provide site-specific dropdown""" + context = super().each_context(request) + context["site_dropdown"] = [ + { + "title": _("Dovoodi Site"), + "link": "https://dovodi.newhorizonco.uk/", + "icon": "diamond", + } + ] + return context + def get_urls(self): urls = super().get_urls() custom_urls = [