Fixing a nesting/logic issue on device type edit/delete buttons

This commit is contained in:
Nick Peelman 2016-07-05 14:59:29 -04:00
parent 8b7d86df5a
commit db9b0dcaef
No known key found for this signature in database
GPG Key ID: 69A0803B5999940F

View File

@ -14,23 +14,27 @@
</ol> </ol>
</div> </div>
</div> </div>
{% if perms.dcim.change_devicetype %}
{% if perms.dcim.change_devicetype or perms.dcim.delete_devicetype %}
<div class="pull-right"> <div class="pull-right">
<a href="{% url 'dcim:devicetype_edit' pk=devicetype.pk %}" class="btn btn-warning"> {% if perms.dcim.change_devicetype %}
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> <a href="{% url 'dcim:devicetype_edit' pk=devicetype.pk %}" class="btn btn-warning">
Edit this device type <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
</a> Edit this device type
{% endif %} </a>
{% if perms.dcim.delete_devicetype %} {% endif %}
<a href="{% url 'dcim:devicetype_delete' pk=devicetype.pk %}" class="btn btn-danger"> {% if perms.dcim.delete_devicetype %}
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span> <a href="{% url 'dcim:devicetype_delete' pk=devicetype.pk %}" class="btn btn-danger">
Delete this device type <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
</a> Delete this device type
</a>
{% endif %}
</div> </div>
{% endif %} {% endif %}
<h1>{{ devicetype }}</h1> <h1>{{ devicetype }}</h1>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<strong>Chassis</strong> <strong>Chassis</strong>