From 362526a5331d8a43aaf374113e22f944c067a5a3 Mon Sep 17 00:00:00 2001 From: Eric Sherman Date: Fri, 24 May 2024 13:25:12 -0500 Subject: [PATCH] TI-4669 set icon_name For newer wagtail versions, this appears to be the best way to set an icon for each listing --- src/wagtail_personalisation/wagtail_hooks.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/wagtail_personalisation/wagtail_hooks.py b/src/wagtail_personalisation/wagtail_hooks.py index 57eb592b..ad2ef344 100644 --- a/src/wagtail_personalisation/wagtail_hooks.py +++ b/src/wagtail_personalisation/wagtail_hooks.py @@ -192,10 +192,8 @@ def page_listing_more_buttons(page, user, is_parent=False, next_url=None, *args) reverse("wagtailadmin_pages:edit", args=[vm.variant_id]), attrs={ "title": _("Edit this variant"), - "class": "icon icon-edit" # does work but not needed }, - icon_name='edit', # seems to be the newer wagtail convention - classname="icon icon-edit", # dosen't seem to work but should + icon_name="edit", priority=0, ) @@ -204,7 +202,7 @@ def page_listing_more_buttons(page, user, is_parent=False, next_url=None, *args) "%s variant" % (segment.name), reverse("segment:copy_page", args=[page.pk, segment.pk]), attrs={"title": _("Create this variant")}, - classname=("icon", "icon-plus"), + icon_name="plus", priority=100, ) @@ -212,7 +210,7 @@ def page_listing_more_buttons(page, user, is_parent=False, next_url=None, *args) _("Create a new segment"), reverse("wagtail_personalisation_segment_modeladmin_create"), attrs={"title": _("Create a new segment")}, - classname=("icon", "icon-snowflake"), + icon_name="snowflake", priority=200, )