mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Update templates to use "object" context var
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<div class="col-sm-8 col-md-9">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{% url 'extras:configcontext_list' %}">Config Contexts</a></li>
|
||||
<li>{{ configcontext }}</li>
|
||||
<li>{{ object }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="col-sm-4 col-md-3">
|
||||
@@ -25,7 +25,7 @@
|
||||
</div>
|
||||
<div class="pull-right noprint">
|
||||
{% if perms.extras.change_configcontext %}
|
||||
<a href="{% url 'extras:configcontext_edit' pk=configcontext.pk %}" class="btn btn-warning">
|
||||
<a href="{% url 'extras:configcontext_edit' pk=object.pk %}" class="btn btn-warning">
|
||||
<span class="mdi mdi-pencil" aria-hidden="true"></span>
|
||||
Edit this config context
|
||||
</a>
|
||||
@@ -33,15 +33,15 @@
|
||||
</div>
|
||||
<ul class="nav nav-tabs">
|
||||
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
|
||||
<a href="{{ configcontext.get_absolute_url }}">Config Context</a>
|
||||
<a href="{{ object.get_absolute_url }}">Config Context</a>
|
||||
</li>
|
||||
{% if perms.extras.view_objectchange %}
|
||||
<li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}>
|
||||
<a href="{% url 'extras:configcontext_changelog' pk=configcontext.pk %}">Change Log</a>
|
||||
<a href="{% url 'extras:configcontext_changelog' pk=object.pk %}">Change Log</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
<h1>{% block title %}{{ configcontext }}{% endblock %}</h1>
|
||||
<h1>{% block title %}{{ object }}{% endblock %}</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
@@ -55,23 +55,23 @@
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>
|
||||
{{ configcontext.name }}
|
||||
{{ object.name }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Weight</td>
|
||||
<td>
|
||||
{{ configcontext.weight }}
|
||||
{{ object.weight }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Description</td>
|
||||
<td>{{ configcontext.description|placeholder }}</td>
|
||||
<td>{{ object.description|placeholder }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Active</td>
|
||||
<td>
|
||||
{% if configcontext.is_active %}
|
||||
{% if object.is_active %}
|
||||
<span class="text-success">
|
||||
<i class="mdi mdi-check-bold"></i>
|
||||
</span>
|
||||
@@ -92,9 +92,9 @@
|
||||
<tr>
|
||||
<td>Regions</td>
|
||||
<td>
|
||||
{% if configcontext.regions.all %}
|
||||
{% if object.regions.all %}
|
||||
<ul>
|
||||
{% for region in configcontext.regions.all %}
|
||||
{% for region in object.regions.all %}
|
||||
<li><a href="{{ region.get_absolute_url }}">{{ region }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@@ -106,9 +106,9 @@
|
||||
<tr>
|
||||
<td>Sites</td>
|
||||
<td>
|
||||
{% if configcontext.sites.all %}
|
||||
{% if object.sites.all %}
|
||||
<ul>
|
||||
{% for site in configcontext.sites.all %}
|
||||
{% for site in object.sites.all %}
|
||||
<li><a href="{{ site.get_absolute_url }}">{{ site }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@@ -120,9 +120,9 @@
|
||||
<tr>
|
||||
<td>Roles</td>
|
||||
<td>
|
||||
{% if configcontext.roles.all %}
|
||||
{% if object.roles.all %}
|
||||
<ul>
|
||||
{% for role in configcontext.roles.all %}
|
||||
{% for role in object.roles.all %}
|
||||
<li><a href="{% url 'dcim:device_list' %}?role={{ role.slug }}">{{ role }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@@ -134,9 +134,9 @@
|
||||
<tr>
|
||||
<td>Platforms</td>
|
||||
<td>
|
||||
{% if configcontext.platforms.all %}
|
||||
{% if object.platforms.all %}
|
||||
<ul>
|
||||
{% for platform in configcontext.platforms.all %}
|
||||
{% for platform in object.platforms.all %}
|
||||
<li><a href="{{ platform.get_absolute_url }}">{{ platform }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@@ -148,9 +148,9 @@
|
||||
<tr>
|
||||
<td>Cluster Groups</td>
|
||||
<td>
|
||||
{% if configcontext.cluster_groups.all %}
|
||||
{% if object.cluster_groups.all %}
|
||||
<ul>
|
||||
{% for cluster_group in configcontext.cluster_groups.all %}
|
||||
{% for cluster_group in object.cluster_groups.all %}
|
||||
<li><a href="{{ cluster_group.get_absolute_url }}">{{ cluster_group }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@@ -162,9 +162,9 @@
|
||||
<tr>
|
||||
<td>Clusters</td>
|
||||
<td>
|
||||
{% if configcontext.clusters.all %}
|
||||
{% if object.clusters.all %}
|
||||
<ul>
|
||||
{% for cluster in configcontext.clusters.all %}
|
||||
{% for cluster in object.clusters.all %}
|
||||
<li><a href="{{ cluster.get_absolute_url }}">{{ cluster }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@@ -176,9 +176,9 @@
|
||||
<tr>
|
||||
<td>Tenant Groups</td>
|
||||
<td>
|
||||
{% if configcontext.tenant_groups.all %}
|
||||
{% if object.tenant_groups.all %}
|
||||
<ul>
|
||||
{% for tenant_group in configcontext.tenant_groups.all %}
|
||||
{% for tenant_group in object.tenant_groups.all %}
|
||||
<li><a href="{{ tenant_group.get_absolute_url }}">{{ tenant_group }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@@ -190,9 +190,9 @@
|
||||
<tr>
|
||||
<td>Tenants</td>
|
||||
<td>
|
||||
{% if configcontext.tenants.all %}
|
||||
{% if object.tenants.all %}
|
||||
<ul>
|
||||
{% for tenant in configcontext.tenants.all %}
|
||||
{% for tenant in object.tenants.all %}
|
||||
<li><a href="{{ tenant.get_absolute_url }}">{{ tenant }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@@ -204,9 +204,9 @@
|
||||
<tr>
|
||||
<td>Tags</td>
|
||||
<td>
|
||||
{% if configcontext.tags.all %}
|
||||
{% if object.tags.all %}
|
||||
<ul>
|
||||
{% for tag in configcontext.tags.all %}
|
||||
{% for tag in object.tags.all %}
|
||||
<li><a href="{{ tag.get_absolute_url }}">{{ tag }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@@ -225,7 +225,7 @@
|
||||
{% include 'extras/inc/configcontext_format.html' %}
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{% include 'extras/inc/configcontext_data.html' with data=configcontext.data format=format %}
|
||||
{% include 'extras/inc/configcontext_data.html' with data=object.data format=format %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user