location.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. {% extends 'generic/object.html' %}
  2. {% load helpers %}
  3. {% load plugins %}
  4. {% load render_table from django_tables2 %}
  5. {% block breadcrumbs %}
  6. {{ block.super }}
  7. {% for location in object.get_ancestors %}
  8. <li class="breadcrumb-item">{{ location|linkify }}</li>
  9. {% endfor %}
  10. {% endblock %}
  11. {% block extra_controls %}
  12. {% if perms.dcim.add_location %}
  13. <a href="{% url 'dcim:location_add' %}?site={{ object.site.pk }}&parent={{ object.pk }}" class="btn btn-sm btn-primary">
  14. <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Child Location
  15. </a>
  16. {% endif %}
  17. {% endblock extra_controls %}
  18. {% block content %}
  19. <div class="row mb-3">
  20. <div class="col col-md-6">
  21. <div class="card">
  22. <h5 class="card-header">
  23. Location
  24. </h5>
  25. <div class="card-body">
  26. <table class="table table-hover attr-table">
  27. <tr>
  28. <th scope="row">Name</th>
  29. <td>{{ object.name }}</td>
  30. </tr>
  31. <tr>
  32. <th scope="row">Description</th>
  33. <td>{{ object.description|placeholder }}</td>
  34. </tr>
  35. <tr>
  36. <th scope="row">Site</th>
  37. <td>{{ object.site|linkify }}</td>
  38. </tr>
  39. <tr>
  40. <th scope="row">Parent</th>
  41. <td>{{ object.parent|linkify|placeholder }}</td>
  42. </tr>
  43. <tr>
  44. <th scope="row">Status</th>
  45. <td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
  46. </tr>
  47. <tr>
  48. <th scope="row">Tenant</th>
  49. <td>
  50. {% if object.tenant.group %}
  51. {{ object.tenant.group|linkify }} /
  52. {% endif %}
  53. {{ object.tenant|linkify|placeholder }}
  54. </td>
  55. </tr>
  56. <tr>
  57. <th scope="row">Racks</th>
  58. <td class="position-relative">
  59. {% if rack_count %}
  60. <div class="position-absolute top-50 end-0 translate-middle-y noprint">
  61. <a href="{% url 'dcim:rack_elevation_list' %}?location_id={{ object.pk }}" class="btn btn-sm btn-primary" title="View elevations">
  62. <i class="mdi mdi-server"></i>
  63. </a>
  64. </div>
  65. {% endif %}
  66. <a href="{% url 'dcim:rack_list' %}?location_id={{ object.pk }}">{{ rack_count }}</a>
  67. </td>
  68. </tr>
  69. <tr>
  70. <th scope="row">Devices</th>
  71. <td>
  72. <a href="{% url 'dcim:device_list' %}?location_id={{ object.pk }}">{{ device_count }}</a>
  73. </td>
  74. </tr>
  75. </table>
  76. </div>
  77. </div>
  78. {% include 'inc/panels/tags.html' %}
  79. {% plugin_left_page object %}
  80. </div>
  81. <div class="col col-md-6">
  82. {% include 'inc/panels/custom_fields.html' %}
  83. {% include 'inc/panels/contacts.html' %}
  84. {% include 'dcim/inc/nonracked_devices.html' %}
  85. {% include 'inc/panels/image_attachments.html' %}
  86. {% plugin_right_page object %}
  87. </div>
  88. </div>
  89. <div class="row mb-3">
  90. <div class="col col-md-12">
  91. <div class="card">
  92. <h5 class="card-header">Child Locations</h5>
  93. <div class="card-body htmx-container table-responsive"
  94. hx-get="{% url 'dcim:location_list' %}?parent_id={{ object.pk }}"
  95. hx-trigger="load"
  96. ></div>
  97. </div>
  98. {% plugin_full_width_page object %}
  99. </div>
  100. </div>
  101. {% endblock %}