Skip to content

Commit

Permalink
Add custom links to templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Apr 16, 2019
1 parent 2ec7ac1 commit dd58e78
Show file tree
Hide file tree
Showing 19 changed files with 73 additions and 3 deletions.
1 change: 0 additions & 1 deletion netbox/extras/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
'dcim.powerfeed',
'dcim.rack',
'dcim.site',
'dcim.region',
'ipam.aggregate',
'ipam.ipaddress',
'ipam.prefix',
Expand Down
4 changes: 4 additions & 0 deletions netbox/templates/circuits/circuit.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}

{% block title %}{{ circuit }}{% endblock %}
Expand Down Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions netbox/templates/circuits/provider.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends '_base.html' %}
{% load static %}
{% load custom_links %}
{% load helpers %}

{% block title %}{{ provider }}{% endblock %}
Expand Down Expand Up @@ -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>
Expand Down
5 changes: 5 additions & 0 deletions netbox/templates/dcim/cable.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}

{% block header %}
Expand All @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions netbox/templates/dcim/devicetype.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}

{% block title %}{{ devicetype.manufacturer }} {{ devicetype.model }}{% endblock %}
Expand Down Expand Up @@ -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>
Expand Down
5 changes: 4 additions & 1 deletion netbox/templates/dcim/powerfeed.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends '_base.html' %}
{% load static %}
{% load tz %}
{% load custom_links %}
{% load helpers %}

{% block header %}
Expand Down Expand Up @@ -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>
Expand Down
5 changes: 4 additions & 1 deletion netbox/templates/dcim/powerpanel.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends '_base.html' %}
{% load static %}
{% load tz %}
{% load custom_links %}
{% load helpers %}

{% block header %}
Expand Down Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions netbox/templates/dcim/rack.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}

{% block header %}
Expand Down Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions netbox/templates/dcim/site.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends '_base.html' %}
{% load static %}
{% load tz %}
{% load custom_links %}
{% load helpers %}

{% block header %}
Expand Down Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions netbox/templates/ipam/aggregate.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}

{% block header %}
Expand Down Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions netbox/templates/ipam/ipaddress.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}

{% block header %}
Expand Down Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions netbox/templates/ipam/prefix.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}

{% block header %}
Expand Down Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions netbox/templates/ipam/service.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}

{% block content %}
Expand Down Expand Up @@ -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">
Expand Down
4 changes: 4 additions & 0 deletions netbox/templates/ipam/vlan.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}

{% block header %}
Expand Down Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions netbox/templates/ipam/vrf.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}

{% block header %}
Expand Down Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions netbox/templates/secrets/secret.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends '_base.html' %}
{% load static %}
{% load custom_links %}
{% load helpers %}
{% load secret_helpers %}

Expand Down Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions netbox/templates/tenancy/tenant.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}

{% block header %}
Expand Down Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions netbox/templates/virtualization/cluster.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}

{% block header %}
Expand Down Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions netbox/templates/virtualization/virtualmachine.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load custom_links %}
{% load helpers %}

{% block header %}
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit dd58e78

Please sign in to comment.