Просмотр исходного кода

Clean up hierarchical table columns

Jeremy Stretch 5 лет назад
Родитель
Сommit
ddd10ba8af
2 измененных файлов с 8 добавлено и 14 удалено
  1. 4 7
      netbox/dcim/tables/template_code.py
  2. 4 7
      netbox/tenancy/tables.py

+ 4 - 7
netbox/dcim/tables/template_code.py

@@ -57,13 +57,10 @@ INTERFACE_TAGGED_VLANS = """
 """
 
 MPTT_LINK = """
-{% if record.get_children %}
-    <span style="padding-left: {{ record.get_ancestors|length }}0px "><i class="mdi mdi-chevron-right"></i>
-{% else %}
-    <span style="padding-left: {{ record.get_ancestors|length }}9px">
-{% endif %}
-    <a href="{{ record.get_absolute_url }}">{{ record.name }}</a>
-</span>
+{% for i in record.get_ancestors %}
+    <i class="mdi mdi-circle-small"></i>
+{% endfor %}
+<a href="{{ record.get_absolute_url }}">{{ record.name }}</a>
 """
 
 POWERFEED_CABLE = """

+ 4 - 7
netbox/tenancy/tables.py

@@ -4,13 +4,10 @@ from utilities.tables import BaseTable, ButtonsColumn, LinkedCountColumn, TagCol
 from .models import Tenant, TenantGroup
 
 MPTT_LINK = """
-{% if record.get_children %}
-    <span style="padding-left: {{ record.get_ancestors|length }}0px "><i class="mdi mdi-chevron-right"></i>
-{% else %}
-    <span style="padding-left: {{ record.get_ancestors|length }}9px">
-{% endif %}
-    <a href="{{ record.get_absolute_url }}">{{ record.name }}</a>
-</span>
+{% for i in record.get_ancestors %}
+    <i class="mdi mdi-circle-small"></i>
+{% endfor %}
+<a href="{{ record.get_absolute_url }}">{{ record.name }}</a>
 """
 
 COL_TENANT = """