diff --git a/netbox/templates/dcim/device.html b/netbox/templates/dcim/device.html index f0e7bb33a..cb7a7133d 100644 --- a/netbox/templates/dcim/device.html +++ b/netbox/templates/dcim/device.html @@ -295,27 +295,7 @@ {% endif %} -
-
Services
-
- {% if services %} - - {% for service in services %} - {% include 'ipam/inc/service.html' %} - {% endfor %} -
- {% else %} -
None
- {% endif %} -
- {% if perms.ipam.add_service %} - - {% endif %} -
+ {% include 'inc/panels/services.html' %} {% include 'inc/panels/contacts.html' %} {% include 'inc/panels/image_attachments.html' %} {% if object.rack and object.position %} diff --git a/netbox/templates/inc/panels/services.html b/netbox/templates/inc/panels/services.html new file mode 100644 index 000000000..b7109f497 --- /dev/null +++ b/netbox/templates/inc/panels/services.html @@ -0,0 +1,50 @@ +
+
Services
+
+ {% if services %} + + {% for service in services %} + + + + + + + + + {% endfor %} +
{{ service|linkify:"name" }}{{ service.get_protocol_display }}{{ service.port_list }} + {% for ip in service.ipaddresses.all %} + {{ ip.address.ip }}
+ {% empty %} + All IPs + {% endfor %} +
{{ service.description }} + + + + {% if perms.ipam.change_service %} + + + + {% endif %} + {% if perms.ipam.delete_service %} + + + + {% endif %} +
+ {% else %} +
None
+ {% endif %} +
+ {% if perms.ipam.add_service %} + {% with object|meta:"model_name" as object_type %} + + {% endwith %} + {% endif %} +
diff --git a/netbox/templates/ipam/inc/service.html b/netbox/templates/ipam/inc/service.html deleted file mode 100644 index 0d6faf1dc..000000000 --- a/netbox/templates/ipam/inc/service.html +++ /dev/null @@ -1,28 +0,0 @@ - - {{ service|linkify:"name" }} - {{ service.get_protocol_display }} - {{ service.port_list }} - - {% for ip in service.ipaddresses.all %} - {{ ip.address.ip }}
- {% empty %} - All IPs - {% endfor %} - - {{ service.description }} - - - - - {% if perms.ipam.change_service %} - - - - {% endif %} - {% if perms.ipam.delete_service %} - - - - {% endif %} - - diff --git a/netbox/templates/ipam/ipaddress.html b/netbox/templates/ipam/ipaddress.html index 4a110c2e6..131087253 100644 --- a/netbox/templates/ipam/ipaddress.html +++ b/netbox/templates/ipam/ipaddress.html @@ -138,24 +138,7 @@
{% include 'inc/panel_table.html' with table=related_ips_table heading='Related IP Addresses' %}
-
-
- Services -
-
- {% if services %} - - {% for service in services %} - {% include 'ipam/inc/service.html' %} - {% endfor %} -
- {% else %} -
- None -
- {% endif %} -
-
+ {% include 'inc/panels/services.html' %} {% plugin_right_page object %} diff --git a/netbox/templates/virtualization/virtualmachine.html b/netbox/templates/virtualization/virtualmachine.html index 9d95b02ea..9b5708486 100644 --- a/netbox/templates/virtualization/virtualmachine.html +++ b/netbox/templates/virtualization/virtualmachine.html @@ -144,29 +144,7 @@ -
-
- Services -
-
- {% if services %} - - {% for service in services %} - {% include 'ipam/inc/service.html' %} - {% endfor %} -
- {% else %} - None - {% endif %} -
- {% if perms.ipam.add_service %} - - {% endif %} -
+ {% include 'inc/panels/services.html' %} {% include 'inc/panels/contacts.html' %} {% plugin_right_page object %}