devicebays.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. {% extends 'dcim/device/base.html' %}
  2. {% load render_table from django_tables2 %}
  3. {% load helpers %}
  4. {% load static %}
  5. {% load i18n %}
  6. {% block content %}
  7. {% include 'inc/table_controls_htmx.html' with table_modal="DeviceDeviceBayTable_config" %}
  8. <form method="post">
  9. {% csrf_token %}
  10. <div class="card">
  11. <div class="card-body htmx-container table-responsive" id="object_list">
  12. {% include 'htmx/table.html' %}
  13. </div>
  14. </div>
  15. <div class="noprint bulk-buttons">
  16. <div class="bulk-button-group">
  17. {% if 'bulk_edit' in actions %}
  18. <div class="btn-group" role="group">
  19. <button type="submit" name="_edit" formaction="{% url 'dcim:devicebay_bulk_edit' %}?device={{ object.pk }}&return_url={% url 'dcim:device_devicebays' pk=object.pk %}" class="btn btn-warning btn-sm">
  20. <i class="mdi mdi-pencil" aria-hidden="true"></i> {% trans "Edit" %}
  21. </button>
  22. <button type="submit" name="_rename" formaction="{% url 'dcim:devicebay_bulk_rename' %}?return_url={% url 'dcim:device_devicebays' pk=object.pk %}" class="btn btn-outline-warning btn-sm">
  23. <i class="mdi mdi-pencil-outline" aria-hidden="true"></i> {% trans "Rename" %}
  24. </button>
  25. </div>
  26. {% endif %}
  27. {% if 'bulk_delete' in actions %}
  28. <button type="submit" name="_delete" formaction="{% url 'dcim:devicebay_bulk_delete' %}?return_url={% url 'dcim:device_devicebays' pk=object.pk %}" class="btn btn-danger btn-sm">
  29. <i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> {% trans "Delete" %}
  30. </button>
  31. {% endif %}
  32. </div>
  33. {% if perms.dcim.add_devicebay %}
  34. <div class="bulk-button-group">
  35. <a href="{% url 'dcim:devicebay_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_devicebays' pk=object.pk %}" class="btn btn-primary btn-sm">
  36. <i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Device Bays" %}
  37. </a>
  38. </div>
  39. {% endif %}
  40. </div>
  41. </form>
  42. {% endblock %}
  43. {% block modals %}
  44. {{ block.super }}
  45. {% table_config_form table %}
  46. {% endblock modals %}