{% extends "base.html" %}
{% load i18n %}
{% load translations %}
{% load authnames %}
{% load crispy_forms_tags %}

{% block breadcrumbs %}
<li><a href="{% url 'login' %}">{% trans "Sign in" %}</a></li>
{% endblock %}

{% block content %}

<div class="container">

{% if form.errors %}
{% trans "This username/password combination was not found. Please try again." as msg %}
{% show_message "error" msg %}
{% endif %}

<h2>{{ site_title }}</h2>
<div class="row">

<div class="col-sm-7">
{% include "snippets/login-info.html" %}
</div>

<div class="col-sm-5">

<h4>{% trans "Sign in" %}</h4>
<div class="panel panel-default">
  <div class="panel-body">
<form method="post" action="{% url 'login' %}">

{% csrf_token %}
{{ form|crispy }}

<input type="hidden" name="next" value="{{ next }}" />

<input type="submit" value="{% trans "Sign in" %}" class="btn btn-primary btn-full" />
</form>

{% if login_backends %}

<h5 class="login-label">{% trans "Sign in with:" %}</h5>

{% for name in login_backends %}
  <div class="col-sm-6 col-xs-12 btn-auth">
    <a class="btn btn-default link-post" href="{% url 'social:begin' name %}" {% if next %}data-params='{"next": "{{ next|escapejs }}"}'{% endif %}>{% auth_name name " " %}</a>
  </div>
{% endfor %}

{% endif %}

{% if can_reset or registration_open %}
<div class="clearfix"></div>
<ul class="login-links">
{% if can_reset %}
{% url 'password_reset' as reset_url %}
<li><a href="{{ reset_url }}">{% trans "Forgot your password?" %}</a></li>
{% endif %}

{% if registration_open %}
{% url 'register' as register_url %}
<li><a href="{{ register_url }}">{% trans "Register new account" %}</a></li>
{% endif %}
</ul>
{% endif %}



</div>
</div>

</div>
</div>
</div>

{% endblock %}
