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

Add custom links to templates

This commit is contained in:
Jeremy Stretch
2019-04-15 21:38:04 -04:00
parent 2ec7ac1ea3
commit dd58e78fde
19 changed files with 73 additions and 3 deletions

View File

@ -46,7 +46,6 @@ CUSTOM_LINK_MODELS = [
'dcim.powerfeed',
'dcim.rack',
'dcim.site',
'dcim.region',
'ipam.aggregate',
'ipam.ipaddress',
'ipam.prefix',

View File

@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}
{% block title %}{{ circuit }}{% endblock %}
@ -41,6 +42,9 @@
</div>
<h1>{{ circuit }}</h1>
{% include 'inc/created_updated.html' with obj=circuit %}
<div class="pull-right noprint">
{% custom_links circuit %}
</div>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ circuit.get_absolute_url }}">Circuit</a>

View File

@ -1,5 +1,6 @@
{% extends '_base.html' %}
{% load static %}
{% load custom_links %}
{% load helpers %}
{% block title %}{{ provider }}{% endblock %}
@ -47,6 +48,9 @@
</div>
<h1>{{ provider }}</h1>
{% include 'inc/created_updated.html' with obj=provider %}
<div class="pull-right noprint">
{% custom_links provider %}
</div>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ provider.get_absolute_url }}">Provider</a>

View File

@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}
{% block header %}
@ -23,6 +24,10 @@
{% endif %}
</div>
<h1>{% block title %}Cable {{ cable }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=cable %}
<div class="pull-right noprint">
{% custom_links cable %}
</div>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ cable.get_absolute_url }}">Cable</a>

View File

@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}
{% block title %}{{ devicetype.manufacturer }} {{ devicetype.model }}{% endblock %}
@ -46,6 +47,9 @@
{% endif %}
<h1>{{ devicetype.manufacturer }} {{ devicetype.model }}</h1>
{% include 'inc/created_updated.html' with obj=devicetype %}
<div class="pull-right noprint">
{% custom_links devicetype %}
</div>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ devicetype.get_absolute_url }}">Device Type</a>

View File

@ -1,6 +1,6 @@
{% extends '_base.html' %}
{% load static %}
{% load tz %}
{% load custom_links %}
{% load helpers %}
{% block header %}
@ -45,6 +45,9 @@
</div>
<h1>{% block title %}{{ powerfeed }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=powerfeed %}
<div class="pull-right noprint">
{% custom_links powerfeed %}
</div>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ powerfeed.get_absolute_url }}">Cable</a>

View File

@ -1,6 +1,6 @@
{% extends '_base.html' %}
{% load static %}
{% load tz %}
{% load custom_links %}
{% load helpers %}
{% block header %}
@ -44,6 +44,9 @@
</div>
<h1>{% block title %}{{ powerpanel }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=powerpanel %}
<div class="pull-right noprint">
{% custom_links powerpanel %}
</div>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ powerpanel.get_absolute_url }}">Cable</a>

View File

@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}
{% block header %}
@ -43,6 +44,9 @@
</div>
<h1>{% block title %}Rack {{ rack }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=rack %}
<div class="pull-right noprint">
{% custom_links rack %}
</div>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ rack.get_absolute_url }}">Rack</a>

View File

@ -1,6 +1,7 @@
{% extends '_base.html' %}
{% load static %}
{% load tz %}
{% load custom_links %}
{% load helpers %}
{% block header %}
@ -52,6 +53,9 @@
</div>
<h1>{% block title %}{{ site }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=site %}
<div class="pull-right noprint">
{% custom_links site %}
</div>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ site.get_absolute_url }}">Site</a>

View File

@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}
{% block header %}
@ -39,6 +40,9 @@
</div>
<h1>{% block title %}{{ aggregate }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=aggregate %}
<div class="pull-right noprint">
{% custom_links aggregate %}
</div>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ aggregate.get_absolute_url }}">Aggregate</a>

View File

@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}
{% block header %}
@ -41,6 +42,9 @@
</div>
<h1>{% block title %}{{ ipaddress }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=ipaddress %}
<div class="pull-right noprint">
{% custom_links ipaddress %}
</div>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ ipaddress.get_absolute_url }}">IP Address</a>

View File

@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}
{% block header %}
@ -52,6 +53,9 @@
</div>
<h1>{% block title %}{{ prefix }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=prefix %}
<div class="pull-right noprint">
{% custom_links prefix %}
</div>
<ul class="nav nav-tabs" style="margin-bottom: 20px">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{% url 'ipam:prefix' pk=prefix.pk %}">Prefix</a>

View File

@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}
{% block content %}
@ -33,6 +34,9 @@
{% endif %}
<h1>{% block title %}{{ service }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=service %}
<div class="pull-right noprint">
{% custom_links service %}
</div>
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">

View File

@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}
{% block header %}
@ -44,6 +45,9 @@
</div>
<h1>{% block title %}VLAN {{ vlan.display_name }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=vlan %}
<div class="pull-right noprint">
{% custom_links vlan %}
</div>
<ul class="nav nav-tabs" style="margin-bottom: 20px">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{% url 'ipam:vlan' pk=vlan.pk %}">VLAN</a>

View File

@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}
{% block header %}
@ -38,6 +39,9 @@
</div>
<h1>{% block title %}VRF {{ vrf }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=vrf %}
<div class="pull-right noprint">
{% custom_links vrf %}
</div>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ vrf.get_absolute_url }}">VRF</a>

View File

@ -1,5 +1,6 @@
{% extends '_base.html' %}
{% load static %}
{% load custom_links %}
{% load helpers %}
{% load secret_helpers %}
@ -29,6 +30,9 @@
</div>
<h1>{% block title %}{{ secret }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=secret %}
<div class="pull-right noprint">
{% custom_links secret %}
</div>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ secret.get_absolute_url }}">Secret</a>

View File

@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}
{% block header %}
@ -41,6 +42,9 @@
</div>
<h1>{% block title %}{{ tenant }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=tenant %}
<div class="pull-right noprint">
{% custom_links tenant %}
</div>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ tenant.get_absolute_url }}">Tenant</a>

View File

@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}
{% block header %}
@ -41,6 +42,9 @@
</div>
<h1>{% block title %}{{ cluster }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=cluster %}
<div class="pull-right noprint">
{% custom_links cluster %}
</div>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ cluster.get_absolute_url }}">Cluster</a>

View File

@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}
{% block header %}
@ -40,6 +41,9 @@
</div>
<h1>{% block title %}{{ virtualmachine }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=virtualmachine %}
<div class="pull-right noprint">
{% custom_links virtualmachine %}
</div>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ virtualmachine.get_absolute_url }}">Virtual Machine</a>