|
|
@@ -330,15 +330,15 @@ class ColoredLabelColumn(tables.TemplateColumn):
|
|
|
Render a colored label (e.g. for DeviceRoles).
|
|
|
"""
|
|
|
template_code = """
|
|
|
- {% load helpers %}
|
|
|
- {% if value %}
|
|
|
- <span class="badge" style="color: {{ value.color|fgcolor }}; background-color: #{{ value.color }}">
|
|
|
- {{ value }}
|
|
|
- </span>
|
|
|
- {% else %}
|
|
|
- —
|
|
|
- {% endif %}
|
|
|
- """
|
|
|
+{% load helpers %}
|
|
|
+ {% if value %}
|
|
|
+ <span class="badge" style="color: {{ value.color|fgcolor }}; background-color: #{{ value.color }}">
|
|
|
+ <a href="{{ value.get_absolute_url }}">{{ value }}</a>
|
|
|
+ </span>
|
|
|
+{% else %}
|
|
|
+ —
|
|
|
+{% endif %}
|
|
|
+"""
|
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
super().__init__(template_code=self.template_code, *args, **kwargs)
|