role.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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.ipam.add_prefix %}
  7. <a href="{% url 'ipam:prefix_add' %}?role={{ object.pk }}" class="btn btn-sm btn-primary">
  8. <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Prefix
  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. 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">Weight</th>
  31. <td>{{ object.weight }}</td>
  32. </tr>
  33. <tr>
  34. <th scope="row">Prefixes</th>
  35. <td>
  36. <a href="{% url 'ipam:prefix_list' %}?role_id={{ object.pk }}">{{ prefixes_table.rows|length }}</a>
  37. </td>
  38. </tr>
  39. </table>
  40. </div>
  41. </div>
  42. {% include 'inc/panels/tags.html' %}
  43. {% plugin_left_page object %}
  44. </div>
  45. <div class="col col-md-6">
  46. {% include 'inc/panels/custom_fields.html' %}
  47. {% plugin_right_page object %}
  48. </div>
  49. </div>
  50. <div class="row mb-3">
  51. <div class="col col-md-12">
  52. <div class="card">
  53. <h5 class="card-header">Prefixes</h5>
  54. <div class="card-body table-responsive">
  55. {% render_table prefixes_table 'inc/table.html' %}
  56. {% include 'inc/paginator.html' with paginator=prefixes_table.paginator page=prefixes_table.page %}
  57. </div>
  58. </div>
  59. {% plugin_full_width_page object %}
  60. </div>
  61. </div>
  62. {% endblock %}