{% extends "registration/registration_base.html" %}
{% load i18n %}

{% block cscontent %}
<h1>{% trans "Register" %}</h1>
{% if user.is_authenticated %}
<h2>{% trans "You are already logged in" %}</h2>
{% else %}
{% if  form.non_field_errors  %}
<ul class="error">
   {% for error in form.non_field_errors %}
   <li>{{ error }}</li>
   {% endfor %}
</ul>
{% endif %}

<form action="{{request.path}}" method="POST">
{% csrf_token %}
{{form.username.errors }}
<p>
<label for="username">{% trans "Username" %}</label>

{{form.username }}
{{form.email.errors}}
</p>
<p>
<label form="email">{% trans "Email" %}</label>
   {{form.email}}
{{form.password1.errors}}
</p>
<p>
<label for="password1">{% trans "Password" %}</label>

   {{form.password1}}
</p>
<p>
<label for="password2">{% trans "Confirm password" %}</label>

   {{form.password2}}
</p>
<p>
<input type="submit" value="{% trans "Create account" %}" class="submit" />
</p>
</form>
{% endif %}
{% endblock %}
{% block cssidebar %}
{% if user.is_authenticated %}
{% else %}
<h2>{% trans "Register using Facebook or Twitter" %}</h2>
<p>
<a rel="nofollow" href="{% url 'socialauth_begin' "twitter" %}{% if next %}?next={{next}}{% endif %}"><img src="{{STATIC_URL}}img/twitter_login.jpg" alt="Twitter logo" /></a>
<a rel="nofollow" href="{% url 'socialauth_begin' "facebook" %}{% if next %}?next={{next}}{% endif %}"><img src="{{STATIC_URL}}img/facebook_login.jpg" alt="Facebook logo" /></a>
</p>
{% endif %}
{% endblock %}


