From 06b80b060c072916384378ede56d6b9209961642 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Fri, 14 May 2021 15:31:35 -0400 Subject: [PATCH] Clean up & comment base templates --- netbox/templates/base.html | 44 ++++++--- netbox/templates/bottom.html | 16 --- netbox/templates/footer.html | 42 -------- netbox/templates/layout.html | 183 +++++++++++++++++++++-------------- 4 files changed, 145 insertions(+), 140 deletions(-) delete mode 100644 netbox/templates/bottom.html delete mode 100644 netbox/templates/footer.html diff --git a/netbox/templates/base.html b/netbox/templates/base.html index a2f1337ac..085293d0e 100644 --- a/netbox/templates/base.html +++ b/netbox/templates/base.html @@ -1,8 +1,20 @@ -{% load static %} {% load helpers %} +{# Base template for (almost) all NetBox pages #} +{% load static %} +{% load static %} +{% load helpers %} + + + + {# Page title #} {% block title %}Home{% endblock %} | NetBox + + {# Static resources #} - - - + + {# Javascript #} + + {# Additional content #} {% block head %}{% endblock %} - {% with color_mode=preferences|get_key:'ui.colormode' %} - - + + + {# Page layout #} {% block layout %}{% endblock %} + + {# Additional Javascript #} {% block javascript %}{% endblock %} + + {# User messages #} {% include './messages.html' %} + + {# Data container #}
- {% block data %}{% endblock %} + {% block data %}{% endblock %}
+ - {% endwith %} diff --git a/netbox/templates/bottom.html b/netbox/templates/bottom.html deleted file mode 100644 index 5b5978e3a..000000000 --- a/netbox/templates/bottom.html +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/netbox/templates/footer.html b/netbox/templates/footer.html deleted file mode 100644 index e0f78ddbe..000000000 --- a/netbox/templates/footer.html +++ /dev/null @@ -1,42 +0,0 @@ - diff --git a/netbox/templates/layout.html b/netbox/templates/layout.html index 66de47c08..d151ccc22 100644 --- a/netbox/templates/layout.html +++ b/netbox/templates/layout.html @@ -1,81 +1,124 @@ +{# Base layout for the core NetBox UI w/navbar and page content #} {% extends 'base.html' %} +{% load nav %} {% load search_options %} - -{% block head %}{% endblock %} +{% load static %} {% block layout %} -
-
-
- - + + {# Top bar #} + + + {# Body #} +
+ + {# Page title #} + {% block title_container %} +
+
+

{% block title %}{% endblock %}

+ {% block breadcrumb_main %}{% endblock %} +
+ {% block controls %}{% endblock %} +
+ {% endblock %} + + {# Page content #} +
+ {% block tabs %}{% endblock %} + {% block content %}{% endblock %} +
+ + {# Page footer #} + + +
+ +
+
- {% endblock %} -{% block javascript %}{% endblock %} -{% block data %}{% endblock %}