{% extends '@RxConnexion/Admin/content.html.twig' %}
{% block content %}
    <div class="row max-width-initial">
        <div class="small-12 columns">
            <div class="content-container has-loading">
                <div class="row max-width-initial">
                    <div class="large-4 columns">
                        <div class="input-group">
                            <label class="input-group-label">Month</label>
                            <select class="input-group-field" id="month-filter-type">
                                <option value="all" selected>All Months</option>
                                {% for month in monthFilter %}
                                    <option value="{{ month.value }}" >{{ month.display }}</option>
                                {% endfor %}
                            </select>
                        </div>
                    </div>
                    <div class="large-4 columns">
                        <div class="input-group">
                            <label class="input-group-label">Status</label>
                            <select class="input-group-field" id="ticketStatus">
                                <option value='All' selected="selected">All</option>
                                {% for ticketStatuses in ticketStatus %}
                                    <option value='{{ ticketStatuses.id }}'>{{ ticketStatuses.description }}</option>
                                {% endfor %}
                            </select>
                        </div>
                    </div>
                    <div class="large-4 columns">
                        <div class="input-group">
                            <label class="input-group-label">Assigned</label>
                            <input class="input-group-field" type="text" id="assigned_to">
                            <input class="input-group-field" type="hidden" id="assigned_to_id">
                        </div>
                    </div>
                </div>
                <div class="content-container-content hide">
                    <div class="text-right">
                        {% if userData.type == 'Super Admin' or 'Admin Ticket New' in userData.accesses %}
                            {#<a class="href-new-action" href="{{ path('ticket_form') }}">New Ticket</a>#}
                            <a class="href-new-action" href="{{ path('ticket_form') }}">New Endorsement</a>
                        {% endif %}
                    </div>
                    <table class="display responsive" id="ticket-datalist" width="100%">
                        <thead>
                        <tr>
                            <th>Ticket ID</th>
                            <th>Created At</th>
                            <th>Assigned To</th>
                            <th>Status</th>
                            <th>Severity</th>
                            <th>Patients</th>
                            <th>Charts</th>
                            <th>Latest Note</th>
                            <th>Action</th>
                        </tr>
                        </thead>
                        <tbody></tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    {% include '@RxConnexion/Admin/js.html.twig' %}
    <script language="javascript">
        //<![CDATA[
        ticket.settings.ajaxUrl = '{{ path('ticket_ajax_list') }}';
        ticket.settings.account_user_autocompleteUrl = '{{ path('account_user_autocomplete') }}';
        jQ(document).ready(function(){
            ticket.init();
        });
        //]]>
    </script>
{% endblock %}