1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Files
netbox-community-netbox/netbox/templates/base/layout.html

152 lines
5.6 KiB
HTML
Raw Normal View History

{# Base layout for the core NetBox UI w/navbar and page content #}
{% extends 'base/base.html' %}
2021-07-06 12:10:29 -04:00
{% load helpers %}
{% load nav %}
{% load search_options %}
{% load static %}
{% block layout %}
2021-07-29 17:33:10 -07:00
2021-07-10 21:30:55 -04:00
<div class="container-fluid px-0">
2021-07-26 14:46:05 -07:00
<main class="layout">
2021-06-22 17:20:17 -07:00
{# Sidebar #}
2021-07-29 17:33:10 -07:00
{% include 'base/sidenav.html' %}
2021-06-22 17:20:17 -07:00
{# Body #}
<div class="content-container">
2021-06-22 17:20:17 -07:00
{# Top bar #}
2021-07-26 14:46:05 -07:00
<nav class="navbar navbar-light sticky-top flex-md-nowrap ps-6 p-3 search container-fluid">
2021-07-29 17:33:10 -07:00
2021-07-26 14:46:05 -07:00
{# Mobile Navigation #}
<div class="d-md-none w-100 d-flex justify-content-between align-items-center my-3">
2021-06-23 10:57:09 -07:00
<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>
2021-07-29 17:33:10 -07:00
<button type="button" aria-label="Toggle Navigation" class="navbar-toggler sidenav-toggle-mobile">
2021-06-22 17:20:17 -07:00
<span class="navbar-toggler-icon"></span>
</button>
</div>
2021-07-26 14:46:05 -07:00
{# 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>
2021-06-22 17:20:17 -07:00
</div>
2021-07-29 17:33:10 -07:00
</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 %}
2021-06-22 17:20:17 -07:00
{# Page header #}
{% block header %}
2021-07-10 22:06:28 -04:00
<div class="title-container px-3 pb-3">
2021-06-22 17:20:17 -07:00
{# Title #}
<div id="content-title">
{# Center-align title in object-edit views #}
2021-07-12 10:57:26 -04:00
<h1 class="h2 w-100">{% block title %}{% endblock title %}</h1>
{% block subtitle %}{% endblock %}
2021-06-22 17:20:17 -07:00
</div>
2021-06-22 17:20:17 -07:00
{# Controls #}
{% block controls %}{% endblock controls %}
2021-06-22 17:20:17 -07:00
</div>
{% endblock header %}
2021-06-22 17:20:17 -07:00
{# Page content #}
<div id="content" class="container-fluid content px-0 m-0">
{% block tabs %}{% endblock %}
2021-07-21 09:24:43 -04:00
{% block content-wrapper %}
<div class="px-3">
{% block content %}{% endblock %}
</div>
{% endblock %}
2021-06-22 17:20:17 -07:00
</div>
{% if settings.BANNER_BOTTOM %}
<div class="alert alert-info text-center mx-3" role="alert">
{{ settings.BANNER_BOTTOM|safe }}
</div>
{% endif %}
2021-06-22 17:20:17 -07:00
{# Page footer #}
<footer class="footer container-fluid pb-3 pt-4 px-0">
2021-07-29 17:33:10 -07:00
<div class="row align-items-center justify-content-between mx-0">
{# Docs & Community Links #}
<div class="col">
<nav class="nav justify-content-start">
{# Documentation #}
<a type="button" class="nav-link" href="{% static 'docs/' %}" target="_blank">
<i title="Docs" class="mdi mdi-book-open-variant text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
</a>
{# REST API #}
<a type="button" class="nav-link" href="{% url 'api-root' %}" target="_blank">
<i title="REST API" class="mdi mdi-code-braces text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
</a>
{# API docs #}
<a type="button" class="nav-link" href="{% url 'api_docs' %}" target="_blank">
<i title="REST API documentation" class="mdi mdi-book text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
</a>
{# GraphQL API #}
{% if settings.GRAPHQL_ENABLED %}
<a type="button" class="nav-link" href="{% url 'graphql' %}" target="_blank">
<i title="GraphQL API" class="mdi mdi-graphql text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
</a>
{% endif %}
{# GitHub #}
<a type="button" class="nav-link" href="https://github.com/netbox-community/netbox" target="_blank">
<i title="Source Code" class="mdi mdi-github text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
</a>
{# NetDev Slack #}
<a type="button" class="nav-link" href="https://netdev.chat/" target="_blank">
<i title="Community" class="mdi mdi-slack text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
</a>
</nav>
</div>
{# System Info #}
<div class="col text-end small text-muted">
2021-07-06 12:10:29 -04:00
<span class="fw-light d-block d-md-inline">{% annotated_now %} {% now 'T' %}</span>
2021-06-22 17:20:17 -07:00
<span class="ms-md-3 d-block d-md-inline">{{ settings.HOSTNAME }} (v{{ settings.VERSION }})</span>
</div>
2021-07-29 17:33:10 -07:00
2021-06-22 17:20:17 -07:00
</div>
</footer>
2021-06-22 17:20:17 -07:00
</div>
2021-06-22 17:20:17 -07:00
</main>
</div>
{% endblock layout %}