ticket_list_list.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. {% extends "tickets/base.html" %}
  2. {% block content %}
  3. <h1 class="fw-bold">Lists</h1>
  4. {% if user.is_staff or user.is_superuser %}
  5. <button type="button" data-bs-toggle="modal" data-bs-target="#ticket_list-create-modal" class="btn btn-primary">
  6. <i class="fa-solid fa-plus pe-1"></i>
  7. New List
  8. </button>
  9. <hr>
  10. <!--List create modal-->
  11. <div class="modal fade" id="ticket_list-create-modal" tabindex="-1">
  12. <div class="modal-dialog modal-dialog-centered">
  13. <div class="modal-content">
  14. <div class="modal-header">
  15. <h1 class="modal-title fs-5">
  16. <i class="fa-solid fa-plus pe-1"></i>
  17. New List
  18. </div>
  19. <div class="modal-body">
  20. <form id="ticket_list-create-form" action="{% url 'tickets:ticket_list_create' %}" method="post">
  21. {% include 'tickets/include/form.html' %}
  22. </form>
  23. </div>
  24. <div class="modal-footer">
  25. <button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">
  26. <i class="fa-solid fa-xmark pe-1"></i>
  27. Close
  28. </button>
  29. <button class="btn btn-primary" type="submit" form="ticket_list-create-form">
  30. <i class="fa-solid fa-check pe-1"></i>
  31. Confirm
  32. </button>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. {% endif %}
  38. {% if ticket_lists %}
  39. {% regroup ticket_lists by group as section_ticket_list %}
  40. {% for group in section_ticket_list %}
  41. <h3>{{ group.grouper }}</h3>
  42. <ul class="list-group mb-4">
  43. {% for ticket_list in group.list %}
  44. <li class="list-group-item d-flex align-items-center justify-content-between">
  45. <a href="{% url 'tickets:ticket_list_detail' ticket_list.pk %}">{{ ticket_list.name }}</a>
  46. </li>
  47. {% endfor %}
  48. </ul>
  49. {% endfor %}
  50. {% else %}
  51. <h4>There are no Lists!</h4>
  52. {% endif %}
  53. {% endblock %}