location.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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">Tenant</th>
  45. <td>
  46. {% if object.tenant.group %}
  47. {{ object.tenant.group|linkify }} /
  48. {% endif %}
  49. {{ object.tenant|linkify|placeholder }}
  50. </td>
  51. </tr>
  52. <tr>
  53. <th scope="row">Racks</th>
  54. <td>
  55. {% if rack_count %}
  56. <div class="float-end noprint">
  57. <a href="{% url 'dcim:rack_elevation_list' %}?location_id={{ object.pk }}" class="btn btn-sm btn-primary" title="View elevations">
  58. <i class="mdi mdi-server"></i>
  59. </a>
  60. </div>
  61. {% endif %}
  62. <a href="{% url 'dcim:rack_list' %}?location_id={{ object.pk }}">{{ rack_count }}</a>
  63. </td>
  64. </tr>
  65. <tr>
  66. <th scope="row">Devices</th>
  67. <td>
  68. <a href="{% url 'dcim:device_list' %}?location_id={{ object.pk }}">{{ device_count }}</a>
  69. </td>
  70. </tr>
  71. </table>
  72. </div>
  73. </div>
  74. {% include 'inc/panels/tags.html' %}
  75. {% plugin_left_page object %}
  76. </div>
  77. <div class="col col-md-6">
  78. {% include 'inc/panels/custom_fields.html' %}
  79. {% include 'inc/panels/contacts.html' %}
  80. {% include 'dcim/inc/nonracked_devices.html' %}
  81. {% include 'inc/panels/image_attachments.html' %}
  82. {% plugin_right_page object %}
  83. </div>
  84. </div>
  85. <div class="row mb-3">
  86. <div class="col col-md-12">
  87. <div class="card">
  88. <h5 class="card-header">Locations</h5>
  89. <div class="card-body table-responsive">
  90. {% render_table child_locations_table 'inc/table.html' %}
  91. {% include 'inc/paginator.html' with paginator=child_locations_table.paginator page=child_locations_table.page %}
  92. </div>
  93. </div>
  94. {% plugin_full_width_page object %}
  95. </div>
  96. </div>
  97. {% endblock %}