bulk_remove.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. {% extends 'generic/_base.html' %}
  2. {% load helpers %}
  3. {% load render_table from django_tables2 %}
  4. {% load i18n %}
  5. {% comment %}
  6. Blocks:
  7. - title: Page title
  8. - tabs: Page tabs
  9. - content: Primary page content
  10. Context:
  11. - form: The bulk edit form class
  12. - parent_obj: The parent object
  13. - table: A table of objects being removed
  14. - obj_type_plural: The plural form of the object type
  15. - return_url: The URL to which the user is redirected after submitting the form
  16. {% endcomment %}
  17. {% block title %}
  18. {% trans "Remove" %} {{ table.rows|length }} {{ obj_type_plural|bettertitle }}?
  19. {% endblock %}
  20. {% block tabs %}
  21. <ul class="nav nav-tabs">
  22. <li class="nav-item" role="presentation">
  23. <button class="nav-link active" type="button" role="tab" aria-controls="edit-form" aria-selected="true">
  24. {% trans "Bulk Remove" %}
  25. </button>
  26. </li>
  27. </ul>
  28. {% endblock tabs %}
  29. {% block content %}
  30. <div class="tab-pane show active" role="tabpanel">
  31. <div class="alert alert-danger bg-danger-subtle" role="alert">
  32. <div class="d-flex">
  33. <div>
  34. <i class="mdi mdi-alert-octagon p-2"></i>
  35. </div>
  36. <div>
  37. <h4 class="alert-title">{% trans "Confirm Bulk Removal" %}</h4>
  38. {% blocktrans trimmed with count=table.rows|length %}
  39. The following operation will remove {{ count }} {{ obj_type_plural }} from {{ parent_obj }}. Please
  40. carefully review the {{ obj_type_plural }} to be removed and confirm below.
  41. {% endblocktrans %}
  42. </div>
  43. </div>
  44. </div>
  45. <div class="container-fluid px-0">
  46. <div class="card">
  47. <div class="table-responsive">
  48. {% render_table table 'inc/table.html' %}
  49. </div>
  50. </div>
  51. <form action="." method="post" class="form">
  52. {% csrf_token %}
  53. {% for field in form.hidden_fields %}
  54. {{ field }}
  55. {% endfor %}
  56. <div class="text-end">
  57. <a href="{{ return_url }}" class="btn btn-outline-secondary">{% trans "Cancel" %}</a>
  58. <button type="submit" name="_confirm" class="btn btn-danger">
  59. {% blocktrans trimmed with count=table.rows|length %}
  60. Remove these {{ count }} {{ obj_type_plural }}
  61. {% endblocktrans %}
  62. </button>
  63. </div>
  64. </form>
  65. </div>
  66. </div>
  67. {% endblock content %}