{% extends "base.html" %}

{% load i18n plata_tags %}

{% block title %}{% trans "Checkout" %} - {{ block.super }}{% endblock %}

{% block content %}
<h1>{% trans "Checkout" %}</h1>

{% if loginform %}
    <form method="post" action=".">{% csrf_token %}
    <input type="hidden" name="_login" value="1" />
    {% form_errors loginform %}

    <table>
        {{ loginform }}
    <tr>
        <td></td>
        <td><button type="submit">{% trans "Submit" %}</button></td>
    </tr>
    </table>
    </form>
{% endif %}

<form method="post" action=".">
{% csrf_token %}
<input type="hidden" name="_checkout" value="1" />

{% form_errors orderform %}

<table>
<tr><td colspan="2">
<h2>{% trans "Billing address" %}</h2>
</td></tr>

{% if orderform.create_account %}
    {% form_item orderform.create_account %}
{% endif %}

{% form_item orderform.billing_company %}
{% form_item orderform.billing_first_name %}
{% form_item orderform.billing_last_name %}
{% form_item orderform.email %}
{% form_item orderform.billing_address %}
{% form_item orderform.billing_zip_code %}
{% form_item orderform.billing_city %}
{% form_item orderform.billing_country %}

<tr><td colspan="2">
<h2>{% trans "Shipping address" %}</h2>
</td></tr>

<tr><td colspan="2">
        {% form_item_plain orderform.shipping_same_as_billing %}
        {{ orderform.shipping_same_as_billing.label_tag }}
</td></tr>

{% form_item orderform.shipping_company %}
{% form_item orderform.shipping_first_name %}
{% form_item orderform.shipping_last_name %}
{% form_item orderform.shipping_address %}
{% form_item orderform.shipping_zip_code %}
{% form_item orderform.shipping_city %}
{% form_item orderform.shipping_country %}

<tr><td colspan="2">
<h2>{% trans "Notes" %}</h2>
</td></tr>
{% form_item orderform.notes %}
<tr>
    <td></td>
    <td><button type="submit">{% trans "Submit" %}</button></td>
</tr>
</table>
</form>
{% endblock %}
