From 17a71d3e265e30624c0f4e21dd5e1ab7ab306477 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 29 Oct 2018 12:56:17 -0400 Subject: [PATCH] Optimized front/rear port connection displays --- netbox/templates/dcim/inc/frontport.html | 84 ++++++++++++------------ netbox/templates/dcim/inc/rearport.html | 82 +++++++++++------------ 2 files changed, 81 insertions(+), 85 deletions(-) diff --git a/netbox/templates/dcim/inc/frontport.html b/netbox/templates/dcim/inc/frontport.html index 9297585ee..2b79cf7a7 100644 --- a/netbox/templates/dcim/inc/frontport.html +++ b/netbox/templates/dcim/inc/frontport.html @@ -1,46 +1,44 @@ -{% with cable=frontport.get_connected_cable %} - + - {# Checkbox #} - {% if perms.dcim.change_frontport or perms.dcim.delete_frontport %} - - - + {# Checkbox #} + {% if perms.dcim.change_frontport or perms.dcim.delete_frontport %} + + + + {% endif %} + + {# Name #} + + {{ frontport }} + + + {# Type #} + {{ frontport.get_type_display }} + + {# Rear port #} + {{ frontport.rear_port }} + {{ frontport.rear_port_position }} + + {# Cable #} + + {% if frontport.cable %} + {{ frontport.cable }} + {% else %} + Not connected {% endif %} + - {# Name #} - - {{ frontport }} - - - {# Type #} - {{ frontport.get_type_display }} - - {# Rear port #} - {{ frontport.rear_port }} - {{ frontport.rear_port_position }} - - {# Cable #} - - {% if cable %} - {{ cable }} to {{ cable.far_end.device }} {{ cable.far_end }} - {% else %} - Not connected - {% endif %} - - - {# Actions #} - - {% if perms.dcim.change_frontport %} - - - - {% endif %} - {% if perms.dcim.delete_frontport %} - - - - {% endif %} - - -{% endwith %} + {# Actions #} + + {% if perms.dcim.change_frontport %} + + + + {% endif %} + {% if perms.dcim.delete_frontport %} + + + + {% endif %} + + diff --git a/netbox/templates/dcim/inc/rearport.html b/netbox/templates/dcim/inc/rearport.html index 9a8128de4..424565b19 100644 --- a/netbox/templates/dcim/inc/rearport.html +++ b/netbox/templates/dcim/inc/rearport.html @@ -1,45 +1,43 @@ -{% with cable=rearport.get_connected_cable %} - + - {# Checkbox #} - {% if perms.dcim.change_rearport or perms.dcim.delete_rearport %} - - - + {# Checkbox #} + {% if perms.dcim.change_rearport or perms.dcim.delete_rearport %} + + + + {% endif %} + + {# Name #} + + {{ rearport }} + + + {# Type #} + {{ rearport.get_type_display }} + + {# Positions #} + {{ rearport.positions }} + + {# Cable #} + + {% if rearport.cable %} + {{ rearport.cable }} + {% else %} + Not connected {% endif %} + - {# Name #} - - {{ rearport }} - - - {# Type #} - {{ rearport.get_type_display }} - - {# Positions #} - {{ rearport.positions }} - - {# Cable #} - - {% if cable %} - {{ cable }} to {{ cable.far_end.device }} {{ cable.far_end }} - {% else %} - Not connected - {% endif %} - - - {# Actions #} - - {% if perms.dcim.change_rearport %} - - - - {% endif %} - {% if perms.dcim.delete_rearport %} - - - - {% endif %} - - -{% endwith %} + {# Actions #} + + {% if perms.dcim.change_rearport %} + + + + {% endif %} + {% if perms.dcim.delete_rearport %} + + + + {% endif %} + +