mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 09:28:38 -06:00
Optimize MPTTColumn rendering
This commit is contained in:
parent
809d9e4697
commit
7e481960f9
@ -340,8 +340,11 @@ class MPTTColumn(tables.TemplateColumn):
|
|||||||
"""
|
"""
|
||||||
Display a nested hierarchy for MPTT-enabled models.
|
Display a nested hierarchy for MPTT-enabled models.
|
||||||
"""
|
"""
|
||||||
template_code = """{% for i in record.get_ancestors %}<i class="mdi mdi-circle-small"></i>{% endfor %}""" \
|
template_code = """
|
||||||
"""<a href="{{ record.get_absolute_url }}">{{ record.name }}</a>"""
|
{% load helpers %}
|
||||||
|
{% for i in record.level|as_range %}<i class="mdi mdi-circle-small"></i>{% endfor %}
|
||||||
|
<a href="{{ record.get_absolute_url }}">{{ record.name }}</a>
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
|
Loading…
Reference in New Issue
Block a user