{% extends 'common/base.html' %}

{% block content %}
    <form method="POST">    
        {% csrf_token %}
        {{ form.as_p }}
        
        {% for container in containers %}
            <input type="hidden" name="containers" value="{{ container.id }}">
        {% endfor %}    
    
    
        <div>
            <button id="createPaymentBtn" class="btn btn-primary" type="submit">Create Payment</button>
        </div>
        
        <div class="selected-containers">
            <h3>Selected Containers</h3>
            <table class="table">
                <thead>
                    <tr>
                        <th>Container Number</th>
                        <th>Type</th>
                        <th>Company</th>
                        <th>Received Date</th>
                        <th>Expedited Date</th>
                    </tr>
                </thead>
                <tbody>
                    {% for container in containers %}
                        <tr>
                            <td>{{ container.number }}</td>
                            <td>{{ container.container_type }}</td>
                            <td>{{ container.line.company.short_name }}</td>
                            <td>{{ container.received_on|date:"Y-m-d" }}</td>
                            <td>{{ container.expedited_on|date:"Y-m-d" }}</td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </form>
    
{% endblock %}