mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
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:
@ -1,4 +1,4 @@
|
||||
{% extends '40x.html' %}
|
||||
{% extends 'base/40x.html' %}
|
||||
|
||||
{% block title %}Access Denied{% endblock %}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends '40x.html' %}
|
||||
{% extends 'base/40x.html' %}
|
||||
|
||||
{% block title %}Page Not Found{% endblock %}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
|
||||
{% block title %}{% endblock %}
|
||||
|
@ -1,8 +1,20 @@
|
||||
{% load static %} {% load helpers %}
|
||||
{# Base template for (almost) all NetBox pages #}
|
||||
{% load static %}
|
||||
{% load static %}
|
||||
{% load helpers %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"
|
||||
/>
|
||||
|
||||
{# Page title #}
|
||||
<title>{% block title %}Home{% endblock %} | NetBox</title>
|
||||
|
||||
{# Static resources #}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{% static 'netbox-external.css'%}"
|
||||
@ -18,30 +30,38 @@
|
||||
href="{% static 'netbox-dark.css'%}"
|
||||
onerror="window.location='{% url 'media_failure' %}?filename=netbox-dark.css'"
|
||||
/>
|
||||
|
||||
<link rel="icon" type="image/png" href="{% static 'netbox.ico' %}" />
|
||||
<meta charset="UTF-8" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"
|
||||
/>
|
||||
|
||||
{# Javascript #}
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="{% static 'netbox.js' %}"
|
||||
onerror="window.location='{% url 'media_failure' %}?filename=netbox.js'">
|
||||
</script>
|
||||
|
||||
{# Additional <head> content #}
|
||||
{% block head %}{% endblock %}
|
||||
</head>
|
||||
{% with color_mode=preferences|get_key:'ui.colormode' %}
|
||||
|
||||
<body{%if color_mode == 'dark'%} data-netbox-color-mode="dark"{% elif color_mode == 'light' %} data-netbox-color-mode="light"{% endif %}>
|
||||
|
||||
<body
|
||||
{% if preferences|get_key:'ui.colormode' == 'dark'%} data-netbox-color-mode="dark"
|
||||
{% else %} data-netbox-color-mode="light"
|
||||
{% endif %}
|
||||
>
|
||||
|
||||
{# Page layout #}
|
||||
{% block layout %}{% endblock %}
|
||||
|
||||
{# Additional Javascript #}
|
||||
{% block javascript %}{% endblock %}
|
||||
{% include './messages.html' %}
|
||||
|
||||
{# User messages #}
|
||||
{% include 'inc/messages.html' %}
|
||||
|
||||
{# Data container #}
|
||||
<div id="netbox-data" style="display: none!important; visibility: hidden!important">
|
||||
{% block data %}{% endblock %}
|
||||
{% block data %}{% endblock %}
|
||||
</div>
|
||||
|
||||
</body>
|
||||
{% endwith %}
|
||||
</html>
|
128
netbox/templates/base/layout.html
Normal file
128
netbox/templates/base/layout.html
Normal file
@ -0,0 +1,128 @@
|
||||
{# Base layout for the core NetBox UI w/navbar and page content #}
|
||||
{% extends 'base/base.html' %}
|
||||
{% load nav %}
|
||||
{% load search_options %}
|
||||
{% load static %}
|
||||
|
||||
{% block layout %}
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<main class="col-md-9 ms-sm-auto col-lg-10 px-0">
|
||||
|
||||
{# Sidebar #}
|
||||
<nav id="sidebar-menu" class="col-md-3 col-lg-2 d-md-block sidebar collapse px-0">
|
||||
|
||||
{# Sidebar content #}
|
||||
<div class="position-sticky pt-3">
|
||||
|
||||
{# Logo #}
|
||||
<a class="px-2 sidebar-logo d-none d-md-flex" href="{% url 'home' %}">
|
||||
<img src="{% static 'netbox_logo.svg' %}" alt="NetBox logo" />
|
||||
</a>
|
||||
|
||||
{# Search bar #}
|
||||
<ul class="nav flex-column">
|
||||
<div class="d-block d-md-none mx-1 my-3 search-container">
|
||||
{% search_options %}
|
||||
</div>
|
||||
<div class="d-flex d-md-none mx-1 my-3 justify-content-end">
|
||||
{% include 'inc/profile_button.html' %}
|
||||
</div>
|
||||
{% nav %}
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
{# Sidebar footer #}
|
||||
<div class="d-flex flex-column container-fluid mt-auto justify-content-end sidebar-bottom">
|
||||
<nav class="nav justify-content-between mb-2 mt-4 px-2">
|
||||
|
||||
{# Documentation #}
|
||||
<a type="button" target="_blank" class="nav-link" href="https://netbox.readthedocs.io/">
|
||||
<i title="Docs" class="mdi mdi-book-open-variant text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
|
||||
</a>
|
||||
|
||||
{# API docs #}
|
||||
<a class="nav-link" href="{% url 'api_docs' %}" target="_blank">
|
||||
<i title="API" data-bs-placement="top" data-bs-toggle="tooltip" class="mdi mdi-code-braces text-primary"></i>
|
||||
</a>
|
||||
|
||||
{# GitHub #}
|
||||
<a class="nav-link" href="https://github.com/netbox-community/netbox" target="_blank">
|
||||
<i title="Source Code" data-bs-placement="top" data-bs-toggle="tooltip" class="mdi mdi-code-tags text-primary"></i>
|
||||
</a>
|
||||
|
||||
{# GitHub wiki #}
|
||||
<a target="_blank" class="nav-link" href="https://github.com/netbox-community/netbox/wiki">
|
||||
<i title="Get Help" data-bs-placement="top" data-bs-toggle="tooltip" class="mdi mdi-lifebuoy text-primary"></i>
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
|
||||
{# Top bar #}
|
||||
<nav class="navbar navbar-light sticky-top flex-md-nowrap py-4 search container-fluid">
|
||||
<div class="d-md-none w-100 d-flex justify-content-between align-items-center my-3">
|
||||
<a class="px-2 sidebar-logo d-block d-md-none" href="{% url 'home' %}">
|
||||
<img src="{% static 'netbox_logo.svg' %}" alt="NetBox logo" />
|
||||
</a>
|
||||
<button
|
||||
type="button"
|
||||
aria-expanded="false"
|
||||
data-bs-toggle="collapse"
|
||||
aria-controls="sidebar-menu"
|
||||
data-bs-target="#sidebar-menu"
|
||||
aria-label="Toggle Navigation"
|
||||
class="navbar-toggler position-relative collapsed"
|
||||
>
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="d-none d-md-flex w-100 search-container">
|
||||
{% search_options %}
|
||||
{% include 'inc/profile_button.html' %}
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
{# Body #}
|
||||
<div class="px-4 content-container">
|
||||
|
||||
{# Page header #}
|
||||
{% block header %}
|
||||
<div class="title-container">
|
||||
|
||||
{# Title #}
|
||||
<div id="content-title">
|
||||
<h1 class="h2 w-100">{% block title %}{% endblock %}</h1>
|
||||
</div>
|
||||
|
||||
{# Controls #}
|
||||
{% block controls %}{% endblock %}
|
||||
|
||||
</div>
|
||||
{% endblock header %}
|
||||
|
||||
{# Page content #}
|
||||
<div id="content" class="container-fluid p-0 m-0">
|
||||
{% block tabs %}{% endblock %}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
|
||||
{# Page footer #}
|
||||
<footer class="footer container-fluid pb-3 pt-4 px-0">
|
||||
<div class="row align-items-center justify-content-end">
|
||||
<div class="col-auto d-none d-md-block"></div>
|
||||
<div class="col text-center text-md-end small text-muted">
|
||||
<span class="fw-light d-block d-md-inline">{% now 'Y-m-d H:i:s T' %}</span>
|
||||
<span class="ms-md-3 d-block d-md-inline">{{ settings.HOSTNAME }} (v{{ settings.VERSION }})</span>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock layout %}
|
@ -1,16 +0,0 @@
|
||||
<div class="d-flex flex-column container-fluid mt-auto justify-content-end sidebar-bottom">
|
||||
<nav class="nav justify-content-between mb-2 mt-4 px-2">
|
||||
<a type="button" target="_blank" class="nav-link" href="https://netbox.readthedocs.io/">
|
||||
<i title="Docs" class="mdi mdi-book-open-variant text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
|
||||
</a>
|
||||
<a class="nav-link" href="{% url 'api_docs' %}" target="_blank">
|
||||
<i title="API" data-bs-placement="top" data-bs-toggle="tooltip" class="mdi mdi-code-braces text-primary"></i>
|
||||
</a>
|
||||
<a class="nav-link" href="https://github.com/netbox-community/netbox" target="_blank">
|
||||
<i title="Source Code" data-bs-placement="top" data-bs-toggle="tooltip" class="mdi mdi-code-tags text-primary"></i>
|
||||
</a>
|
||||
<a target="_blank" class="nav-link" href="https://github.com/netbox-community/netbox/wiki">
|
||||
<i title="Get Help" data-bs-placement="top" data-bs-toggle="tooltip" class="mdi mdi-lifebuoy text-primary"></i>
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
@ -1,47 +0,0 @@
|
||||
{% load helpers %} {% load get_status %}
|
||||
{% if changelog and perms.extras.view_objectchange %}
|
||||
<table class="table align-middle table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">User</th>
|
||||
<th scope="col">Action</th>
|
||||
<th scope="col">Type</th>
|
||||
<th scope="col">Object</th>
|
||||
<th scope="col">Time</th>
|
||||
<th scope="col" align="right"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for change in changelog %}
|
||||
<tr class="{% get_status change.get_action_display %}">
|
||||
<th scope="row">{{ change.user|default:change.user_name }}</th>
|
||||
<td>{{ change.get_action_display|bettertitle }}</td>
|
||||
<td>{{ change.changed_object_type.name|bettertitle }}</td>
|
||||
<td>
|
||||
{% if change.changed_object.get_absolute_url %}
|
||||
<a class="text-body" href="{{ change.changed_object.get_absolute_url }}">{{ change.changed_object }}</a>
|
||||
{% else %} {{ change.changed_object|default:change.object_repr }} {% endif %}
|
||||
</td>
|
||||
|
||||
<td>{{ change.time|date:'SHORT_DATETIME_FORMAT' }}</td>
|
||||
<td>
|
||||
<a role="button" class="text-body" href="{{ change.get_absolute_url }}">
|
||||
<i class="mdi mdi-dots-horizontal" data-bs-toggle="tooltip" data-bs-placement="left" title="View Change Details"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% elif perms.extras.view_objectchange %}
|
||||
<div class="alert alert-secondary mt-4" role="alert">
|
||||
No change history found.
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
<div class="alert alert-danger mt-4" role="alert">
|
||||
<strong>{{ request.user|truncatechars:"30" }}</strong> does not have
|
||||
permission to view changes.
|
||||
</div>
|
||||
{% endif %}
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load static %}
|
||||
{% load helpers %}
|
||||
{% load form_helpers %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load helpers %}
|
||||
|
||||
{% block header %}
|
||||
|
@ -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 %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load form_helpers %}
|
||||
|
||||
{% block title %}Create {{ component_type }}{% endblock %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load form_helpers %}
|
||||
|
||||
{% render_errors form %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load form_helpers %}
|
||||
|
||||
{% block title %}Add {{ component_type }} to {{ parent }}{% endblock %}
|
||||
|
@ -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 %}
|
||||
|
@ -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">
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load helpers %}
|
||||
{% load static %}
|
||||
|
||||
|
@ -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 %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load helpers %}
|
||||
{% load form_helpers %}
|
||||
|
||||
|
@ -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 %}
|
||||
|
@ -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 %}
|
||||
|
@ -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 %}
|
||||
|
@ -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 %}
|
||||
|
@ -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 %}
|
||||
|
@ -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>
|
||||
|
@ -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 %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load helpers %}
|
||||
|
||||
{% block title %}Reports{% endblock %}
|
||||
|
@ -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 %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load helpers %}
|
||||
|
||||
{% block title %}Scripts{% endblock %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load helpers %}
|
||||
{% load form_helpers %}
|
||||
{% load log_levels %}
|
||||
|
@ -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>
|
||||
|
@ -1,42 +0,0 @@
|
||||
<footer class="footer mt-auto bg-light p-3 text-center">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col d-flex flex-column justify-content-center">
|
||||
<span class="text-muted">
|
||||
{{ settings.HOSTNAME }} (v{{ settings.VERSION }})
|
||||
</span>
|
||||
</div>
|
||||
<div class="col d-flex flex-column justify-content-center">
|
||||
<span class="text-muted">{% now 'Y-m-d H:i:s T' %}</span>
|
||||
</div>
|
||||
<div class="col d-flex flex-column justify-content-center">
|
||||
<nav class="nav">
|
||||
<a
|
||||
class="nav-link"
|
||||
href="https://netbox.readthedocs.io/"
|
||||
target="_blank"
|
||||
>
|
||||
<i class="mdi mdi-book-open-page-variant text-primary"></i> Docs
|
||||
</a>
|
||||
<a class="nav-link" href="{% url 'api_docs' %}" target="_blank">
|
||||
<i class="mdi mdi-cloud-braces text-primary"></i> API
|
||||
</a>
|
||||
<a
|
||||
class="nav-link"
|
||||
href="https://github.com/netbox-community/netbox"
|
||||
target="_blank"
|
||||
>
|
||||
<i class="mdi mdi-xml text-primary"></i> Code
|
||||
</a>
|
||||
<a
|
||||
class="nav-link"
|
||||
href="https://github.com/netbox-community/netbox/wiki"
|
||||
target="_blank"
|
||||
>
|
||||
<i class="mdi mdi-lifebuoy text-primary"></i> Help
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
@ -1,22 +1,22 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load buttons %}
|
||||
{% load custom_links %}
|
||||
{% load helpers %}
|
||||
{% load perms %}
|
||||
{% load plugins %}
|
||||
|
||||
{% block header %}
|
||||
{# Breadcrumbs #}
|
||||
<nav class="breadcrumb-container" aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
{% block breadcrumbs %}{% endblock %}
|
||||
</ol>
|
||||
</nav>
|
||||
{{ block.super }}
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}{{ object }}{% endblock %}
|
||||
|
||||
{% block breadcrumb_main %}
|
||||
<nav class="breadcrumb-container" aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="/">Home</a></li>
|
||||
{% block breadcrumbs %}{%endblock%}
|
||||
</ol>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
|
||||
{% block controls %}
|
||||
<div class="controls mb-2 mx-0">
|
||||
<div class="d-flex flex-wrap justify-content-end">
|
||||
@ -34,15 +34,15 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock controls %}
|
||||
|
||||
{% block tabs %}
|
||||
<ul class="nav nav-tabs mb-3">
|
||||
{% block tab_items %}
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link{% if not active_tab %} active{% endif %}" href="{{ object.get_absolute_url }}">{{ object|meta:"verbose_name"|bettertitle }}</a>
|
||||
</li>
|
||||
{% endblock %}
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link{% if not active_tab %} active{% endif %}" href="{{ object.get_absolute_url }}">{{ object|meta:"verbose_name"|bettertitle }}</a>
|
||||
</li>
|
||||
{% endblock tab_items %}
|
||||
{% if perms.extras.view_journalentry %}
|
||||
{% with journal_viewname=object|viewname:'journal' %}
|
||||
{% url journal_viewname pk=object.pk as journal_url %}
|
||||
@ -62,7 +62,7 @@
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
{% endblock tabs %}
|
||||
|
||||
{% block content %}
|
||||
<p>
|
||||
@ -72,5 +72,5 @@
|
||||
</small>
|
||||
<span class="badge bg-primary">{{ object|meta:"app_label" }}.{{ object|meta:"model_name" }}:{{ object.pk }}</span>
|
||||
</p>
|
||||
{% endblock %}
|
||||
{% endblock content %}
|
||||
{% block components %}{% endblock %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load form_helpers %}
|
||||
|
||||
{% block title %}Add {{ model_name|title }}{% endblock %}
|
||||
@ -37,4 +37,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
{% endblock content %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load helpers %}
|
||||
|
||||
{% block title %}Delete {{ table.rows|length }} {{ obj_type_plural|bettertitle }}?{% endblock %}
|
||||
@ -39,4 +39,4 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock content %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load helpers %}
|
||||
{% load form_helpers %}
|
||||
|
||||
@ -42,4 +42,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
{% endblock content %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load helpers %}
|
||||
{% load form_helpers %}
|
||||
|
||||
@ -127,4 +127,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock content %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load helpers %}
|
||||
|
||||
{% block title %}Remove {{ table.rows|length }} {{ obj_type_plural|bettertitle }}?{% endblock %}
|
||||
@ -37,4 +37,4 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock content %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load helpers %}
|
||||
{% load form_helpers %}
|
||||
|
||||
@ -47,4 +47,4 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock content %}
|
||||
|
@ -4,6 +4,6 @@
|
||||
{% block title %}Delete {{ obj_type }}?{% endblock %}
|
||||
|
||||
{% block message %}
|
||||
<p>Are you sure you want to delete {{ obj_type }} <strong>{{ obj }}</strong>?</p>
|
||||
{% block message_extra %}{% endblock %}
|
||||
{% endblock %}
|
||||
<p>Are you sure you want to delete {{ obj_type }} <strong>{{ obj }}</strong>?</p>
|
||||
{% block message_extra %}{% endblock %}
|
||||
{% endblock message %}
|
||||
|
@ -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 %}
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
<i class="mdi mdi-help-circle"></i>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% endblock controls %}
|
||||
|
||||
{% block content %}
|
||||
<form action="" method="post" enctype="multipart/form-data">
|
||||
@ -47,7 +47,7 @@
|
||||
{% block form_fields %}{% render_form form %}{% endblock %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% endblock form %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row my-3">
|
||||
@ -66,11 +66,11 @@
|
||||
Create
|
||||
</button>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% endblock buttons %}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% if obj and settings.DOCS_ROOT %}
|
||||
{% include 'inc/modal.html' with name='docs' content=obj|get_docs %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% endblock content %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load helpers %}
|
||||
{% load form_helpers %}
|
||||
|
||||
@ -22,4 +22,4 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock content %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load buttons %}
|
||||
{% load helpers %}
|
||||
{% load render_table from django_tables2 %}
|
||||
@ -21,7 +21,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock controls %}
|
||||
|
||||
{% block content %}
|
||||
{% if table.paginator.num_pages > 1 %}
|
||||
@ -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 %}
|
||||
@ -111,4 +111,4 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
{% table_config_form table table_name="ObjectTable" %}
|
||||
{% endblock %}
|
||||
{% endblock content %}
|
||||
|
@ -1,56 +1,100 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load get_status %}
|
||||
{% load helpers %}
|
||||
|
||||
{% block title_container %}{% endblock %}
|
||||
{% block header %}{% endblock %}
|
||||
{% block title %}Home{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="stats-container">
|
||||
<div class="row masonry">
|
||||
{% for section in stats %}
|
||||
<div class="col col-sm-12 col-md-4 my-2 masonry-item">
|
||||
<div class="card">
|
||||
<h5 class="card-header text-primary">{{ section.label }}</h5>
|
||||
<div class="card-body">
|
||||
<div class="list-group list-group-flush">
|
||||
{% for item in section.items %}
|
||||
<a href="{% url item.url %}" class="list-group-item list-group-item-action{% if item.disabled %} disabled{% endif %}">
|
||||
<div class="d-flex w-100 justify-content-between align-items-center">
|
||||
<div class="d-flex flex-column align-items-start">
|
||||
<h6 class="mb-1">{{ item.label }}</h6>
|
||||
{% if item.description %}
|
||||
<small class="mb-1 text-muted">{{ item.description }}</small>
|
||||
{% endif %}
|
||||
|
||||
{# General stats #}
|
||||
<div class="stats-container">
|
||||
<div class="row masonry">
|
||||
{% for section in stats %}
|
||||
<div class="col col-sm-12 col-md-4 my-2 masonry-item">
|
||||
<div class="card">
|
||||
<h5 class="card-header text-primary">{{ section.label }}</h5>
|
||||
<div class="card-body">
|
||||
<div class="list-group list-group-flush">
|
||||
{% for item in section.items %}
|
||||
<a href="{% url item.url %}" class="list-group-item list-group-item-action{% if item.disabled %} disabled{% endif %}">
|
||||
<div class="d-flex w-100 justify-content-between align-items-center">
|
||||
<div class="d-flex flex-column align-items-start">
|
||||
<h6 class="mb-1">{{ item.label }}</h6>
|
||||
{% if item.description %}
|
||||
<small class="mb-1 text-muted">{{ item.description }}</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
<span class="badge stat-badge rounded-pill">
|
||||
{% if item.count == None %}
|
||||
<i class="mdi mdi-lock"></i>
|
||||
{% else %}
|
||||
{{ item.count }}
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
<span class="badge stat-badge rounded-pill">
|
||||
{% if item.count == None %}
|
||||
<i class="mdi mdi-lock"></i>
|
||||
{% else %}
|
||||
{{ item.count }}
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="display-4 font-weight-normal text-primary">
|
||||
{{ item.count }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="display-4 font-weight-normal text-primary">
|
||||
{{ item.count }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row my-4 flex-grow-1 changelog-container">
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<h4 class="card-header">Changelog</h4>
|
||||
<div class="card-body">
|
||||
{% include 'changelog.html' %}
|
||||
{# Changelog #}
|
||||
<div class="row my-4 flex-grow-1 changelog-container">
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<h4 class="card-header">Changelog</h4>
|
||||
<div class="card-body">
|
||||
{% if changelog and perms.extras.view_objectchange %}
|
||||
{# TODO: Replace this with a django-tables2 Table #}
|
||||
<table class="table align-middle table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">User</th>
|
||||
<th scope="col">Action</th>
|
||||
<th scope="col">Type</th>
|
||||
<th scope="col">Object</th>
|
||||
<th scope="col">Time</th>
|
||||
<th scope="col" align="right"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for change in changelog %}
|
||||
<tr class="{% get_status change.get_action_display %}">
|
||||
<th scope="row">{{ change.user|default:change.user_name }}</th>
|
||||
<td>{{ change.get_action_display|bettertitle }}</td>
|
||||
<td>{{ change.changed_object_type.name|bettertitle }}</td>
|
||||
<td>
|
||||
{% if change.changed_object.get_absolute_url %}
|
||||
<a class="text-body" href="{{ change.changed_object.get_absolute_url }}">{{ change.changed_object }}</a>
|
||||
{% else %} {{ change.changed_object|default:change.object_repr }} {% endif %}
|
||||
</td>
|
||||
|
||||
<td>{{ change.time|date:'SHORT_DATETIME_FORMAT' }}</td>
|
||||
<td>
|
||||
<a role="button" class="text-body" href="{{ change.get_absolute_url }}">
|
||||
<i class="mdi mdi-dots-horizontal" data-bs-toggle="tooltip" data-bs-placement="left" title="View Change Details"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% elif perms.extras.view_objectchange %}
|
||||
<div class="alert alert-secondary mt-4" role="alert">
|
||||
No change history found.
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock content %}
|
||||
|
@ -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 %}
|
||||
@ -11,4 +11,4 @@
|
||||
<span class="mdi mdi-database-import-outline" aria-hidden="true"></span>
|
||||
Import More
|
||||
</a>
|
||||
{% endblock %}
|
||||
{% endblock content %}
|
||||
|
@ -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 %}
|
||||
|
@ -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>
|
||||
|
@ -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 %}
|
||||
|
@ -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>
|
||||
|
@ -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 %}
|
||||
|
@ -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 %}
|
||||
|
@ -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>
|
||||
|
@ -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">
|
||||
|
@ -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 %}
|
||||
|
@ -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 %}
|
||||
|
@ -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>
|
||||
|
@ -1,81 +0,0 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load search_options %}
|
||||
|
||||
{% block head %}{% endblock %}
|
||||
|
||||
{% block layout %}
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<main class="col-md-9 ms-sm-auto col-lg-10 px-0">
|
||||
<nav id="sidebar-menu" class="col-md-3 col-lg-2 d-md-block sidebar collapse px-0">
|
||||
<div class="position-sticky pt-3">
|
||||
<a class="px-2 sidebar-logo d-none d-md-flex" href="{% url 'home' %}">
|
||||
{% load static %}
|
||||
{% include 'logo.html' %}
|
||||
</a>
|
||||
<ul class="nav flex-column">
|
||||
<div class="d-block d-md-none mx-1 my-3 search-container">
|
||||
{% search_options %}
|
||||
</div>
|
||||
<div class="d-flex d-md-none mx-1 my-3 justify-content-end">
|
||||
{% include './profile_button.html' %}
|
||||
</div>
|
||||
{% load nav %} {% nav %}
|
||||
</ul>
|
||||
</div>
|
||||
{% include './bottom.html' %}
|
||||
</nav>
|
||||
<nav class="navbar navbar-light sticky-top flex-md-nowrap py-4 search container-fluid">
|
||||
<div class="d-md-none w-100 d-flex justify-content-between align-items-center my-3">
|
||||
<a class="px-2 sidebar-logo d-block d-md-none" href="{% url 'home' %}">
|
||||
{% include 'logo.html' %}
|
||||
</a>
|
||||
<button
|
||||
type="button"
|
||||
aria-expanded="false"
|
||||
data-bs-toggle="collapse"
|
||||
aria-controls="sidebar-menu"
|
||||
data-bs-target="#sidebar-menu"
|
||||
aria-label="Toggle Navigation"
|
||||
class="navbar-toggler position-relative collapsed"
|
||||
>
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="d-none d-md-flex w-100 search-container">
|
||||
{% search_options %}
|
||||
{% include './profile_button.html' %}
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="px-4 content-container">
|
||||
{% block title_container %}
|
||||
<div class="title-container">
|
||||
<div id="content-title">
|
||||
<h1 class="h2 w-100">{% block title %}{% endblock %}</h1>
|
||||
{% block breadcrumb_main %}{% endblock %}
|
||||
</div>
|
||||
|
||||
{% block controls %}{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
<div id="content" class="container-fluid p-0 m-0">
|
||||
{% block tabs %}{% endblock %}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
<footer class="footer container-fluid pb-3 pt-4 px-0">
|
||||
<div class="row align-items-center justify-content-end">
|
||||
<div class="col-auto d-none d-md-block"></div>
|
||||
<div class="col text-center text-md-end small text-muted">
|
||||
<span class="fw-light d-block d-md-inline">{% now 'Y-m-d H:i:s T' %}</span>
|
||||
<span class="ms-md-3 d-block d-md-inline">{{ settings.HOSTNAME }} (v{{ settings.VERSION }})</span>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block javascript %}{% endblock %}
|
||||
{% block data %}{% endblock %}
|
@ -1,53 +1,58 @@
|
||||
{% extends 'base.html' %} {% load static %} {% block layout %}
|
||||
<main class="login-container text-center">
|
||||
{% if settings.BANNER_LOGIN %}
|
||||
<div class="alert alert-secondary" role="alert">
|
||||
{{ settings.BANNER_LOGIN|safe }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="form-login">
|
||||
<form action="{% url 'login' %}" method="post">
|
||||
<div class="mb-4">
|
||||
{% include 'logo.html' with height=80 %}
|
||||
{# User login page. Extends base.html directly to override normal UI layout. #}
|
||||
{% extends 'base/base.html' %}
|
||||
{% load form_helpers %}
|
||||
{% load static %}
|
||||
|
||||
{% block layout %}
|
||||
<main class="login-container text-center">
|
||||
|
||||
{# Login banner #}
|
||||
{% if settings.BANNER_LOGIN %}
|
||||
<div class="alert alert-secondary" role="alert">
|
||||
{{ settings.BANNER_LOGIN|safe }}
|
||||
</div>
|
||||
{% csrf_token %} {% if 'next' in request.GET %}
|
||||
<input type="hidden" name="next" value="{{ request.GET.next }}" />
|
||||
{% endif %} {% if 'next' in request.POST %}
|
||||
<input type="hidden" name="next" value="{{ request.POST.next }}" />
|
||||
{% endif %}
|
||||
<input
|
||||
required
|
||||
type="text"
|
||||
placeholder="Username"
|
||||
name="username"
|
||||
maxlength="150"
|
||||
id="id_username"
|
||||
class="form-control"
|
||||
/>
|
||||
<input
|
||||
required
|
||||
type="password"
|
||||
placeholder="Password"
|
||||
name="password"
|
||||
id="id_password"
|
||||
class="form-control"
|
||||
/>
|
||||
<button type="submit" class="btn btn-primary btn-lg w-100 mt-4">
|
||||
Sign In
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{% load form_helpers %} {% if form.non_field_errors %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<h4 class="alert-heading">Errors</h4>
|
||||
<p>
|
||||
{{ form.non_field_errors }}
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</main>
|
||||
<footer class="footer container-fluid login-footer py-3">
|
||||
<div class="row align-items-center">
|
||||
{% endif %}
|
||||
|
||||
{# Login form #}
|
||||
<div class="form-login">
|
||||
<form action="{% url 'login' %}" method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
{# Logo #}
|
||||
<div class="mb-4">
|
||||
<img src="{% static 'netbox_logo.svg' %}" height="80" alt="NetBox logo" />
|
||||
</div>
|
||||
|
||||
{# Set post-login URL #}
|
||||
{% if 'next' in request.GET %}
|
||||
<input type="hidden" name="next" value="{{ request.GET.next }}" />
|
||||
{% endif %} {% if 'next' in request.POST %}
|
||||
<input type="hidden" name="next" value="{{ request.POST.next }}" />
|
||||
{% endif %}
|
||||
|
||||
{{ form.username }}
|
||||
{{ form.password }}
|
||||
|
||||
<button type="submit" class="btn btn-primary btn-lg w-100 mt-4">
|
||||
Sign In
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{# Login form errors #}
|
||||
{% if form.non_field_errors %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<h4 class="alert-heading">Errors</h4>
|
||||
<p>
|
||||
{{ form.non_field_errors }}
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</main>
|
||||
|
||||
{# Page footer #}
|
||||
<footer class="footer container-fluid login-footer py-3">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-2 col-md-1 mb-0">
|
||||
<button type="button" class="btn btn-sm color-mode-toggle" title="Toggle Color Mode">
|
||||
<i class="color-mode-icon mdi mdi-lightbulb"></i>
|
||||
@ -59,6 +64,7 @@
|
||||
{{ settings.HOSTNAME }} (v{{ settings.VERSION }})
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
{% endblock %}
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
{% endblock layout %}
|
||||
|
@ -1,21 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1100 320" height="{{ height|default:50 }}">
|
||||
<g id="netbox-logo-1">
|
||||
<circle cx="37" cy="284" r="23"/>
|
||||
<circle cx="101" cy="37" r="23"/>
|
||||
<circle cx="101" cy="220" r="23"/>
|
||||
<circle cx="284" cy="220" r="23"/>
|
||||
<rect x="93" y="37" width="16" height="180"/>
|
||||
<rect x="101" y="212" width="180" height="16"/>
|
||||
<rect x="93" y="212" width="16" height="90" transform="rotate(45 101 220)"/>
|
||||
</g>
|
||||
<g id="netbox-logo-2">
|
||||
<circle cx="284" cy="37" r="23"/>
|
||||
<circle cx="37" cy="101" r="23"/>
|
||||
<circle cx="220" cy="101" r="23"/>
|
||||
<circle cx="220" cy="284" r="23"/>
|
||||
<rect x="37" y="93" width="180" height="16"/>
|
||||
<rect x="212" y="101" width="16" height="180"/>
|
||||
<rect x="212" y="93" width="16" height="90" transform="rotate(225 220 101)"/>
|
||||
<path transform="translate(380, 8)" d="M13.60 200L13.60 104L36.40 104L36.40 119.40L36.80 119.40Q40.20 112.20 47.20 106.90Q54.20 101.60 66.20 101.60L66.20 101.60Q75.80 101.60 82.50 104.80Q89.20 108 93.40 113.20Q97.60 118.40 99.40 125.20Q101.20 132 101.20 139.40L101.20 139.40L101.20 200L77.20 200L77.20 151.40Q77.20 147.40 76.80 142.50Q76.40 137.60 74.70 133.30Q73 129 69.40 126.10Q65.80 123.20 59.60 123.20L59.60 123.20Q53.60 123.20 49.50 125.20Q45.40 127.20 42.70 130.60Q40 134 38.80 138.40Q37.60 142.80 37.60 147.60L37.60 147.60L37.60 200L13.60 200ZM224.80 160.40L151.60 160.40Q152.80 171.20 160 177.20Q167.20 183.20 177.40 183.20L177.40 183.20Q186.40 183.20 192.50 179.50Q198.60 175.80 203.20 170.20L203.20 170.20L220.40 183.20Q212 193.60 201.60 198Q191.20 202.40 179.80 202.40L179.80 202.40Q169 202.40 159.40 198.80Q149.80 195.20 142.80 188.60Q135.80 182 131.70 172.70Q127.60 163.40 127.60 152L127.60 152Q127.60 140.60 131.70 131.30Q135.80 122 142.80 115.40Q149.80 108.80 159.40 105.20Q169 101.60 179.80 101.60L179.80 101.60Q189.80 101.60 198.10 105.10Q206.40 108.60 212.30 115.20Q218.20 121.80 221.50 131.50Q224.80 141.20 224.80 153.80L224.80 153.80L224.80 160.40ZM151.60 142.40L200.80 142.40Q200.60 131.80 194.20 125.70Q187.80 119.60 176.40 119.60L176.40 119.60Q165.60 119.60 159.30 125.80Q153 132 151.60 142.40L151.60 142.40ZM259.80 124.40L240.00 124.40L240.00 104L259.80 104L259.80 76.20L283.80 76.20L283.80 104L310.20 104L310.20 124.40L283.80 124.40L283.80 166.40Q283.80 173.60 286.50 177.80Q289.20 182 297.20 182L297.20 182Q300.40 182 304.20 181.30Q308 180.60 310.20 179L310.20 179L310.20 199.20Q306.40 201 300.90 201.70Q295.40 202.40 291.20 202.40L291.20 202.40Q281.60 202.40 275.50 200.30Q269.40 198.20 265.90 193.90Q262.40 189.60 261.10 183.20Q259.80 176.80 259.80 168.40L259.80 168.40L259.80 124.40ZM333.20 200L333.20 48.80L357.20 48.80L357.20 116.20L357.80 116.20Q359.60 113.80 362.40 111.30Q365.20 108.80 369.20 106.60Q373.20 104.40 378.40 103Q383.60 101.60 390.40 101.60L390.40 101.60Q400.60 101.60 409.20 105.50Q417.80 109.40 423.90 116.20Q430 123 433.40 132.20Q436.80 141.40 436.80 152L436.80 152Q436.80 162.60 433.60 171.80Q430.40 181 424.20 187.80Q418 194.60 409.20 198.50Q400.40 202.40 389.40 202.40L389.40 202.40Q379.20 202.40 370.40 198.40Q361.60 194.40 356.40 185.60L356.40 185.60L356 185.60L356 200L333.20 200ZM412.80 152L412.80 152Q412.80 146.40 410.90 141.20Q409 136 405.30 132Q401.60 128 396.40 125.60Q391.20 123.20 384.60 123.20L384.60 123.20Q378 123.20 372.80 125.60Q367.60 128 363.90 132Q360.20 136 358.30 141.20Q356.40 146.40 356.40 152L356.40 152Q356.40 157.60 358.30 162.80Q360.20 168 363.90 172Q367.60 176 372.80 178.40Q378 180.80 384.60 180.80L384.60 180.80Q391.20 180.80 396.40 178.40Q401.60 176 405.30 172Q409 168 410.90 162.80Q412.80 157.60 412.80 152ZM458.40 152L458.40 152Q458.40 140.60 462.50 131.30Q466.60 122 473.60 115.40Q480.60 108.80 490.20 105.20Q499.80 101.60 510.60 101.60L510.60 101.60Q521.40 101.60 531 105.20Q540.60 108.80 547.60 115.40Q554.60 122 558.70 131.30Q562.80 140.60 562.80 152L562.80 152Q562.80 163.40 558.70 172.70Q554.60 182 547.60 188.60Q540.60 195.20 531 198.80Q521.40 202.40 510.60 202.40L510.60 202.40Q499.80 202.40 490.20 198.80Q480.60 195.20 473.60 188.60Q466.60 182 462.50 172.70Q458.40 163.40 458.40 152ZM482.40 152L482.40 152Q482.40 157.60 484.30 162.80Q486.20 168 489.90 172Q493.60 176 498.80 178.40Q504 180.80 510.60 180.80L510.60 180.80Q517.20 180.80 522.40 178.40Q527.60 176 531.30 172Q535 168 536.90 162.80Q538.80 157.60 538.80 152L538.80 152Q538.80 146.40 536.90 141.20Q535 136 531.30 132Q527.60 128 522.40 125.60Q517.20 123.20 510.60 123.20L510.60 123.20Q504 123.20 498.80 125.60Q493.60 128 489.90 132Q486.20 136 484.30 141.20Q482.40 146.40 482.40 152ZM575.40 200L614 148.40L580.80 104L610 104L629.20 132.80L650 104L677.40 104L644.60 148.40L683.20 200L654 200L629 165.60L603.80 200L575.40 200Z"/>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 4.6 KiB |
@ -1,10 +1,4 @@
|
||||
{% extends 'rest_framework/base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block bootstrap_theme %}
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'bootstrap-3.4.1-dist/css/bootstrap.min.css' %}"/>
|
||||
<link rel="stylesheet" type="text/css" href="{% static "rest_framework/css/bootstrap-tweaks.css" %}"/>
|
||||
{% endblock %}
|
||||
|
||||
{% block branding %}
|
||||
<a class="navbar-brand" href="/{{ settings.BASE_PATH }}">NetBox</a>
|
||||
|
@ -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 %}
|
||||
@ -65,4 +65,4 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% endblock content %}
|
||||
|
@ -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>
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
|
||||
{% block title %}{% endblock %}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load form_helpers %}
|
||||
|
||||
{% block content %}
|
||||
|
@ -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>
|
||||
|
@ -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">
|
||||
|
@ -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>
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load helpers %}
|
||||
{% load form_helpers %}
|
||||
|
||||
|
@ -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">
|
||||
|
@ -6,12 +6,7 @@ from .models import Token
|
||||
|
||||
|
||||
class LoginForm(BootstrapMixin, AuthenticationForm):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
self.fields['username'].widget.attrs['placeholder'] = ''
|
||||
self.fields['password'].widget.attrs['placeholder'] = ''
|
||||
pass
|
||||
|
||||
|
||||
class PasswordChangeForm(BootstrapMixin, DjangoPasswordChangeForm):
|
||||
|
Reference in New Issue
Block a user