ticket_list_detail.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. {% extends "tickets/base.html" %}
  2. {% load static %}
  3. {% block content %}
  4. {% if my_tickets %}
  5. <h1 class="fw-bold">My Tickets (in all groups)</h1>
  6. {% elif assignments %}
  7. <h1 class="fw-bold">Assignments (in all groups)</h1>
  8. {% else %}
  9. <h1>{{ ticket_list.group }} > <b>{{ ticket_list.name }}</b></h1>
  10. <div class="d-flex justify-content-between">
  11. <button type="button" data-bs-toggle="modal" data-bs-target="#ticket-create-modal" class="btn btn-primary">
  12. <i class="fa-solid fa-plus pe-1"></i>
  13. New Ticket
  14. </button>
  15. </div>
  16. <!--ticket create modal-->
  17. <div class="modal fade" id="ticket-create-modal" tabindex="-1">
  18. <div class="modal-dialog modal-dialog-centered">
  19. <div class="modal-content">
  20. <div class="modal-header">
  21. <h1 class="modal-title fs-5">
  22. <i class="fa-solid fa-plus pe-1"></i>
  23. New Ticket
  24. </div>
  25. <div class="modal-body">
  26. <form id="ticket-create-form" action="{% url 'tickets:ticket_create' ticket_list.pk %}" method="post">
  27. {% include 'tickets/include/form.html' %}
  28. </form>
  29. </div>
  30. <div class="modal-footer">
  31. <button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">
  32. <i class="fa-solid fa-xmark pe-1"></i>
  33. Close
  34. </button>
  35. <button class="btn btn-primary" type="submit" form="ticket-create-form">
  36. <i class="fa-solid fa-check pe-1"></i>
  37. Confirm
  38. </button>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. {% endif %}
  44. <hr>
  45. {% if tickets %}
  46. <div class="overflow-x-scroll">
  47. <table class="table" id="tickettable">
  48. <thead>
  49. <tr class="nodrop">
  50. <th>ID</th>
  51. <th>Type</th>
  52. <th>Title</th>
  53. <th class="text-nowrap">Created at</th>
  54. <th class="text-nowrap">Due on</th>
  55. <th>Owner</th>
  56. <th>Assigned</th>
  57. <th>Status</th>
  58. <th>Priority</th>
  59. </tr>
  60. </thead>
  61. <tbody>
  62. {% for ticket in tickets %}
  63. <tr class="ticket" id="{{ ticket.pk }}" data-ticket-type="{{ ticket.get_ticket_type_display }}">
  64. <td>
  65. {{ ticket.pk }}
  66. </td>
  67. <td>
  68. {{ ticket.get_ticket_type_display }}
  69. </td>
  70. <td>
  71. <a href="{% url 'tickets:ticket_detail' ticket.pk %}">{{ ticket.title|truncatechars:48 }}</a>
  72. </td>
  73. <td>
  74. {{ ticket.created_at }}
  75. </td>
  76. <td>
  77. {{ ticket.due_date }}
  78. </td>
  79. <td>
  80. {{ ticket.created_by_username }}
  81. </td>
  82. <td>
  83. {% if ticket.assigned_to_username %}{{ ticket.assigned_to_username }}{% else %}Anyone{% endif %}
  84. </td>
  85. <td>
  86. {{ ticket.get_status_display }}
  87. </td>
  88. <td>
  89. {{ ticket.priority }}
  90. </td>
  91. </tr>
  92. {% endfor %}
  93. </tbody>
  94. </table>
  95. </div>
  96. {% else %}
  97. <h4>There are no Tickets!</h4>
  98. {% endif %}
  99. {% endblock %}