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

Standardize on "object" for ObjectView template context

This commit is contained in:
Jeremy Stretch
2020-11-19 11:29:18 -05:00
parent 11fa348575
commit e2d2ff8586
40 changed files with 588 additions and 627 deletions

View File

@@ -9,31 +9,31 @@
<div class="col-md-12">
<ol class="breadcrumb">
<li><a href="{% url 'dcim:cable_list' %}">Cables</a></li>
<li>{{ cable }}</li>
<li>{{ object }}</li>
</ol>
</div>
</div>
<div class="pull-right noprint">
{% plugin_buttons cable %}
{% plugin_buttons object %}
{% if perms.dcim.change_cable %}
{% edit_button cable %}
{% edit_button object %}
{% endif %}
{% if perms.dcim.delete_cable %}
{% delete_button cable %}
{% delete_button object %}
{% endif %}
</div>
<h1>{% block title %}Cable {{ cable }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=cable %}
<h1>{% block title %}Cable {{ object }}{% endblock %}</h1>
{% include 'inc/created_updated.html' with obj=object %}
<div class="pull-right noprint">
{% custom_links cable %}
{% custom_links object %}
</div>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ cable.get_absolute_url }}">Cable</a>
<a href="{{ object.get_absolute_url }}">Cable</a>
</li>
{% if perms.extras.view_objectchange %}
<li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}>
<a href="{% url 'dcim:cable_changelog' pk=cable.pk %}">Change Log</a>
<a href="{% url 'dcim:cable_changelog' pk=object.pk %}">Change Log</a>
</li>
{% endif %}
</ul>
@@ -49,23 +49,23 @@
<table class="table table-hover panel-body attr-table">
<tr>
<td>Type</td>
<td>{{ cable.get_type_display|placeholder }}</td>
<td>{{ object.get_type_display|placeholder }}</td>
</tr>
<tr>
<td>Status</td>
<td>
<span class="label label-{{ cable.get_status_class }}">{{ cable.get_status_display }}</span>
<span class="label label-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
</td>
</tr>
<tr>
<td>Label</td>
<td>{{ cable.label|placeholder }}</td>
<td>{{ object.label|placeholder }}</td>
</tr>
<tr>
<td>Color</td>
<td>
{% if cable.color %}
<span class="label color-block" style="background-color: #{{ cable.color }}">&nbsp;</span>
{% if object.color %}
<span class="label color-block" style="background-color: #{{ object.color }}">&nbsp;</span>
{% else %}
<span class="text-muted">&mdash;</span>
{% endif %}
@@ -74,8 +74,8 @@
<tr>
<td>Length</td>
<td>
{% if cable.length %}
{{ cable.length }} {{ cable.get_length_unit_display }}
{% if object.length %}
{{ object.length }} {{ object.get_length_unit_display }}
{% else %}
<span class="text-muted">&mdash;</span>
{% endif %}
@@ -83,29 +83,29 @@
</tr>
</table>
</div>
{% include 'inc/custom_fields_panel.html' with obj=cable %}
{% include 'extras/inc/tags_panel.html' with tags=cable.tags.all url='dcim:cable_list' %}
{% plugin_left_page cable %}
{% include 'inc/custom_fields_panel.html' with obj=object %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='dcim:cable_list' %}
{% plugin_left_page object %}
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Termination A</strong>
</div>
{% include 'dcim/inc/cable_termination.html' with termination=cable.termination_a %}
{% include 'dcim/inc/cable_termination.html' with termination=object.termination_a %}
</div>
<div class="panel panel-default">
<div class="panel-heading">
<strong>Termination B</strong>
</div>
{% include 'dcim/inc/cable_termination.html' with termination=cable.termination_b %}
{% include 'dcim/inc/cable_termination.html' with termination=object.termination_b %}
</div>
{% plugin_right_page cable %}
{% plugin_right_page object %}
</div>
</div>
<div class="row">
<div class="col-md-12">
{% plugin_full_width_page cable %}
{% plugin_full_width_page object %}
</div>
</div>
{% endblock %}