rackrole.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. {% extends 'generic/object.html' %}
  2. {% load helpers %}
  3. {% load plugins %}
  4. {% load render_table from django_tables2 %}
  5. {% block extra_controls %}
  6. {% if perms.dcim.add_rack %}
  7. <a href="{% url 'dcim:rack_add' %}?role={{ object.pk }}" class="btn btn-sm btn-primary">
  8. <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Rack
  9. </a>
  10. {% endif %}
  11. {% endblock extra_controls %}
  12. {% block content %}
  13. <div class="row mb-3">
  14. <div class="col col-md-6">
  15. <div class="card">
  16. <h5 class="card-header">
  17. Rack Role
  18. </h5>
  19. <div class="card-body">
  20. <table class="table table-hover attr-table">
  21. <tr>
  22. <th scope="row">Name</th>
  23. <td>{{ object.name }}</td>
  24. </tr>
  25. <tr>
  26. <th scope="row">Description</th>
  27. <td>{{ object.description|placeholder }}</td>
  28. </tr>
  29. <tr>
  30. <th scope="row">Color</th>
  31. <td>
  32. <span class="badge color-label" style="background-color: #{{ object.color }}">&nbsp;</span>
  33. </td>
  34. </tr>
  35. <tr>
  36. <th scope="row">Racks</th>
  37. <td>
  38. <a href="{% url 'dcim:rack_list' %}?role_id={{ object.pk }}">{{ racks_table.rows|length }}</a>
  39. </td>
  40. </tr>
  41. </table>
  42. </div>
  43. </div>
  44. {% include 'inc/panels/tags.html' %}
  45. {% plugin_left_page object %}
  46. </div>
  47. <div class="col col-md-6">
  48. {% include 'inc/panels/custom_fields.html' %}
  49. {% plugin_right_page object %}
  50. </div>
  51. </div>
  52. <div class="row mb-3">
  53. <div class="col col-md-12">
  54. <div class="card">
  55. <h5 class="card-header">Racks</h5>
  56. <div class="card-body table-responsive">
  57. {% render_table racks_table 'inc/table.html' %}
  58. {% include 'inc/paginator.html' with paginator=racks_table.paginator page=racks_table.page %}
  59. </div>
  60. </div>
  61. {% plugin_full_width_page object %}
  62. </div>
  63. </div>
  64. {% endblock %}