{% load custom_tags_and_filters %}
<table class="table table-striped table-hover table-bordered thead-light">
    <thead>
        <tr>
            <th>
                {% if not sortable == False %}
                    {% include 'pagination/pagination_column.html' with order_by="number" name='Number' %}
                {% else %}
                    Number
                {% endif %}
            </th>
            <th>Created by</th>
            <th>
                {% if not sortable == False %}
                    {% include 'pagination/pagination_column.html' with order_by="created" name='Created on' %}
                {% else %}
                    Created on
                {% endif %}
            </th>
            <th>
                {% if not sortable == False %}
                    {% include 'pagination/pagination_column.html' with order_by="updated" name='Last updated' %}
                {% else %}
                    Last updated
                {% endif %}
            </th>
            <th>{{ customizations|get_item:"osticket_create_ticket_help_topic_label" }}</th>
            <th>{{ ticket_field_labels|get_item:"subject" }}</th>
            <th>{{ ticket_field_labels|get_item:"priority" }}</th>
        </tr>
    </thead>
    <tbody>
        {% for ticket in tickets %}
            <tr>
                <td>
                    <a target="_blank" href="{% url 'osticket_ticket_details' ticket.ticket_id %}">{{ ticket.number }}</a>
                </td>
                <td>{{ ticket.creator_name }}</td>
                <td>{{ ticket.created|date:"SHORT_DATETIME_FORMAT" }}</td>
                <td>{{ ticket.updated|date:"SHORT_DATETIME_FORMAT" }}</td>
                <td>{{ ticket.topic.topic }}</td>
                <td>{{ ticket.form_entry_values|get_item:"subject"|get_item:1 }}</td>
                <td>{{ ticket.form_entry_values|get_item:"priority"|get_item:1|default_if_none:"" }}</td>
            </tr>
        {% endfor %}
    </tbody>
</table>
