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

Migrate all ObjectView subclasses to use get_extra_context()

This commit is contained in:
Jeremy Stretch
2020-11-19 15:59:11 -05:00
parent d237b97776
commit 1d922ee813
10 changed files with 284 additions and 380 deletions

View File

@@ -1,14 +1,14 @@
<div class="pull-right">
{% if perms.ipam.add_vlan and first_available_vlan %}
<a href="{% url 'ipam:vlan_add' %}?vid={{ first_available_vlan }}&group={{ vlan_group.pk }}{% if vlan_group.site %}&site={{ vlan_group.site.pk }}{% endif %}" class="btn btn-success">
<a href="{% url 'ipam:vlan_add' %}?vid={{ first_available_vlan }}&group={{ object.pk }}{% if object.site %}&site={{ object.site.pk }}{% endif %}" class="btn btn-success">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add a VLAN
</a>
{% endif %}
{% if perms.ipam.change_vlangroup %}
<a href="{% url 'ipam:vlangroup_edit' pk=vlan_group.pk %}" class="btn btn-warning">
<a href="{% url 'ipam:vlangroup_edit' pk=object.pk %}" class="btn btn-warning">
<span class="mdi mdi-pencil" aria-hidden="true"></span>
Edit this VLAN Group
</a>
{% endif %}
</div>
<h1>{{ vlan_group }}</h1>
<h1>{{ object }}</h1>

View File

@@ -1,16 +1,16 @@
{% extends 'base.html' %}
{% block title %}{{ vlan_group }} - VLANs{% endblock %}
{% block title %}{{ object }} - VLANs{% endblock %}
{% block content %}
<div class="row noprint">
<div class="col-sm-12 col-md-12">
<ol class="breadcrumb">
<li><a href="{% url 'ipam:vlangroup_list' %}">VLAN Groups</a></li>
{% if vlan_group.site %}
<li><a href="{% url 'dcim:site' slug=vlan_group.site.slug %}">{{ vlan_group.site }}</a></li>
{% if object.site %}
<li><a href="{% url 'dcim:site' slug=object.site.slug %}">{{ object.site }}</a></li>
{% endif %}
<li>{{ vlan_group }}</li>
<li>{{ object }}</li>
</ol>
</div>
</div>

View File

@@ -250,7 +250,7 @@
{% endif %}
{% if perms.ipam.add_service %}
<div class="panel-footer text-right noprint">
<a href="{% url 'virtualization:virtualmachine_service_assign' object=object.pk %}" class="btn btn-xs btn-primary">
<a href="{% url 'virtualization:virtualmachine_service_assign' virtualmachine=object.pk %}" class="btn btn-xs btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Assign service
</a>
</div>