|
1 | 1 | {% extends 'generic/object.html' %} |
2 | | -{% load helpers %} |
3 | | -{% load plugins %} |
4 | | -{% load render_table from django_tables2 %} |
5 | | -{% load i18n %} |
6 | 2 |
|
7 | 3 | {% block breadcrumbs %} |
8 | 4 | {{ block.super }} |
9 | 5 | {% for location in object.get_ancestors %} |
10 | 6 | <li class="breadcrumb-item">{{ location|linkify }}</li> |
11 | 7 | {% endfor %} |
12 | 8 | {% endblock %} |
13 | | - |
14 | | -{% block extra_controls %} |
15 | | - {% if perms.dcim.add_location %} |
16 | | - <a href="{% url 'dcim:location_add' %}?site={{ object.site.pk }}&parent={{ object.pk }}" class="btn btn-primary"> |
17 | | - <span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add Child Location" %} |
18 | | - </a> |
19 | | - {% endif %} |
20 | | -{% endblock extra_controls %} |
21 | | - |
22 | | -{% block content %} |
23 | | -<div class="row mb-3"> |
24 | | - <div class="col col-12 col-md-6"> |
25 | | - <div class="card"> |
26 | | - <h2 class="card-header">{% trans "Location" %}</h2> |
27 | | - <table class="table table-hover attr-table"> |
28 | | - <tr> |
29 | | - <th scope="row">{% trans "Name" %}</th> |
30 | | - <td>{{ object.name }}</td> |
31 | | - </tr> |
32 | | - <tr> |
33 | | - <th scope="row">{% trans "Description" %}</th> |
34 | | - <td>{{ object.description|placeholder }}</td> |
35 | | - </tr> |
36 | | - <tr> |
37 | | - <th scope="row">{% trans "Site" %}</th> |
38 | | - <td>{{ object.site|linkify }}</td> |
39 | | - </tr> |
40 | | - <tr> |
41 | | - <th scope="row">{% trans "Parent" %}</th> |
42 | | - <td>{{ object.parent|linkify|placeholder }}</td> |
43 | | - </tr> |
44 | | - <tr> |
45 | | - <th scope="row">{% trans "Status" %}</th> |
46 | | - <td>{% badge object.get_status_display bg_color=object.get_status_color %}</td> |
47 | | - </tr> |
48 | | - <tr> |
49 | | - <th scope="row">{% trans "Tenant" %}</th> |
50 | | - <td> |
51 | | - {% if object.tenant.group %} |
52 | | - {{ object.tenant.group|linkify }} / |
53 | | - {% endif %} |
54 | | - {{ object.tenant|linkify|placeholder }} |
55 | | - </td> |
56 | | - </tr> |
57 | | - <tr> |
58 | | - <th scope="row">{% trans "Facility" %}</th> |
59 | | - <td>{{ object.facility|placeholder }}</td> |
60 | | - </tr> |
61 | | - </table> |
62 | | - </div> |
63 | | - {% include 'inc/panels/tags.html' %} |
64 | | - {% include 'inc/panels/custom_fields.html' %} |
65 | | - {% include 'inc/panels/comments.html' %} |
66 | | - {% plugin_left_page object %} |
67 | | - </div> |
68 | | - <div class="col col-12 col-md-6"> |
69 | | - {% include 'inc/panels/related_objects.html' %} |
70 | | - {% include 'inc/panels/image_attachments.html' %} |
71 | | - {% plugin_right_page object %} |
72 | | - </div> |
73 | | -</div> |
74 | | -<div class="row mb-3"> |
75 | | - <div class="col col-md-12"> |
76 | | - <div class="card"> |
77 | | - <h2 class="card-header"> |
78 | | - {% trans "Child Locations" %} |
79 | | - {% if perms.dcim.add_location %} |
80 | | - <div class="card-actions"> |
81 | | - <a href="{% url 'dcim:location_add' %}?site={{ object.site.pk }}&parent={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-ghost-primary btn-sm"> |
82 | | - <i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add a Location" %} |
83 | | - </a> |
84 | | - </div> |
85 | | - {% endif %} |
86 | | - </h2> |
87 | | - {% htmx_table 'dcim:location_list' parent_id=object.pk %} |
88 | | - </div> |
89 | | - <div class="card"> |
90 | | - <h2 class="card-header"> |
91 | | - {% trans "Non-Racked Devices" %} |
92 | | - {% if perms.dcim.add_device %} |
93 | | - <div class="card-actions"> |
94 | | - <a href="{% url 'dcim:device_add' %}?site={{ object.site.pk }}&location={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-ghost-primary btn-sm"> |
95 | | - <i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add a Device" %} |
96 | | - </a> |
97 | | - </div> |
98 | | - {% endif %} |
99 | | - </h2> |
100 | | - {% htmx_table 'dcim:device_list' location_id=object.pk rack_id='null' parent_bay_id='null' %} |
101 | | - </div> |
102 | | - {% plugin_full_width_page object %} |
103 | | - </div> |
104 | | -</div> |
105 | | -{% endblock %} |
0 commit comments