mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-08 16:48:16 -06:00
Add event icon & type to notifications table
This commit is contained in:
parent
b94cb883a6
commit
2f2e273776
@ -287,6 +287,15 @@ class SubscriptionTable(NetBoxTable):
|
|||||||
|
|
||||||
|
|
||||||
class NotificationTable(NetBoxTable):
|
class NotificationTable(NetBoxTable):
|
||||||
|
icon = columns.TemplateColumn(
|
||||||
|
template_code='<span class="text-{{ value.color }}"><i class="{{ value.icon }}"></i></span>',
|
||||||
|
accessor=tables.A('event'),
|
||||||
|
attrs={
|
||||||
|
'td': {'class': 'w-1'},
|
||||||
|
'th': {'class': 'w-1'},
|
||||||
|
},
|
||||||
|
verbose_name=''
|
||||||
|
)
|
||||||
object_type = columns.ContentTypeColumn(
|
object_type = columns.ContentTypeColumn(
|
||||||
verbose_name=_('Object Type'),
|
verbose_name=_('Object Type'),
|
||||||
)
|
)
|
||||||
@ -312,8 +321,8 @@ class NotificationTable(NetBoxTable):
|
|||||||
|
|
||||||
class Meta(NetBoxTable.Meta):
|
class Meta(NetBoxTable.Meta):
|
||||||
model = Notification
|
model = Notification
|
||||||
fields = ('pk', 'object', 'object_type', 'created', 'read')
|
fields = ('pk', 'icon', 'object', 'object_type', 'event_type', 'created', 'read')
|
||||||
default_columns = ('object', 'object_type', 'created', 'read')
|
default_columns = ('icon', 'object', 'object_type', 'event_type', 'created', 'read')
|
||||||
row_attrs = {
|
row_attrs = {
|
||||||
'data-unread': lambda record: not record.read,
|
'data-unread': lambda record: not record.read,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user