{% load i18n %}

{% block billing-info %}
    <tr><td colspan="2"><h4>{% trans "Billing Information" %}</h4></td></tr>

    <tr><td><label for="id_addressee">{% trans "Bill To" %}</label><p class="help">{% trans "If different from the first and last names above" %}</p></td><td> {{ form.addressee }}</td></tr>
    {% if form.addressee.errors %}<tr><td class="error" colspan="2">*** {{ form.addressee.errors|join:", "}}</td></tr>{% endif %}

    <tr><td><label for="id_street1">{% trans "Street" %}{% if form.street1.field.required %}*{% endif %}</label></td><td> {{ form.street1 }}</td></tr>
    {% if form.street1.errors %}<tr><td class="error" colspan="2">*** {{ form.street1.errors|join:", " }}</td></tr>{% endif %}

    <tr><td><label for="id_street2">{% trans "Street" %}</label></td><td> {{ form.street2 }}</td></tr>
    {% if form.street2.errors %}<tr><td class="error" colspan="2">*** {{ form.street2.errors|join:", " }}</td></tr>{% endif %}

    <tr><td><label for="id_city">{% trans "City" %}{% if form.city.field.required %}*{% endif %}</label></td><td> {{ form.city }}</td></tr>
    {% if form.city.errors %}<tr><td class="error" colspan="2">*** {{ form.city.errors|join:", " }}</td></tr>{% endif %}

    {% if country %}
      {% if form.fields.state.choices %}
      <tr>
        <td><label for="id_state">{% if country.get_admin_area_display %}{{ country.get_admin_area_display }}{% else %}{% trans "State/Province" %}{% endif %} {% if form.state.field.required %}*{% endif %}</label></td>
        <td><p id="id_state_loading" style="display: none">Loading...</p> {{ form.state }}</td>
      </tr>
      {% endif %}
    {% else %}
      <tr>
        <td><label for="id_state">{% trans "State/Province" %} {% if form.state.field.required %}*{% endif %}</label></td>
        <td><p id="id_state_loading" style="display: none">Loading...</p> {{ form.state }}</td>
      </tr>
    {% endif %}
    {% if form.state.errors %}<tr><td class="error" colspan="2">*** {{ form.state.errors|join:", " }}</td></tr>{% endif %}

    <tr><td><label for="id_postal_code">{% trans "Zipcode/Postcode" %}{% if form.postal_code.field.required %}*{% endif %}</label></td><td> {{ form.postal_code }}</td></tr>
    {% if form.postal_code.errors %}<tr><td class="error" colspan="2">*** {{ form.postal_code.errors|join:", " }}</td></tr>{% endif %}

    {% if not country %}
    <tr><td><label for="id_country">{% trans "Country" %}</label></td><td> {{ form.country }}</td></tr>
    {% if form.country.errors %}<tr><td class="error" colspan="2">*** {{ form.country.errors|join:", " }}</td></tr>{% endif %}
    {% endif %}
{% endblock %}
