Template cleanup (#6421)

* Clean up & comment base templates

* Clean up login template & form

* Use SVG file for NetBox logo

* Simplify breadcrumbs

* Merge changelog.html into home.html

* Rename title_container block to header

* Move breadcrumbs block to object.html

* Attach names to endblock template tags

* Reorganize root-level templates into base/ and inc/

* Remove obsolete reference to Bootstrap 3.4.1
This commit is contained in:
Jeremy Stretch
2021-05-17 16:27:27 -04:00
committed by GitHub
parent 744792452f
commit 805892f623
73 changed files with 426 additions and 468 deletions

View File

@@ -3,7 +3,7 @@
{% block title %}{{ object }} - Change Log{% endblock %}
{% block content %}
{% include 'panel_table.html' %}
{% include 'inc/panel_table.html' %}
{% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}
<div class="text-muted">
Change log retention: {% if settings.CHANGELOG_RETENTION %}{{ settings.CHANGELOG_RETENTION }} days{% else %}Indefinite{% endif %}

View File

@@ -26,7 +26,7 @@
</form>
{% endif %}
<div class="col col-md-9 mb-3">
{% include 'panel_table.html' %}
{% include 'inc/panel_table.html' %}
</div>
{% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}
{% endblock %}

View File

@@ -1,22 +1,18 @@
{% extends 'layout.html' %}
{% extends 'base/layout.html' %}
{% load helpers %}
{% block title %}{{ object }}{% endblock %}
{% block breadcrumb_main %}
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{% url 'extras:objectchange_list' %}">Change Log</a></li>
{% if object.related_object.get_absolute_url %}
<li class="breadcrumb-item"><a href="{{ object.related_object.get_absolute_url }}changelog/">{{ object.related_object }}</a></li>
{% elif object.changed_object.get_absolute_url %}
<li class="breadcrumb-item"><a href="{{ object.changed_object.get_absolute_url }}changelog/">{{ object.changed_object }}</a></li>
{% elif object.changed_object %}
<li class="breadcrumb-item">{{ object.changed_object }}</li>
{% endif %}
<li class="breadcrumb-item">{{ object }}</li>
</ol>
</nav>
{% block breadcrumbs %}
<li class="breadcrumb-item"><a href="{% url 'extras:objectchange_list' %}">Change Log</a></li>
{% if object.related_object.get_absolute_url %}
<li class="breadcrumb-item"><a href="{{ object.related_object.get_absolute_url }}changelog/">{{ object.related_object }}</a></li>
{% elif object.changed_object.get_absolute_url %}
<li class="breadcrumb-item"><a href="{{ object.changed_object.get_absolute_url }}changelog/">{{ object.changed_object }}</a></li>
{% elif object.changed_object %}
<li class="breadcrumb-item">{{ object.changed_object }}</li>
{% endif %}
<li class="breadcrumb-item">{{ object }}</li>
{% endblock %}
{% block header %}
@@ -159,7 +155,7 @@
</div>
<div class="row mb-3">
<div class="col col-md-12">
{% include 'panel_table.html' with table=related_changes_table heading='Related Changes' panel_class='default' %}
{% include 'inc/panel_table.html' with table=related_changes_table heading='Related Changes' panel_class='default' %}
{% if related_changes_count > related_changes_table.rows|length %}
<div class="float-end">
<a href="{% url 'extras:objectchange_list' %}?request_id={{ object.request_id }}" class="btn btn-primary">See All {{ related_changes_count|add:"1" }} Changes</a>

View File

@@ -1,16 +1,12 @@
{% extends 'layout.html' %}
{% extends 'base/layout.html' %}
{% load helpers %}
{% block title %}{{ report.name }}{% endblock %}
{% block breadcrumb_main %}
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{% url 'extras:report_list' %}">Reports</a></li>
<li class="breadcrumb-item"><a href="{% url 'extras:report_list' %}#module.{{ report.module }}">{{ report.module|bettertitle }}</a></li>
<li class="breadcrumb-item">{{ report.name }}</li>
</ol>
</nav>
{% block breadcrumbs %}
<li class="breadcrumb-item"><a href="{% url 'extras:report_list' %}">Reports</a></li>
<li class="breadcrumb-item"><a href="{% url 'extras:report_list' %}#module.{{ report.module }}">{{ report.module|bettertitle }}</a></li>
<li class="breadcrumb-item">{{ report.name }}</li>
{% endblock %}
{% block content %}

View File

@@ -1,4 +1,4 @@
{% extends 'layout.html' %}
{% extends 'base/layout.html' %}
{% load helpers %}
{% block title %}Reports{% endblock %}

View File

@@ -1,19 +1,14 @@
{% extends 'layout.html' %}
{% extends 'base/layout.html' %}
{% load helpers %}
{% load form_helpers %}
{% load log_levels %}
{% block title %}{{ script }}{% endblock %}
{% block breadcrumb_main %}
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Home</a></li>
<li class="breadcrumb-item"><a href="{% url 'extras:script_list' %}">Scripts</a></li>
<li class="breadcrumb-item"><a href="{% url 'extras:script_list' %}#module.{{ module }}">{{ module|bettertitle }}</a></li>
<li class="breadcrumb-item">{{ script }}</li>
</ol>
</nav>
{% block breadcrumbs %}
<li class="breadcrumb-item"><a href="{% url 'extras:script_list' %}">Scripts</a></li>
<li class="breadcrumb-item"><a href="{% url 'extras:script_list' %}#module.{{ module }}">{{ module|bettertitle }}</a></li>
<li class="breadcrumb-item">{{ script }}</li>
{% endblock %}
{% block content %}

View File

@@ -1,4 +1,4 @@
{% extends 'layout.html' %}
{% extends 'base/layout.html' %}
{% load helpers %}
{% block title %}Scripts{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends 'layout.html' %}
{% extends 'base/layout.html' %}
{% load helpers %}
{% load form_helpers %}
{% load log_levels %}

View File

@@ -51,7 +51,7 @@
</div>
</div>
<div class="col col-md-6">
{% include 'panel_table.html' with table=items_table heading='Tagged Objects' %}
{% include 'inc/panel_table.html' with table=items_table heading='Tagged Objects' %}
{% include 'inc/paginator.html' with paginator=items_table.paginator page=items_table.page %}
</div>
</div>