|
1 | 1 | {% load helpers %}
|
2 | 2 |
|
3 | 3 | <div class="card">
|
4 |
| -<h5 class="card-header"> |
5 |
| - Non-Racked Devices |
6 |
| -</h5> |
7 |
| -<div class="card-body"> |
8 |
| -{% if nonracked_devices %} |
9 |
| - <table class="table table-hover"> |
10 |
| - <tr> |
11 |
| - <th>Name</th> |
12 |
| - <th>Role</th> |
13 |
| - <th>Type</th> |
14 |
| - <th colspan="2">Parent Device</th> |
15 |
| - </tr> |
16 |
| - {% for device in nonracked_devices %} |
17 |
| - <tr{% if device.device_type.u_height %} class="warning"{% endif %}> |
18 |
| - <td> |
19 |
| - <a href="{% url 'dcim:device' pk=device.pk %}">{{ device }}</a> |
20 |
| - </td> |
21 |
| - <td>{{ device.device_role }}</td> |
22 |
| - <td>{{ device.device_type }}</td> |
23 |
| - {% if device.parent_bay %} |
24 |
| - <td>{{ device.parent_bay.device|linkify }}</td> |
25 |
| - <td>{{ device.parent_bay }}</td> |
26 |
| - {% else %} |
27 |
| - <td colspan="2" class="text-muted">—</td> |
| 4 | + <h5 class="card-header"> |
| 5 | + Non-Racked Devices |
| 6 | + </h5> |
| 7 | + <div class="card-body"> |
| 8 | + {% if nonracked_devices %} |
| 9 | + <table class="table table-hover"> |
| 10 | + <tr> |
| 11 | + <th>Name</th> |
| 12 | + <th>Role</th> |
| 13 | + <th>Type</th> |
| 14 | + <th colspan="2">Parent Device</th> |
| 15 | + </tr> |
| 16 | + {% for device in nonracked_devices %} |
| 17 | + <tr{% if device.device_type.u_height %} class="warning"{% endif %}> |
| 18 | + <td> |
| 19 | + <a href="{% url 'dcim:device' pk=device.pk %}">{{ device }}</a> |
| 20 | + </td> |
| 21 | + <td>{{ device.device_role }}</td> |
| 22 | + <td>{{ device.device_type }}</td> |
| 23 | + {% if device.parent_bay %} |
| 24 | + <td>{{ device.parent_bay.device|linkify }}</td> |
| 25 | + <td>{{ device.parent_bay }}</td> |
| 26 | + {% else %} |
| 27 | + <td colspan="2" class="text-muted">—</td> |
| 28 | + {% endif %} |
| 29 | + </tr> |
| 30 | + {% endfor %} |
| 31 | + </table> |
| 32 | + |
| 33 | + {% if total_nonracked_devices_count > nonracked_devices.count %} |
| 34 | + {% if object|meta:'verbose_name' == 'site' %} |
| 35 | + <div class="text-muted"> |
| 36 | + Displaying {{ nonracked_devices.count }} of {{ total_nonracked_devices_count }} devices (<a href="{% url 'dcim:device_list' %}?site_id={{ object.pk }}&rack_id=null">View full list</a>) |
| 37 | + </div> |
| 38 | + {% elif object|meta:'verbose_name' == 'location' %} |
| 39 | + <div class="text-muted"> |
| 40 | + Displaying {{ nonracked_devices.count }} of {{ total_nonracked_devices_count }} devices (<a href="{% url 'dcim:device_list' %}?location_id={{ object.pk }}&rack_id=null">View full list</a>) |
| 41 | + </div> |
28 | 42 | {% endif %}
|
29 |
| - </tr> |
30 |
| - {% endfor %} |
31 |
| - </table> |
| 43 | + {% endif %} |
| 44 | + |
32 | 45 | {% else %}
|
33 | 46 | <div class="text-muted">
|
34 | 47 | None
|
35 | 48 | </div>
|
36 | 49 | {% endif %}
|
37 | 50 | </div>
|
| 51 | + |
38 | 52 | {% if perms.dcim.add_device %}
|
39 | 53 | {% if object|meta:'verbose_name' == 'rack' %}
|
40 | 54 | <div class="card-footer text-end noprint">
|
|
0 commit comments