Reorganize root-level templates into base/ and inc/

This commit is contained in:
jeremystretch 2021-05-17 15:23:47 -04:00
parent 0daa1134f3
commit 47faa807ba
65 changed files with 75 additions and 84 deletions

View File

@ -1,4 +1,4 @@
{% extends '40x.html' %}
{% extends 'base/40x.html' %}
{% block title %}Access Denied{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends '40x.html' %}
{% extends 'base/40x.html' %}
{% block title %}Page Not Found{% endblock %}

View File

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

View File

@ -56,7 +56,7 @@
{% block javascript %}{% endblock %}
{# User messages #}
{% include './messages.html' %}
{% include 'inc/messages.html' %}
{# Data container #}
<div id="netbox-data" style="display: none!important; visibility: hidden!important">

View File

@ -1,5 +1,5 @@
{# Base layout for the core NetBox UI w/navbar and page content #}
{% extends 'base.html' %}
{% extends 'base/base.html' %}
{% load nav %}
{% load search_options %}
{% load static %}
@ -26,7 +26,7 @@
{% search_options %}
</div>
<div class="d-flex d-md-none mx-1 my-3 justify-content-end">
{% include './profile_button.html' %}
{% include 'inc/profile_button.html' %}
</div>
{% nav %}
</ul>
@ -81,7 +81,7 @@
</div>
<div class="d-none d-md-flex w-100 search-container">
{% search_options %}
{% include './profile_button.html' %}
{% include 'inc/profile_button.html' %}
</div>
</nav>

View File

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

View File

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

View File

@ -1,4 +1,4 @@
{% extends 'layout.html' %}
{% extends 'base/layout.html' %}
{% load buttons %}
{% block title %}{{ title }}{% endblock %}
@ -10,7 +10,7 @@
<div class="col col-md-9">
<div class="card">
<div class="card-body">
{% include 'responsive_table.html' %}
{% include 'inc/responsive_table.html' %}
</div>
</div>
{% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}

View File

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

View File

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

View File

@ -1,4 +1,4 @@
{% extends 'layout.html' %}
{% extends 'base/layout.html' %}
{% load form_helpers %}
{% block title %}Add {{ component_type }} to {{ parent }}{% endblock %}

View File

@ -7,7 +7,7 @@
{{ title }}
</h5>
<div class="card-body">
{% include 'responsive_table.html' %}
{% include 'inc/responsive_table.html' %}
</div>
<div class="card-footer noprint">
{% if table.rows %}
@ -37,7 +37,7 @@
{{ title }}
</h5>
<div class="card-body">
{% include 'responsive_table.html' %}
{% include 'inc/responsive_table.html' %}
</div>
</div>
{% endif %}

View File

@ -291,12 +291,12 @@
</div>
<div class="row mb-3">
<div class="col col-md-12">
{% include 'panel_table.html' with table=vlan_table heading="VLANs" %}
{% include 'inc/panel_table.html' with table=vlan_table heading="VLANs" %}
</div>
</div>
<div class="row mb-3">
<div class="col col-md-12">
{% include 'panel_table.html' with table=child_interfaces_table heading="Child Interfaces" %}
{% include 'inc/panel_table.html' with table=child_interfaces_table heading="Child Interfaces" %}
</div>
</div>
<div class="row mb-3">

View File

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

View File

@ -1,4 +1,4 @@
{% extends 'layout.html' %}
{% extends 'base/layout.html' %}
{% load form_helpers %}
{% block title %}Add New Member to Virtual Chassis {{ virtual_chassis }}{% endblock %}

View File

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

View File

@ -16,4 +16,4 @@
has recently been upgraded, check that the WSGI service (e.g. gunicorn or uWSGI) has been restarted. This
ensures that the new code is running.
</p>
{% endblock %}
{% endblock message %}

View File

@ -9,4 +9,4 @@
media root is <code>{{ settings.MEDIA_ROOT }}</code>. Ensure that the user NetBox runs as has access to write
files to all locations within this path.
</p>
{% endblock %}
{% endblock message %}

View File

@ -14,4 +14,4 @@
can check this by connecting to the database using NetBox's credentials and issuing a query for
<code>SELECT VERSION()</code>.
</p>
{% endblock %}
{% endblock message %}

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,4 +1,4 @@
{% extends 'layout.html' %}
{% extends 'base/layout.html' %}
{% load helpers %}
{% block title %}{{ object }}{% endblock %}
@ -155,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,4 +1,4 @@
{% extends 'layout.html' %}
{% extends 'base/layout.html' %}
{% load helpers %}
{% block title %}{{ report.name }}{% endblock %}

View File

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

View File

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

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>

View File

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

View File

@ -1,4 +1,4 @@
{% extends 'layout.html' %}
{% extends 'base/layout.html' %}
{% load form_helpers %}
{% block title %}Add {{ model_name|title }}{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends 'layout.html' %}
{% extends 'base/layout.html' %}
{% load helpers %}
{% block title %}Delete {{ table.rows|length }} {{ obj_type_plural|bettertitle }}?{% endblock %}

View File

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

View File

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

View File

@ -1,4 +1,4 @@
{% extends 'layout.html' %}
{% extends 'base/layout.html' %}
{% load helpers %}
{% block title %}Remove {{ table.rows|length }} {{ obj_type_plural|bettertitle }}?{% endblock %}

View File

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

View File

@ -1,4 +1,4 @@
{% extends 'layout.html' %} {% load form_helpers %} {% load helpers %}
{% extends 'base/layout.html' %} {% load form_helpers %} {% load helpers %}
{% block title %}{% if obj.pk %}Editing {{ obj_type }} {{ obj }}{% else %}Add a new {{ obj_type }}{% endif %}{% endblock %}

View File

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

View File

@ -1,4 +1,4 @@
{% extends 'layout.html' %}
{% extends 'base/layout.html' %}
{% load buttons %}
{% load helpers %}
{% load render_table from django_tables2 %}
@ -78,7 +78,7 @@
<form method="post" class="form form-horizontal">
{% csrf_token %}
<input type="hidden" name="return_url" value="{% if return_url %}{{ return_url }}{% else %}{{ request.path }}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}{% endif %}" />
{% include table_template|default:'responsive_table.html' %}
{% include table_template|default:'inc/responsive_table.html' %}
<div class="float-start noprint bulk-buttons">
{% block bulk_buttons %}{% endblock %}
{% if bulk_edit_url and permissions.change %}

View File

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

View File

@ -1,9 +1,9 @@
{% extends 'layout.html' %}
{% extends 'base/layout.html' %}
{% block title %}Import Completed{% endblock %}
{% block content %}
{% include 'responsive_table.html' %}
{% include 'inc/responsive_table.html' %}
{% if return_url %}
<a href="{{ return_url }}" class="btn btn-outline-dark">View All</a>
{% endif %}

View File

@ -77,7 +77,7 @@
</div>
<div class="row mb-3">
<div class="col col-md-12">
{% include 'utilities/obj_table.html' with table=prefix_table table_template='panel_table.html' heading='Child Prefixes' bulk_edit_url='ipam:prefix_bulk_edit' bulk_delete_url='ipam:prefix_bulk_delete' %}
{% include 'utilities/obj_table.html' with table=prefix_table table_template='inc/panel_table.html' heading='Child Prefixes' bulk_edit_url='ipam:prefix_bulk_edit' bulk_delete_url='ipam:prefix_bulk_delete' %}
</div>
</div>
{% endblock %}

View File

@ -114,7 +114,7 @@
</div>
<div class="col col-md-8">
{% include 'panel_table.html' with table=parent_prefixes_table heading='Parent Prefixes' %}
{% include 'inc/panel_table.html' with table=parent_prefixes_table heading='Parent Prefixes' %}
{% if duplicate_ips_table.rows %}
{# Custom version of panel_table.html #}
<div class="card bg-danger">
@ -138,7 +138,7 @@
</div>
{% endif %}
<div class="my-3">
{% include 'utilities/obj_table.html' with table=related_ips_table table_template='panel_table.html' heading='Related IP Addresses' %}
{% include 'utilities/obj_table.html' with table=related_ips_table table_template='inc/panel_table.html' heading='Related IP Addresses' %}
</div>
{% plugin_right_page object %}
</div>

View File

@ -34,7 +34,7 @@
<div class="row mb-3">
<div class="col col-md-12">
<h3>Search Results</h3>
{% include 'utilities/obj_table.html' with table_template='panel_table.html' %}
{% include 'utilities/obj_table.html' with table_template='inc/panel_table.html' %}
</div>
</div>
{% endif %}

View File

@ -117,9 +117,9 @@
</div>
<div class="col col-md-7">
{% if duplicate_prefix_table.rows %}
{% include 'panel_table.html' with table=duplicate_prefix_table heading='Duplicate Prefixes' %}
{% include 'inc/panel_table.html' with table=duplicate_prefix_table heading='Duplicate Prefixes' %}
{% endif %}
{% include 'panel_table.html' with table=parent_prefix_table heading='Parent Prefixes' %}
{% include 'inc/panel_table.html' with table=parent_prefix_table heading='Parent Prefixes' %}
{% plugin_right_page object %}
</div>
</div>

View File

@ -12,7 +12,7 @@
{% block content %}
<div class="row">
<div class="col col-md-12">
{% include 'utilities/obj_table.html' with table=ip_table table_template='panel_table.html' heading='IP Addresses' bulk_edit_url='ipam:ipaddress_bulk_edit' bulk_delete_url='ipam:ipaddress_bulk_delete' %}
{% include 'utilities/obj_table.html' with table=ip_table table_template='inc/panel_table.html' heading='IP Addresses' bulk_edit_url='ipam:ipaddress_bulk_edit' bulk_delete_url='ipam:ipaddress_bulk_delete' %}
</div>
</div>
{% endblock %}

View File

@ -19,7 +19,7 @@
{% block content %}
<div class="row">
<div class="col col-md-12">
{% include 'utilities/obj_table.html' with table=prefix_table table_template='panel_table.html' heading='Child Prefixes' bulk_edit_url='ipam:prefix_bulk_edit' bulk_delete_url='ipam:prefix_bulk_delete' parent=prefix %}
{% include 'utilities/obj_table.html' with table=prefix_table table_template='inc/panel_table.html' heading='Child Prefixes' bulk_edit_url='ipam:prefix_bulk_edit' bulk_delete_url='ipam:prefix_bulk_delete' parent=prefix %}
</div>
</div>
{% endblock %}

View File

@ -42,9 +42,9 @@
</div>
<div class="col col-md-6">
<div class="mb-4">
{% include 'panel_table.html' with table=importing_vrfs_table heading="Importing VRFs" %}
{% include 'inc/panel_table.html' with table=importing_vrfs_table heading="Importing VRFs" %}
</div>
{% include 'panel_table.html' with table=exporting_vrfs_table heading="Exporting VRFs" %}
{% include 'inc/panel_table.html' with table=exporting_vrfs_table heading="Exporting VRFs" %}
{% plugin_right_page object %}
</div>
</div>

View File

@ -87,7 +87,7 @@
Prefixes
</h5>
<div class="card-body">
{% include 'responsive_table.html' with table=prefix_table %}
{% include 'inc/responsive_table.html' with table=prefix_table %}
</div>
{% if perms.ipam.add_prefix %}
<div class="card-footer text-end noprint">

View File

@ -3,7 +3,7 @@
{% block content %}
<div class="row">
<div class="col col-md-12">
{% include 'utilities/obj_table.html' with table=members_table table_template='panel_table.html' heading='Device Interfaces' parent=vlan %}
{% include 'utilities/obj_table.html' with table=members_table table_template='inc/panel_table.html' heading='Device Interfaces' parent=vlan %}
</div>
</div>
{% endblock %}

View File

@ -3,7 +3,7 @@
{% block content %}
<div class="row">
<div class="col col-md-12">
{% include 'utilities/obj_table.html' with table=members_table table_template='panel_table.html' heading='Virtual Machine Interfaces' parent=vlan %}
{% include 'utilities/obj_table.html' with table=members_table table_template='inc/panel_table.html' heading='Virtual Machine Interfaces' parent=vlan %}
</div>
</div>
{% endblock %}

View File

@ -66,8 +66,8 @@
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
{% include 'panel_table.html' with table=import_targets_table heading="Import Route Targets" %}
{% include 'panel_table.html' with table=export_targets_table heading="Export Route Targets" %}
{% include 'inc/panel_table.html' with table=import_targets_table heading="Import Route Targets" %}
{% include 'inc/panel_table.html' with table=export_targets_table heading="Export Route Targets" %}
{% plugin_right_page object %}
</div>
</div>

View File

@ -1,5 +1,5 @@
{# User login page. Extends base.html directly to override normal UI layout. #}
{% extends 'base.html' %}
{% extends 'base/base.html' %}
{% load form_helpers %}
{% load static %}

View File

@ -1,4 +1,4 @@
{% extends 'layout.html' %}
{% extends 'base/layout.html' %}
{% load helpers %}
{% load form_helpers %}
@ -11,7 +11,7 @@
<div class="col col-md-9">
{% for obj_type in results %}
<h3 id="{{ obj_type.name|lower }}">{{ obj_type.name|bettertitle }}</h3>
{% include 'panel_table.html' with table=obj_type.table %}
{% include 'inc/panel_table.html' with table=obj_type.table %}
<a href="{{ obj_type.url }}" class="btn btn-primary float-end my-3">
<i class="mdi mdi-arrow-right-bold" aria-hidden="true"></i>
{% if obj_type.table.page.has_next %}

View File

@ -1,9 +0,0 @@
<div class="row" style="padding-bottom: 20px">
<div class="col col-md-12 text-center">
<form action="{% url 'search' %}" method="get" class="form-inline">
<input type="text" name="q" value="{{ request.GET.q }}" placeholder="Search" id="id_q" class="form-control" style="width: 350px" />
{{ search_form.obj_type }}
<button type="submit" class="btn btn-primary">Search</button>
</form>
</div>
</div>

View File

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

View File

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

View File

@ -27,7 +27,7 @@
</div>
</div>
{% endif %}
{% include table_template|default:'responsive_table.html' %}
{% include table_template|default:'inc/responsive_table.html' %}
<div class="float-start noprint">
{% block extra_actions %}{% endblock %}
{% if bulk_edit_url and permissions.change %}
@ -43,7 +43,7 @@
</div>
</form>
{% else %}
{% include table_template|default:'responsive_table.html' %}
{% include table_template|default:'inc/responsive_table.html' %}
{% endif %}
{% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}
<div class="clearfix"></div>

View File

@ -11,7 +11,7 @@
<form action="{% url 'virtualization:cluster_remove_devices' pk=object.pk %}" method="post">
{% csrf_token %}
<div class="card-body">
{% include 'responsive_table.html' with table=devices_table %}
{% include 'inc/responsive_table.html' with table=devices_table %}
</div>
{% if perms.virtualization.change_cluster %}
<div class="card-footer noprint">

View File

@ -9,7 +9,7 @@
Virtual Machines
</h5>
<div class="card-body">
{% include 'responsive_table.html' with table=virtualmachines_table %}
{% include 'inc/responsive_table.html' with table=virtualmachines_table %}
</div>
</div>
</div>

View File

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

View File

@ -102,12 +102,12 @@
</div>
<div class="row mb-3">
<div class="col col-md-12">
{% include 'panel_table.html' with table=vlan_table heading="VLANs" %}
{% include 'inc/panel_table.html' with table=vlan_table heading="VLANs" %}
</div>
</div>
<div class="row mb-3">
<div class="col col-md-12">
{% include 'panel_table.html' with table=child_interfaces_table heading="Child Interfaces" %}
{% include 'inc/panel_table.html' with table=child_interfaces_table heading="Child Interfaces" %}
</div>
</div>
<div class="row">