Cleaned up component tables and checkbox toggling

This commit is contained in:
Jeremy Stretch
2017-12-21 13:29:02 -05:00
parent 063e79451f
commit d84e5d1839
9 changed files with 123 additions and 169 deletions

View File

@@ -235,38 +235,32 @@
<button class="btn btn-default btn-xs toggle-ips" selected="selected">
<span class="glyphicon glyphicon-check" aria-hidden="true"></span> Show IPs
</button>
{% if perms.dcim.change_interface and interfaces|length > 1 %}
<button class="btn btn-default btn-xs toggle">
<span class="glyphicon glyphicon-unchecked" aria-hidden="true"></span> Select all
</button>
{% endif %}
{% if perms.dcim.add_interface and interfaces|length > 10 %}
<a href="{% url 'virtualization:interface_add' pk=vm.pk %}" class="btn btn-primary btn-xs">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add interfaces
</a>
{% endif %}
</div>
</div>
<table id="interfaces_table" class="table table-hover panel-body component-list">
<tr class="table-headings">
{% if perms.dcim.change_interface or perms.dcim.delete_interface %}
<th></th>
{% endif %}
<th>Name</th>
<th>LAG</th>
<th>Description</th>
<th>MTU</th>
<th>MAC Address</th>
<th colspan="2">Connection</th>
<th></th>
</tr>
{% for iface in interfaces %}
{% include 'dcim/inc/interface.html' with device=vm %}
{% empty %}
<table id="interfaces_table" class="table table-hover table-headings panel-body component-list">
<thead>
<tr>
<td colspan="6">No interfaces defined</td>
{% if perms.dcim.change_interface or perms.dcim.delete_interface %}
<th class="pk"><input type="checkbox" class="toggle" title="Toggle all" /></th>
{% endif %}
<th>Name</th>
<th>LAG</th>
<th>Description</th>
<th>MTU</th>
<th>MAC Address</th>
<th colspan="2">Connection</th>
<th></th>
</tr>
{% endfor %}
</thead>
<tbody>
{% for iface in interfaces %}
{% include 'dcim/inc/interface.html' with device=vm %}
{% empty %}
<tr>
<td colspan="6">No interfaces defined</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if perms.dcim.add_interface or perms.dcim.delete_interface %}
<div class="panel-footer">