mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixed color display
This commit is contained in:
@ -46,3 +46,13 @@ class BooleanColumn(tables.Column):
|
||||
else:
|
||||
rendered = '<span class="text-muted">—</span>'
|
||||
return mark_safe(rendered)
|
||||
|
||||
|
||||
class ColorColumn(tables.Column):
|
||||
"""
|
||||
Display a color (#RRGGBB).
|
||||
"""
|
||||
def render(self, value):
|
||||
return mark_safe(
|
||||
'<span class="label color-block" style="background-color: #{}"> </span>'.format(value)
|
||||
)
|
||||
|
Reference in New Issue
Block a user