netbox/netbox/templates/base/layout.html
2021-07-26 14:46:05 -07:00

120 lines
3.9 KiB
HTML

{# Base layout for the core NetBox UI w/navbar and page content #}
{% extends 'base/base.html' %}
{% load helpers %}
{% load nav %}
{% load search_options %}
{% load static %}
{% block layout %}
<div class="container-fluid px-0">
<main class="layout">
{# Sidebar #}
{% include 'base/sidebar.html' %}
{# Body #}
<div class="content-container">
{# Top bar #}
<nav class="navbar navbar-light sticky-top flex-md-nowrap ps-6 p-3 search container-fluid">
{# Mobile Navigation #}
<div class="d-md-none w-100 d-flex justify-content-between align-items-center my-3">
<a class="p-2 sidebar-logo d-block d-md-none" href="{% url 'home' %}">
<img src="{% static 'netbox_logo.svg' %}" alt="NetBox logo" width="100%" />
</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>
{# Desktop Navigation #}
<div class="d-none d-md-flex w-100 row search-container">
{# Empty spacer column to ensure search is centered. #}
<div class="col-3 d-flex flex-grow-1 ps-0"></div>
{# Search bar #}
<div class="col-6 d-flex flex-grow-1 justify-content-center">
{% search_options %}
</div>
{# Proflie/login button #}
<div class="col-3 d-flex flex-grow-1 pe-0 justify-content-end">
{% include 'inc/profile_button.html' %}
</div>
</div>
</nav>
{% if settings.BANNER_TOP %}
<div class="alert alert-info text-center mx-3" role="alert">
{{ settings.BANNER_TOP|safe }}
</div>
{% endif %}
{% if settings.MAINTENANCE_MODE %}
<div class="alert alert-warning text-center mx-3" role="alert">
<h4><i class="mdi mdi-alert"></i> Maintenance Mode</h4>
<span>NetBox is currently in maintenance mode. Functionality may be limited.</span>
</div>
{% endif %}
{# Page header #}
{% block header %}
<div class="title-container px-3 pb-3">
{# Title #}
<div id="content-title">
{# Center-align title in object-edit views #}
<h1 class="h2 w-100">{% block title %}{% endblock title %}</h1>
{% block subtitle %}{% endblock %}
</div>
{# Controls #}
{% block controls %}{% endblock controls %}
</div>
{% endblock header %}
{# Page content #}
<div id="content" class="container-fluid content px-0 m-0">
{% block tabs %}{% endblock %}
{% block content-wrapper %}
<div class="px-3">
{% block content %}{% endblock %}
</div>
{% endblock %}
</div>
{% if settings.BANNER_BOTTOM %}
<div class="alert alert-info text-center mx-3" role="alert">
{{ settings.BANNER_BOTTOM|safe }}
</div>
{% endif %}
{# Page footer #}
<footer class="footer container-fluid pb-3 pt-4 px-0">
<div class="row align-items-center justify-content-end mx-0">
<div class="col text-center small text-muted">
<span class="fw-light d-block d-md-inline">{% annotated_now %} {% now 'T' %}</span>
<span class="ms-md-3 d-block d-md-inline">{{ settings.HOSTNAME }} (v{{ settings.VERSION }})</span>
</div>
</div>
</footer>
</div>
</main>
</div>
{% endblock layout %}