{% load i18n humanize %}

<!-- DataTables Example -->
<div class="card mb-3">
    <div class="card-header">
        <i class="fas fa-table"></i>
        {% if ticket_list_caption %}{{ ticket_list_caption }}{% else %}{% trans "Your Tickets" %}{% endif %}
    </div>
    <div class="card-body">
        <div class="table-responsive">
        <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
            <thead>
                <tr>
                    <th>#</th>
                    <th>{% trans "Pr" %}</th>
                    <th>{% trans "Title" %}</th>
                    <th>{% trans "Queue" %}</th>
                    <th>{% trans "Status" %}</th>
                    <th>{% trans "Last Update" %}</th>
                </tr>
            </thead>
            <tbody>
                {% for ticket in ticket_list %}
                <tr class="{{ ticket.get_priority_css_class }}">
                    <td><a href='{{ ticket.get_absolute_url }}'>{{ ticket.ticket }}</a></td>
                    <td>{{ ticket.priority }}</td>
                    <td><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></td>
                    <td>{{ ticket.queue }}</td>
                    <td>{{ ticket.get_status }}</td>
                    <td><span title='{{ ticket.modified|date:"r" }}'>{{ ticket.modified|naturaltime }}</span></td>
                </tr>
                {% empty %}
                <tr>{% if ticket_list_empty_message %}<td colspan='6'>{{ ticket_list_empty_message }}</td>{% else %}<td colspan='6'>{% trans "You do not have any pending tickets." %}</td>{% endif %}</tr>
                {% endfor %}
            </tbody>
        </table>
        </div>
    </div>
    <div class="card-footer small text-muted">Listing {{ ticket_list|length }} ticket(s).</div>
</div>


