<form id="form-order" method="post" enctype="application/x-www-form-urlencoded" data-load="{{ action }}">
    <div class="table-responsive">
        <table class="table table-bordered table-hover">
            <thead>
            <tr>
                <td class="text-center" style="width: 1px;"><input type="checkbox" onclick="$('input[name*=\'selected\']').trigger('click');" class="form-check-input"/></td>
                <td class="text-start">{{ column_shipping_address_text }}</td>
                <td class="text-start">{{ column_package_text }}</td>
                <td class="text-start">{{ column_shipment_text }}</td>
                <td class="text-start">{{ column_status_text }}</td>
                <td class="text-end">{{ column_actions_text }}</td>
            </tr>
            </thead>
            <tbody>
            {% if shipments %}
                {% for shipment in shipments %}
                    <tr>
                        <td class="text-center">
                            <input type="checkbox" name="selected[]" value="{{ shipment.order_id }}" class="form-check-input bulk-shipment-checkbox" data-order-id="{{ shipment.order_id }}"/>
                        </td>
                        <td class="text-start">
                            <p style="font-weight: bold;" class="mb-0">{{ shipment.data.receiver.name }}</p>
                            <p class="mb-0">{{ shipment.data.receiver.line1 }} {{ shipment.data.receiver.line2 }}, {{ shipment.data.receiver.postal_code }} {{ shipment.data.receiver.city }}, {{ shipment.data.receiver.country_code }}</p>
                        </td>
                        <td class="text-start">
                            {% if shipment.package.template_name %}
                                <p style="font-weight: bold;" class="mb-0">{{ shipment.package.template_name }}</p>
                            {% endif %}
                            {% if shipment.package.width %}
                                <p class="mb-0">{{ shipment.package.width }}x{{ shipment.package.length }}x{{ shipment.package.height }}cm, {{ shipment.package.weight }}kg</p>
                            {% endif %}
                        </td>
                        <td class="text-start">
                            <p style="font-weight: bold;" class="mb-0">{{ shipment.data.service_name }}</p>
                            <p class="mb-0">{{ shipment.data.service_name }}</p>
                        </td>
                        <td class="text-start">
                            <p style="font-weight: bold;" class="mb-0">{{ shipment.status }}</p>
                        </td>
                        <td class="text-end"><a href="{{ shipment.view }}" data-bs-toggle="tooltip" title="{{ button_view }}" class="btn btn-primary"><i class="fa-solid fa-eye"></i></a></td>
                    </tr>
                {% endfor %}
            {% else %}
                <tr>
                    <td class="text-center" colspan="9">{{ text_no_results }}</td>
                </tr>
            {% endif %}
            </tbody>
        </table>
    </div>
    <div class="row">
        <div class="col-sm-6 text-start">{{ pagination }}</div>
        <div class="col-sm-6 text-end">{{ results }}</div>
    </div>
</form>
