location.html 3.7 KB

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