{% extends "checkout/layout.html" %}
{% load currency_filters %}
{% load i18n %}

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

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

{% block content %}

<div class="sub-header">
	<h2>{% trans "Who are you?" %}</h2>
</div>

<form action="." method="post" class="form-stacked well">
	{% csrf_token %}
	{{ form.non_field_errors }}
	
	<div class="control-group {% for error in form.username.errors %}error{% endfor %}">
		<label for="id_username" class="control-label {% if form.username.field.required %}required{% endif %}">Your email address{% if form.username.field.required %} <span>*</span>{% endif %}</label>
		<div class="controls">
		    {{ form.username }}
		    {% for error in form.username.errors %}
				<span class="help-block">
					{{ error|escape }}
				</span>
            {% endfor %}
		</div>
	</div>
	
	<div class="control-group">
		{{ form.options.errors }}
		<div class="controls">
			<label class="radio">
			     <input type="radio" id="id_options_1" name="options" value="existing" {% if form.password.errors %}checked="checked"{% endif %} />
				 {% trans "I have an account and my password is" %}:
			</label>
		</div>
	</div>
	
	<div class="control-group {% for error in form.password.errors %}error{% endfor %}">
		<div class="controls">
		    {{ form.password }}
		    {% for error in form.password.errors %}
				<span class="help-block">
					{{ error|escape }}
				</span>
            {% endfor %}
		</div>
	</div>	
			
	<p><a href="{% url password-reset %}">{% trans "Get a password reminder" %}</a></p>
	
	<div class="control-group">
		<div class="controls">
			<label class="radio">
			     <input type="radio" id="id_options_0" name="options" value="new" {% if not form.password.errors %}checked="checked"{% endif %} />
				 {% trans "I don't want to create an account" %}:
			</label>
		</div>
	</div>
		
	<div class="form-actions">
		<button type="submit" class="btn btn-large btn-primary">{% trans "Continue" %}</button>
		{% trans "Alternatively" %} <a href="{% url customer:register %}?next={% url checkout:index %}">{% trans "create an account" %}</a> {% trans "before you checkout." %}
	</div>
</form>

{% endblock content %}

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