diff --git a/netbox/templates/circuits/circuit.html b/netbox/templates/circuits/circuit.html index d3fdfb306..5c86cb24e 100644 --- a/netbox/templates/circuits/circuit.html +++ b/netbox/templates/circuits/circuit.html @@ -125,7 +125,7 @@ - {% include 'inc/custom_fields_panel.html' with custom_fields=circuit.get_custom_fields %} + {% include 'inc/custom_fields_panel.html' with obj=circuit %} {% include 'extras/inc/tags_panel.html' with tags=circuit.tags.all url='circuits:circuit_list' %}
diff --git a/netbox/templates/circuits/provider.html b/netbox/templates/circuits/provider.html index 56b5322d8..4ec9adee1 100644 --- a/netbox/templates/circuits/provider.html +++ b/netbox/templates/circuits/provider.html @@ -123,7 +123,7 @@
- {% include 'inc/custom_fields_panel.html' with custom_fields=provider.get_custom_fields %} + {% include 'inc/custom_fields_panel.html' with obj=provider %} {% include 'extras/inc/tags_panel.html' with tags=provider.tags.all url='circuits:provider_list' %}
diff --git a/netbox/templates/dcim/device.html b/netbox/templates/dcim/device.html index 03b55eb25..a915d0c7f 100644 --- a/netbox/templates/dcim/device.html +++ b/netbox/templates/dcim/device.html @@ -282,7 +282,7 @@ {% endif %}
- {% include 'inc/custom_fields_panel.html' with custom_fields=device.get_custom_fields %} + {% include 'inc/custom_fields_panel.html' with obj=device %} {% include 'extras/inc/tags_panel.html' with tags=device.tags.all url='dcim:device_list' %}
diff --git a/netbox/templates/dcim/devicetype.html b/netbox/templates/dcim/devicetype.html index 26d9077f6..652c291e6 100644 --- a/netbox/templates/dcim/devicetype.html +++ b/netbox/templates/dcim/devicetype.html @@ -158,7 +158,7 @@
- {% include 'inc/custom_fields_panel.html' with custom_fields=devicetype.get_custom_fields %} + {% include 'inc/custom_fields_panel.html' with obj=devicetype %} {% include 'extras/inc/tags_panel.html' with tags=devicetype.tags.all url='dcim:devicetype_list' %}
diff --git a/netbox/templates/dcim/rack.html b/netbox/templates/dcim/rack.html index bfb512d03..aaebe02da 100644 --- a/netbox/templates/dcim/rack.html +++ b/netbox/templates/dcim/rack.html @@ -158,7 +158,7 @@
- {% include 'inc/custom_fields_panel.html' with custom_fields=rack.get_custom_fields %} + {% include 'inc/custom_fields_panel.html' with obj=rack %} {% include 'extras/inc/tags_panel.html' with tags=rack.tags.all url='dcim:rack_list' %}
diff --git a/netbox/templates/dcim/site.html b/netbox/templates/dcim/site.html index 7a339401d..e70f98e71 100644 --- a/netbox/templates/dcim/site.html +++ b/netbox/templates/dcim/site.html @@ -219,7 +219,7 @@
- {% include 'inc/custom_fields_panel.html' with custom_fields=site.get_custom_fields %} + {% include 'inc/custom_fields_panel.html' with obj=site %} {% include 'extras/inc/tags_panel.html' with tags=site.tags.all url='dcim:site_list' %}
diff --git a/netbox/templates/inc/custom_fields_panel.html b/netbox/templates/inc/custom_fields_panel.html index 2ed10ee4d..3b82b8ee6 100644 --- a/netbox/templates/inc/custom_fields_panel.html +++ b/netbox/templates/inc/custom_fields_panel.html @@ -1,29 +1,31 @@ -{% if custom_fields %} -
-
- Custom Fields +{% with custom_fields=obj.custom_fields %} + {% if custom_fields %} +
+
+ Custom Fields +
+ + {% for field, value in custom_fields.items %} + + + + + {% endfor %} +
{{ field }} + {% if field.type == 300 and value == True %} + + {% elif field.type == 300 and value == False %} + + {% elif field.type == 500 and value %} + {{ value|truncatechars:70 }} + {% elif field.type == 200 or value %} + {{ value }} + {% elif field.required %} + Not defined + {% else %} + N/A + {% endif %} +
- - {% for field, value in custom_fields.items %} - - - - - {% endfor %} -
{{ field }} - {% if field.type == 300 and value == True %} - - {% elif field.type == 300 and value == False %} - - {% elif field.type == 500 and value %} - {{ value|truncatechars:70 }} - {% elif field.type == 200 or value %} - {{ value }} - {% elif field.required %} - Not defined - {% else %} - N/A - {% endif %} -
-
-{% endif %} + {% endif %} +{% endwith %} diff --git a/netbox/templates/ipam/aggregate.html b/netbox/templates/ipam/aggregate.html index ace3d87c5..129d9d071 100644 --- a/netbox/templates/ipam/aggregate.html +++ b/netbox/templates/ipam/aggregate.html @@ -97,7 +97,7 @@
- {% include 'inc/custom_fields_panel.html' with custom_fields=aggregate.get_custom_fields %} + {% include 'inc/custom_fields_panel.html' with obj=aggregate %} {% include 'extras/inc/tags_panel.html' with tags=aggregate.tags.all url='ipam:aggregate_list' %}
diff --git a/netbox/templates/ipam/ipaddress.html b/netbox/templates/ipam/ipaddress.html index 663a6e55f..a8501c8a0 100644 --- a/netbox/templates/ipam/ipaddress.html +++ b/netbox/templates/ipam/ipaddress.html @@ -148,7 +148,7 @@
- {% include 'inc/custom_fields_panel.html' with custom_fields=ipaddress.get_custom_fields %} + {% include 'inc/custom_fields_panel.html' with obj=ipaddress %} {% include 'extras/inc/tags_panel.html' with tags=ipaddress.tags.all url='ipam:ipaddress_list' %}
diff --git a/netbox/templates/ipam/prefix.html b/netbox/templates/ipam/prefix.html index bd6f61c48..f621a0130 100644 --- a/netbox/templates/ipam/prefix.html +++ b/netbox/templates/ipam/prefix.html @@ -184,7 +184,7 @@
- {% include 'inc/custom_fields_panel.html' with custom_fields=prefix.get_custom_fields %} + {% include 'inc/custom_fields_panel.html' with obj=prefix %} {% include 'extras/inc/tags_panel.html' with tags=prefix.tags.all url='ipam:prefix_list' %}
diff --git a/netbox/templates/ipam/service.html b/netbox/templates/ipam/service.html index 0407cee87..a0f1e57a5 100644 --- a/netbox/templates/ipam/service.html +++ b/netbox/templates/ipam/service.html @@ -80,7 +80,8 @@
- {% include 'inc/custom_fields_panel.html' with custom_fields=service.get_custom_fields %} + {% include 'inc/custom_fields_panel.html' with obj=service %} + {% include 'extras/inc/tags_panel.html' with tags=service.tags.all url='ipam:service_list' %}
{% endblock %} diff --git a/netbox/templates/ipam/vlan.html b/netbox/templates/ipam/vlan.html index 9029ee5d9..73e87149b 100644 --- a/netbox/templates/ipam/vlan.html +++ b/netbox/templates/ipam/vlan.html @@ -139,7 +139,7 @@ - {% include 'inc/custom_fields_panel.html' with custom_fields=vlan.get_custom_fields %} + {% include 'inc/custom_fields_panel.html' with obj=vlan %} {% include 'extras/inc/tags_panel.html' with tags=vlan.tags.all url='ipam:vlan_list' %}
diff --git a/netbox/templates/ipam/vrf.html b/netbox/templates/ipam/vrf.html index d577c4ed0..f75b8c7d1 100644 --- a/netbox/templates/ipam/vrf.html +++ b/netbox/templates/ipam/vrf.html @@ -92,7 +92,7 @@
- {% include 'inc/custom_fields_panel.html' with custom_fields=vrf.get_custom_fields %} + {% include 'inc/custom_fields_panel.html' with obj=vrf %} {% include 'extras/inc/tags_panel.html' with tags=vrf.tags.all url='ipam:vrf_list' %}
diff --git a/netbox/templates/secrets/secret.html b/netbox/templates/secrets/secret.html index 5b670f2c8..940a87157 100644 --- a/netbox/templates/secrets/secret.html +++ b/netbox/templates/secrets/secret.html @@ -69,7 +69,7 @@
- {% include 'inc/custom_fields_panel.html' with custom_fields=secret.get_custom_fields %} + {% include 'inc/custom_fields_panel.html' with obj=secret %}
{% if secret|decryptable_by:request.user %} diff --git a/netbox/templates/tenancy/tenant.html b/netbox/templates/tenancy/tenant.html index bf92a16c0..6f2131a51 100644 --- a/netbox/templates/tenancy/tenant.html +++ b/netbox/templates/tenancy/tenant.html @@ -81,7 +81,7 @@
- {% include 'inc/custom_fields_panel.html' with custom_fields=tenant.get_custom_fields %} + {% include 'inc/custom_fields_panel.html' with obj=tenant %} {% include 'extras/inc/tags_panel.html' with tags=tenant.tags.all url='tenancy:tenant_list' %}
diff --git a/netbox/templates/virtualization/cluster.html b/netbox/templates/virtualization/cluster.html index e09dda127..69ed4e212 100644 --- a/netbox/templates/virtualization/cluster.html +++ b/netbox/templates/virtualization/cluster.html @@ -93,7 +93,7 @@
- {% include 'inc/custom_fields_panel.html' with custom_fields=cluster.get_custom_fields %} + {% include 'inc/custom_fields_panel.html' with obj=cluster %} {% include 'extras/inc/tags_panel.html' with tags=cluster.tags.all url='virtualization:cluster_list' %}
diff --git a/netbox/templates/virtualization/virtualmachine.html b/netbox/templates/virtualization/virtualmachine.html index 9c6c8b0e3..97502af5c 100644 --- a/netbox/templates/virtualization/virtualmachine.html +++ b/netbox/templates/virtualization/virtualmachine.html @@ -137,7 +137,7 @@
- {% include 'inc/custom_fields_panel.html' with custom_fields=virtualmachine.get_custom_fields %} + {% include 'inc/custom_fields_panel.html' with obj=virtualmachine %} {% include 'extras/inc/tags_panel.html' with tags=virtualmachine.tags.all url='virtualization:virtualmachine_list' %}