search.html 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. {% extends "tickets/base.html" %}
  2. {% block content %}
  3. <h2>{{ found_tickets|length|default:0 }} search results for term "{{ query_string }}"</h2>
  4. {% for ticket in found_tickets %}
  5. <div class="card mb-3">
  6. <div class="row">
  7. <div class="col-md-8">
  8. <div class="card-body">
  9. <h5 class="card-title"><a href="{% url 'tickets:ticket_detail' ticket.pk %}">{{ ticket.title|truncatechars:48 }}</a></h5>
  10. <p class="card-text">{{ ticket.note|truncatechars:128 }}</p>
  11. <section class="card-text">
  12. <small class="text-body-secondary">Created at: {{ ticket.created_at }}</small><br>
  13. <small class="text-body-secondary">Due date: {{ ticket.due_date }}</small>
  14. </section>
  15. </div>
  16. </div>
  17. <div class="col-md-4">
  18. <div class="card-body">
  19. <b>In list:</b> <a href="{% url 'tickets:ticket_list_detail' ticket.ticket_list.pk %}">{{ ticket.ticket_list.name }}</a><br>
  20. <b>Created by:</b> {{ ticket.created_by_username }}<br>
  21. <b>Assigned to:</b> {% if ticket.assigned_to_username %}{{ ticket.assigned_to_username }}{% else %}Anyone{% endif %}<br>
  22. <b>Type:</b> {{ ticket.get_ticket_type_display }}<br>
  23. <b>Status:</b> {{ ticket.status }}<br>
  24. <b>Priority:</b> {{ ticket.priority }}
  25. </div>
  26. </div>
  27. </div>
  28. </div>
  29. {% empty %}
  30. <h4> No results to show :(</h4>
  31. {% endfor %}
  32. {% endblock %}