1
0
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:
Jeremy Stretch
2020-11-19 12:24:52 -05:00
parent 3e7cf416f1
commit d5d87e0fdd
27 changed files with 611 additions and 611 deletions

View File

@@ -8,11 +8,11 @@
<div class="row noprint" xmlns="http://www.w3.org/1999/html">
<div class="col-sm-8 col-md-9">
<ol class="breadcrumb">
<li><a href="{{ cluster.type.get_absolute_url }}">{{ cluster.type }}</a></li>
{% if cluster.group %}
<li><a href="{{ cluster.group.get_absolute_url }}">{{ cluster.group }}</a></li>
<li><a href="{{ object.type.get_absolute_url }}">{{ object.type }}</a></li>
{% if object.group %}
<li><a href="{{ object.group.get_absolute_url }}">{{ object.group }}</a></li>
{% endif %}
<li>{{ cluster }}</li>
<li>{{ object }}</li>
</ol>
</div>
<div class="col-sm-4 col-md-3">
@@ -29,29 +29,29 @@
</div>
</div>
<div class="pull-right noprint">
{% plugin_buttons cluster %}
{% plugin_buttons object %}
{% if perms.virtualization.add_cluster %}
{% clone_button cluster %}
{% clone_button object %}
{% endif %}
{% if perms.virtualization.change_cluster %}
{% edit_button cluster %}
{% edit_button object %}
{% endif %}
{% if perms.virtualization.delete_cluster %}
{% delete_button cluster %}
{% delete_button object %}
{% endif %}
</div>
<h1>{% block title %}{{ cluster }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=cluster %}
<h1>{% block title %}{{ object }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=object %}
<div class="pull-right noprint">
{% custom_links cluster %}
{% custom_links object %}
</div>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ cluster.get_absolute_url }}">Cluster</a>
<a href="{{ object.get_absolute_url }}">Cluster</a>
</li>
{% if perms.extras.view_objectchange %}
<li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}>
<a href="{% url 'virtualization:cluster_changelog' pk=cluster.pk %}">Change Log</a>
<a href="{% url 'virtualization:cluster_changelog' pk=object.pk %}">Change Log</a>
</li>
{% endif %}
</ul>
@@ -67,17 +67,17 @@
<table class="table table-hover panel-body attr-table">
<tr>
<td>Name</td>
<td>{{ cluster.name }}</td>
<td>{{ object.name }}</td>
</tr>
<tr>
<td>Type</td>
<td><a href="{{ cluster.type.get_absolute_url }}">{{ cluster.type }}</a></td>
<td><a href="{{ object.type.get_absolute_url }}">{{ object.type }}</a></td>
</tr>
<tr>
<td>Group</td>
<td>
{% if cluster.group %}
<a href="{{ cluster.group.get_absolute_url }}">{{ cluster.group }}</a>
{% if object.group %}
<a href="{{ object.group.get_absolute_url }}">{{ object.group }}</a>
{% else %}
<span class="text-muted">None</span>
{% endif %}
@@ -86,8 +86,8 @@
<tr>
<td>Tenant</td>
<td>
{% if cluster.tenant %}
<a href="{{ cluster.tenant.get_absolute_url }}">{{ cluster.tenant }}</a>
{% if object.tenant %}
<a href="{{ object.tenant.get_absolute_url }}">{{ object.tenant }}</a>
{% else %}
<span class="text-muted">None</span>
{% endif %}
@@ -96,8 +96,8 @@
<tr>
<td>Site</td>
<td>
{% if cluster.site %}
<a href="{{ cluster.site.get_absolute_url }}">{{ cluster.site }}</a>
{% if object.site %}
<a href="{{ object.site.get_absolute_url }}">{{ object.site }}</a>
{% else %}
<span class="text-muted">None</span>
{% endif %}
@@ -105,25 +105,25 @@
</tr>
<tr>
<td>Virtual Machines</td>
<td><a href="{% url 'virtualization:virtualmachine_list' %}?cluster_id={{ cluster.pk }}">{{ cluster.virtual_machines.count }}</a></td>
<td><a href="{% url 'virtualization:virtualmachine_list' %}?cluster_id={{ object.pk }}">{{ object.virtual_machines.count }}</a></td>
</tr>
</table>
</div>
{% include 'inc/custom_fields_panel.html' with obj=cluster %}
{% include 'extras/inc/tags_panel.html' with tags=cluster.tags.all url='virtualization:cluster_list' %}
{% include 'inc/custom_fields_panel.html' with obj=object %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='virtualization:cluster_list' %}
<div class="panel panel-default">
<div class="panel-heading">
<strong>Comments</strong>
</div>
<div class="panel-body rendered-markdown">
{% if cluster.comments %}
{{ cluster.comments|render_markdown }}
{% if object.comments %}
{{ object.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}
</div>
</div>
{% plugin_left_page cluster %}
{% plugin_left_page object %}
</div>
<div class="col-md-7">
<div class="panel panel-default">
@@ -131,14 +131,14 @@
<strong>Host Devices</strong>
</div>
{% if perms.virtualization.change_cluster %}
<form action="{% url 'virtualization:cluster_remove_devices' pk=cluster.pk %}" method="post">
<form action="{% url 'virtualization:cluster_remove_devices' pk=object.pk %}" method="post">
{% csrf_token %}
{% endif %}
{% include 'responsive_table.html' with table=device_table %}
{% if perms.virtualization.change_cluster %}
<div class="panel-footer noprint">
<div class="pull-right">
<a href="{% url 'virtualization:cluster_add_devices' pk=cluster.pk %}?site={{ cluster.site.pk }}" class="btn btn-primary btn-xs">
<a href="{% url 'virtualization:cluster_add_devices' pk=object.pk %}?site={{ object.site.pk }}" class="btn btn-primary btn-xs">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span>
Add devices
</a>
@@ -151,12 +151,12 @@
</form>
{% endif %}
</div>
{% plugin_right_page cluster %}
{% plugin_right_page object %}
</div>
</div>
<div class="row">
<div class="col-md-12">
{% plugin_full_width_page cluster %}
{% plugin_full_width_page object %}
</div>
</div>
{% endblock %}