{% extends "checkout/layout.html" %}

{% load i18n %}

{% block title %}
    {% trans "Checkout gateway" %} | {{ block.super }}
{% endblock %}

{% block checkout_nav %}
    {% include 'checkout/nav.html' with step=0 %}
{% endblock %}

{% block checkout_title %}{% trans "Who are you?" %}{% endblock %}

{% block content %}

    <form action="." method="post" class="form-stacked well">
        {% csrf_token %}
        {{ form.non_field_errors }}

        {% include "partials/form_field.html" with field=form.username %}

        <div class="control-group">
            <div class="controls">
                <div class="radio">
                    {{ form.options.0 }}
                </div>
            </div>
        </div>

        <div class="control-group {% if form.password.errors %}error{% endif %}">
            {{ form.options.errors }}
            <div class="controls">
                <div class="radio">
                    {{ form.options.2 }}
                    <div class="form-inline">
                        {{ form.password }}
                        <small><a href="{% url 'password-reset' %}" tabindex="-1">{% trans "Get a password reminder" %}</a></small>
                        {% for error in form.password.errors %}
                            <span class="error-block">{{ error }}</span>
                        {% endfor %}
                    </div>
                </div>
            </div>
        </div>

        <div class="control-group">
            <div class="controls">
                <div class="radio">
                    {{ form.options.1 }}
                </div>
            </div>
        </div>

        <div class="form-actions">
            <div class="row-fluid">
                <div class="span3">
                    <button type="submit" class="btn btn-large btn-block btn-primary">{% trans "Continue" %}</button>
                </div>
            </div>
        </div>
    </form>

{% endblock content %}

{% block onbodyload %}
    {{ block.super }}
    oscar.checkout.gateway.init();
{% endblock %}
