Преглед изворни кода

Add custom links to templates

Jeremy Stretch пре 6 година
родитељ
комит
dd58e78fde

+ 0 - 1
netbox/extras/constants.py

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

+ 4 - 0
netbox/templates/circuits/circuit.html

@@ -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>

+ 4 - 0
netbox/templates/circuits/provider.html

@@ -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>

+ 5 - 0
netbox/templates/dcim/cable.html

@@ -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>

+ 4 - 0
netbox/templates/dcim/devicetype.html

@@ -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>

+ 4 - 1
netbox/templates/dcim/powerfeed.html

@@ -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>

+ 4 - 1
netbox/templates/dcim/powerpanel.html

@@ -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>

+ 4 - 0
netbox/templates/dcim/rack.html

@@ -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>

+ 4 - 0
netbox/templates/dcim/site.html

@@ -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>

+ 4 - 0
netbox/templates/ipam/aggregate.html

@@ -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>

+ 4 - 0
netbox/templates/ipam/ipaddress.html

@@ -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>

+ 4 - 0
netbox/templates/ipam/prefix.html

@@ -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>

+ 4 - 0
netbox/templates/ipam/service.html

@@ -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">

+ 4 - 0
netbox/templates/ipam/vlan.html

@@ -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>

+ 4 - 0
netbox/templates/ipam/vrf.html

@@ -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>

+ 4 - 0
netbox/templates/secrets/secret.html

@@ -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>

+ 4 - 0
netbox/templates/tenancy/tenant.html

@@ -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>

+ 4 - 0
netbox/templates/virtualization/cluster.html

@@ -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>

+ 4 - 0
netbox/templates/virtualization/virtualmachine.html

@@ -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>