object_children.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {% extends base_template %}
  2. {% load buttons %}
  3. {% load helpers %}
  4. {% load i18n %}
  5. {% comment %}
  6. Blocks:
  7. - content: Primary page content
  8. - table_controls: Control elements for the child objects table
  9. - bulk_controls: Bulk action buttons which appear beneath the child objects table
  10. - bulk_extra_controls: Other bulk action buttons
  11. - modals: Any pre-loaded modals
  12. Context:
  13. - base_template: The template which this template extends
  14. - object: The parent object
  15. - child_model: The model of child objects being displayed
  16. - table: The table containing child objects
  17. - table_config: The ID of the table configuration modal
  18. - actions: A list of enabled bulk actions
  19. - tab: The currently active tab
  20. - return_url: The URL to which the user is redirected after performing a bulk action
  21. {% endcomment %}
  22. {% block content %}
  23. {% block table_controls %}
  24. {% include 'inc/table_controls_htmx.html' with table_modal=table_config %}
  25. {% endblock table_controls %}
  26. <form method="post">
  27. {% csrf_token %}
  28. <div class="card">
  29. <div class="htmx-container table-responsive" id="object_list">
  30. {% include 'htmx/table.html' %}
  31. </div>
  32. </div>
  33. <div class="card btn-list sticky-actions d-print-none" data-sticky-position="right" data-sticky-when="selection">
  34. {% block bulk_controls %}
  35. <div class="btn-list bulk-action-buttons">
  36. {% action_buttons actions model multi=True return_url=request.path %}
  37. </div>
  38. {% block bulk_extra_controls %}{% endblock %}
  39. {% endblock bulk_controls %}
  40. </div>
  41. </form>
  42. {% endblock content %}
  43. {% block modals %}
  44. {{ block.super }}
  45. {% table_config_form table %}
  46. {% endblock modals %}