From 5f4c8b3a3e8c6bfa000ec7535195ebed9d75a097 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 5 Apr 2022 01:53:41 +0200 Subject: [PATCH] add icon support for user settings --- InvenTree/common/notifications.py | 3 ++- InvenTree/plugin/builtin/integration/core_notifications.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/InvenTree/common/notifications.py b/InvenTree/common/notifications.py index 083cbba5e1..fbe0bd1365 100644 --- a/InvenTree/common/notifications.py +++ b/InvenTree/common/notifications.py @@ -18,6 +18,7 @@ class NotificationMethod: """ METHOD_NAME = '' + METHOD_ICON = None CONTEXT_BUILTIN = ['name', 'message', ] CONTEXT_EXTRA = [] GLOBAL_SETTING = None @@ -156,7 +157,7 @@ class MethodStorageClass: # save definition methods.append({ 'key': new_key, - 'icon': 'envelope', + 'icon': getattr(item, 'METHOD_ICON', ''), 'method': item.METHOD_NAME, }) return methods diff --git a/InvenTree/plugin/builtin/integration/core_notifications.py b/InvenTree/plugin/builtin/integration/core_notifications.py index ac08db6a83..f21fe33703 100644 --- a/InvenTree/plugin/builtin/integration/core_notifications.py +++ b/InvenTree/plugin/builtin/integration/core_notifications.py @@ -36,6 +36,7 @@ class CoreNotificationsPlugin(SettingsMixin, IntegrationPluginBase): class EmailNotification(PlgMixin, BulkNotificationMethod): METHOD_NAME = 'mail' + METHOD_ICON = 'fa-envelope' CONTEXT_EXTRA = [ ('template', ), ('template', 'html', ),