mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Cleaned up custom fields panel template
This commit is contained in:
parent
0907a6ce5b
commit
97b6038be2
@ -125,7 +125,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% 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' %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
|
@ -123,7 +123,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% 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' %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
|
@ -282,7 +282,7 @@
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
{% 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' %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
|
@ -158,7 +158,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% 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' %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
|
@ -158,7 +158,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% 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' %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
|
@ -219,7 +219,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% 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' %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
|
@ -1,29 +1,31 @@
|
||||
{% if custom_fields %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<strong>Custom Fields</strong>
|
||||
{% with custom_fields=obj.custom_fields %}
|
||||
{% if custom_fields %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<strong>Custom Fields</strong>
|
||||
</div>
|
||||
<table class="table table-hover panel-body attr-table">
|
||||
{% for field, value in custom_fields.items %}
|
||||
<tr>
|
||||
<td>{{ field }}</td>
|
||||
<td>
|
||||
{% if field.type == 300 and value == True %}
|
||||
<i class="glyphicon glyphicon-ok text-success" title="True"></i>
|
||||
{% elif field.type == 300 and value == False %}
|
||||
<i class="glyphicon glyphicon-remove text-danger" title="False"></i>
|
||||
{% elif field.type == 500 and value %}
|
||||
<a href="{{ value }}">{{ value|truncatechars:70 }}</a>
|
||||
{% elif field.type == 200 or value %}
|
||||
{{ value }}
|
||||
{% elif field.required %}
|
||||
<span class="text-warning">Not defined</span>
|
||||
{% else %}
|
||||
<span class="text-muted">N/A</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
<table class="table table-hover panel-body attr-table">
|
||||
{% for field, value in custom_fields.items %}
|
||||
<tr>
|
||||
<td>{{ field }}</td>
|
||||
<td>
|
||||
{% if field.type == 300 and value == True %}
|
||||
<i class="glyphicon glyphicon-ok text-success" title="True"></i>
|
||||
{% elif field.type == 300 and value == False %}
|
||||
<i class="glyphicon glyphicon-remove text-danger" title="False"></i>
|
||||
{% elif field.type == 500 and value %}
|
||||
<a href="{{ value }}">{{ value|truncatechars:70 }}</a>
|
||||
{% elif field.type == 200 or value %}
|
||||
{{ value }}
|
||||
{% elif field.required %}
|
||||
<span class="text-warning">Not defined</span>
|
||||
{% else %}
|
||||
<span class="text-muted">N/A</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
@ -97,7 +97,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
{% 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' %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -148,7 +148,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% 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' %}
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
|
@ -184,7 +184,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% 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' %}
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
|
@ -80,7 +80,8 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% 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' %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -139,7 +139,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% 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' %}
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
@ -92,7 +92,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% 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' %}
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
@ -69,7 +69,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% include 'inc/custom_fields_panel.html' with custom_fields=secret.get_custom_fields %}
|
||||
{% include 'inc/custom_fields_panel.html' with obj=secret %}
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
{% if secret|decryptable_by:request.user %}
|
||||
|
@ -81,7 +81,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% 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' %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
|
@ -93,7 +93,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% 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' %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
|
@ -137,7 +137,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% 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' %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
|
Loading…
Reference in New Issue
Block a user