From 709b31684eaa4f2e3a053ee204e109be5390b5d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=82=85=E7=9D=BF=E6=9B=BC?= Date: Mon, 4 Nov 2024 16:14:50 +0800 Subject: [PATCH] change main nav link style to cms41. --- djangocms_navigation/admin.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/djangocms_navigation/admin.py b/djangocms_navigation/admin.py index 1a0cc4171..8618012ae 100644 --- a/djangocms_navigation/admin.py +++ b/djangocms_navigation/admin.py @@ -200,6 +200,15 @@ def _get_main_navigation_link(self, obj, request, disabled=False): if obj.menu.main_navigation: disabled = True + if CMS_41: + return self.admin_action_button( + url=main_navigation_url, + icon="home", + title=_("Make Main Navigation"), + name="make-main-navigation", + disabled=disabled, + ) + return render_to_string( "admin/djangocms_navigation/icons/main_navigation.html", {"url": main_navigation_url, "disabled": disabled}