vlangroup.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. {% if object.scope %}
  8. {# TODO: This should link to a filtered list of VLANGroups #}
  9. <li class="breadcrumb-item"><a href="{{ object.scope.get_absolute_url }}">{{ object.scope }}</a></li>
  10. {% endif %}
  11. {% endblock %}
  12. {% block buttons %}
  13. {% if perms.ipam.add_vlan %}
  14. <a href="{% url 'ipam:vlan_add' %}?group={{ object.pk }}" class="btn btn-success">
  15. <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add VLAN
  16. </a>
  17. {% endif %}
  18. {{ block.super }}
  19. {% endblock %}
  20. {% block content %}
  21. <div class="row mb-3">
  22. <div class="col col-md-6">
  23. <div class="card">
  24. <h5 class="card-header">
  25. VLAN Group
  26. </h5>
  27. <div class="card-body">
  28. <table class="table table-hover attr-table">
  29. <tr>
  30. <th scope="row">Name</th>
  31. <td>{{ object.name }}</td>
  32. </tr>
  33. <tr>
  34. <th scope="row">Description</th>
  35. <td>{{ object.description|placeholder }}</td>
  36. </tr>
  37. <tr>
  38. <th scope="row">Scope</th>
  39. <td>
  40. {% if object.scope %}
  41. <a href="{{ object.scope.get_absolute_url }}">{{ object.scope }}</a>
  42. {% else %}
  43. <span class="text-muted">&mdash;</span>
  44. {% endif %}
  45. </tr>
  46. <tr>
  47. <th scope="row">VLANs</th>
  48. <td>
  49. <a href="{% url 'ipam:vlan_list' %}?group_id={{ object.pk }}">{{ vlans_count }}</a>
  50. </td>
  51. </tr>
  52. </table>
  53. </div>
  54. </div>
  55. {% include 'inc/panels/tags.html' %}
  56. {% plugin_left_page object %}
  57. </div>
  58. <div class="col col-md-6">
  59. {% include 'inc/panels/custom_fields.html' %}
  60. {% plugin_right_page object %}
  61. </div>
  62. </div>
  63. <div class="row mb-3">
  64. <div class="col col-md-12">
  65. <div class="card">
  66. <h5 class="card-header">
  67. VLANs
  68. </h5>
  69. <div class="card-body table-responsive">
  70. {% render_table vlans_table 'inc/table.html' %}
  71. </div>
  72. {% if perms.ipam.add_vlan %}
  73. <div class="card-footer text-end noprint">
  74. <a href="{% url 'ipam:vlan_add' %}?group={{ object.pk }}" class="btn btn-sm btn-primary">
  75. <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add VLAN
  76. </a>
  77. </div>
  78. {% endif %}
  79. </div>
  80. {% include 'inc/paginator.html' with paginator=vlans_table.paginator page=vlans_table.page %}
  81. </div>
  82. </div>
  83. {% endblock %}