From 4c60a602b958a4e342406be9d460c5d3a635b1eb Mon Sep 17 00:00:00 2001 From: checktheroads Date: Sat, 13 Mar 2021 11:16:29 -0700 Subject: [PATCH] bootstrap 5 template updates --- netbox/templates/dcim/cable.html | 18 +- netbox/templates/dcim/connections_list.html | 5 +- netbox/templates/dcim/consoleport.html | 125 +++--- netbox/templates/dcim/consoleserverport.html | 131 +++--- netbox/templates/dcim/device/base.html | 398 ++++++++++++------ netbox/templates/dcim/device/config.html | 6 +- netbox/templates/dcim/device_component.html | 8 +- .../templates/dcim/device_component_add.html | 28 +- .../dcim/inc/device_napalm_tabs.html | 18 +- netbox/templates/generic/object.html | 16 +- netbox/templates/ipam/ipaddress.html | 2 - netbox/templates/ipam/ipaddress_bulk_add.html | 41 +- netbox/templates/ipam/ipaddress_edit.html | 9 +- netbox/templates/layout.html | 1 + 14 files changed, 485 insertions(+), 321 deletions(-) diff --git a/netbox/templates/dcim/cable.html b/netbox/templates/dcim/cable.html index 376271802..456300224 100644 --- a/netbox/templates/dcim/cable.html +++ b/netbox/templates/dcim/cable.html @@ -5,8 +5,8 @@ {% load plugins %} {% block breadcrumbs %} -
  • Cables
  • -
  • {{ object }}
  • + + {% endblock %} {% block buttons %} @@ -28,21 +28,21 @@
    - + - + - + - + - +
    TypeType {{ object.get_type_display|placeholder }}
    StatusStatus {{ object.get_status_display }}
    LabelLabel {{ object.label|placeholder }}
    ColorColor {% if object.color %}   @@ -52,7 +52,7 @@
    LengthLength {% if object.length %} {{ object.length }} {{ object.get_length_unit_display }} @@ -73,13 +73,17 @@
    Termination A
    +
    {% include 'dcim/inc/cable_termination.html' with termination=object.termination_a %} +
    Termination B
    +
    {% include 'dcim/inc/cable_termination.html' with termination=object.termination_b %} +
    {% plugin_right_page object %} diff --git a/netbox/templates/dcim/connections_list.html b/netbox/templates/dcim/connections_list.html index 80d76e7d1..f1146e276 100644 --- a/netbox/templates/dcim/connections_list.html +++ b/netbox/templates/dcim/connections_list.html @@ -1,11 +1,12 @@ {% extends 'base.html' %} {% load buttons %} +{% block title %}{{ title }}{% endblock %} + {% block content %} -
    +
    {% export_button content_type %}
    -

    {% block title %}{{ title }}{% endblock %}

    diff --git a/netbox/templates/dcim/consoleport.html b/netbox/templates/dcim/consoleport.html index 701fc6ef6..fcefc9fab 100644 --- a/netbox/templates/dcim/consoleport.html +++ b/netbox/templates/dcim/consoleport.html @@ -5,52 +5,53 @@ {% block content %}
    -
    -
    - Console Port +
    +
    + Console Port +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    Device + {{ object.device }} +
    Name{{ object.name }}
    Label{{ object.label|placeholder }}
    Type{{ object.get_type_display }}
    Description{{ object.description|placeholder }}
    - - - - - - - - - - - - - - - - - - - - - -
    Device - {{ object.device }} -
    Name{{ object.name }}
    Label{{ object.label|placeholder }}
    Type{{ object.get_type_display }}
    Description{{ object.description|placeholder }}
    {% include 'inc/custom_fields_panel.html' %} {% include 'extras/inc/tags_panel.html' with tags=object.tags.all %} {% plugin_left_page object %}
    -
    -
    - Connection -
    - {% if object.mark_connected %} -
    - Marked as connected -
    - {% elif object.cable %} - +
    +
    + Connection +
    +
    + {% if object.mark_connected %} + Marked as connected + {% elif object.cable %} +
    - + {% if object.connected_endpoint %} - + - + - + - + - +
    CableCable {{ object.cable }} @@ -60,27 +61,27 @@
    DeviceDevice {{ object.connected_endpoint.device }}
    NameName {{ object.connected_endpoint.name }}
    TypeType {{ object.connected_endpoint.get_type_display|placeholder }}
    DescriptionDescription {{ object.connected_endpoint.description|placeholder }}
    Path StatusPath Status {% if object.path.is_active %} Reachable @@ -92,23 +93,45 @@ {% endif %}
    {% else %} -
    - Not connected +
    + Not Connected {% if perms.dcim.add_cable %} - - - +
    {% endif %}
    {% endif %}
    +
    {% plugin_right_page object %}
    diff --git a/netbox/templates/dcim/consoleserverport.html b/netbox/templates/dcim/consoleserverport.html index b4e6d6ab9..fb4c0982a 100644 --- a/netbox/templates/dcim/consoleserverport.html +++ b/netbox/templates/dcim/consoleserverport.html @@ -5,52 +5,53 @@ {% block content %}
    -
    -
    - Console Server Port +
    +
    + Console Server Port +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    Device + {{ object.device }} +
    Name{{ object.name }}
    Label{{ object.label|placeholder }}
    Type{{ object.get_type_display }}
    Description{{ object.description|placeholder }}
    - - - - - - - - - - - - - - - - - - - - - -
    Device - {{ object.device }} -
    Name{{ object.name }}
    Label{{ object.label|placeholder }}
    Type{{ object.get_type_display }}
    Description{{ object.description|placeholder }}
    {% include 'inc/custom_fields_panel.html' %} {% include 'extras/inc/tags_panel.html' with tags=object.tags.all %} {% plugin_left_page object %}
    -
    -
    - Connection -
    - {% if object.mark_connected %} -
    - Marked as connected -
    - {% elif object.cable %} - +
    +
    + Connection +
    +
    + {% if object.mark_connected %} + Marked as connected + {% elif object.cable %} +
    - + {% if object.connected_endpoint %} - + - + - + - + - + {% endif %}
    CableCable {{ object.cable }} @@ -60,54 +61,76 @@
    DeviceDevice {{ object.connected_endpoint.device }}
    NameName {{ object.connected_endpoint.name }}
    TypeType {{ object.connected_endpoint.get_type_display|placeholder }}
    DescriptionDescription {{ object.connected_endpoint.description|placeholder }}
    Path StatusPath Status {% if object.path.is_active %} - Reachable + Reachable {% else %} - Not Reachable + Not Reachable {% endif %}
    {% else %} -
    - Not connected +
    + Not Connected {% if perms.dcim.add_cable %} - - -
    {% endif %}
    {% endif %} +
    {% plugin_right_page object %}
    diff --git a/netbox/templates/dcim/device/base.html b/netbox/templates/dcim/device/base.html index 608b1e85c..73b8ab19d 100644 --- a/netbox/templates/dcim/device/base.html +++ b/netbox/templates/dcim/device/base.html @@ -15,142 +15,270 @@ {% endblock %} -{% block buttons %} - {% if perms.dcim.change_device %} -
    - - -
    - {% endif %} - {% if perms.dcim.add_device %} - {% clone_button object %} - {% endif %} - {% if perms.dcim.change_device %} - {% edit_button object %} - {% endif %} - {% if perms.dcim.delete_device %} - {% delete_button object %} - {% endif %} +{% block extra_controls %} +{% if perms.dcim.change_device %} + +{% endif %} {% endblock %} -{% block tabs %} - + {% endif %} +{% endwith %} +{% with frontport_count=object.frontports.count %} + {% if frontport_count %} + + {% endif %} +{% endwith %} +{% with rearport_count=object.rearports.count %} + {% if rearport_count %} + + {% endif %} +{% endwith %} +{% with consoleport_count=object.consoleports.count %} + {% if consoleport_count %} + + {% endif %} +{% endwith %} +{% with consoleserverport_count=object.consoleserverports.count %} + {% if consoleserverport_count %} + + {% endif %} +{% endwith %} +{% with powerport_count=object.powerports.count %} + {% if powerport_count %} + + {% endif %} +{% endwith %} +{% with poweroutlet_count=object.poweroutlets.count %} + {% if poweroutlet_count %} + + {% endif %} +{% endwith %} +{% with devicebay_count=object.devicebays.count %} + {% if devicebay_count %} + + {% endif %} +{% endwith %} +{% with inventoryitem_count=object.inventoryitems.count %} + {% if inventoryitem_count %} + + {% endif %} +{% endwith %} +{% if perms.dcim.napalm_read_device %} + {% if object.status != 'active' %} + {% include 'dcim/inc/device_napalm_tabs.html' with disabled_message='Device must be in active status' %} + {% elif not object.platform %} + {% include 'dcim/inc/device_napalm_tabs.html' with disabled_message='No platform assigned to this device' %} + {% elif not object.platform.napalm_driver %} + {% include 'dcim/inc/device_napalm_tabs.html' with disabled_message='No NAPALM driver assigned for this platform' %} + {% else %} + {% include 'dcim/inc/device_napalm_tabs.html' %} + {% endif %} +{% endif %} +{% if perms.extras.view_configcontext %} + +{% endif %} +{% if perms.extras.view_objectchange %} + +{% endif %} {% endblock %} diff --git a/netbox/templates/dcim/device/config.html b/netbox/templates/dcim/device/config.html index 4b73a2577..e8ca0da10 100644 --- a/netbox/templates/dcim/device/config.html +++ b/netbox/templates/dcim/device/config.html @@ -7,9 +7,9 @@ {% include 'inc/ajax_loader.html' %}
    -
    -
    Device Configuration
    -
    +
    +
    Device Configuration
    +