{% extends "registration/registration_base.html" %}
{% load i18n %}
{% block cscontent %}
{% if user.is_authenticated %}
{% else %}
<h2>{% trans "Sign in" %}</h2>

<form action="{% url 'registration_register' %}">
<p>{% trans "I'm new here. Create account" %}</p>
<input type="submit" value="{% trans "Create account" %}" class="submit" />
</form>

<h2>{% trans "Sign in 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 icon" /></a>
<a rel="nofollow" href="{% url 'socialauth_begin' "facebook" %}{% if next %}?next={{next}}{% endif %}"><img src="{{STATIC_URL}}img/facebook_login.jpg" alt="Facebook icon" /></a>
</p>
<p>{% trans "You can use your Facebook or Twitter accounts to log in" %}</p>

{% endif %}

{% endblock %}


{% block cssidebar %}
<h2>{% trans "Log in" %}</h2>

{% if user.is_authenticated %}
<p>{% trans "You are already logged in" %}</p>
{% else %}

<form method="post" action="{% url 'auth_login' %}">
{% csrf_token %}
{% if form.errors %}
<ul class="errorlist"><li>{% trans "Your username and password do not match. Please try again." %}</li></ul>
{% endif %}

<p><label for="username">{% trans "Username" %}</label>
{{ form.username }}</p>
<p><label for="password">{% trans "Password" %}</label>
{{ form.password }}</p>
<p>
<input type="submit" value="{% trans "Sign in"%}" class="submit" />
<input type="hidden" name="next" value="{{ next }}" />
</p>

</form>

<ul>
<li><a href="{% url 'auth_password_reset' %}">{% trans "I have forgotten my password" %}</a></li>
<li><a href="{% url 'registration_register' %}">{% trans "I'm new here. Create account" %}</a></li>
</ul>
{% endif %}

{% endblock %}