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

{% block breadcrumbs %}
<li><a href="{% url 'register' %}">{% trans "Registration" %}</a></li>
{% endblock %}

{% block content %}


{% if registration_open %}

<div class="container">

{% if form.errors %}
{% trans "Please fix errors in the registration form." 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 "Register using e-mail" %}</h4>

<div class="panel panel-default">
  <div class="panel-body">

{% if registration_email %}

<form action="{% url 'register' %}" method="post" accept-charset="utf-8">

{% csrf_token %}
{{ form|crispy }}
{% if captcha_form %}
{{ captcha_form|crispy }}
{% endif %}
<input type="submit" value="{% trans 'Register' %}" class="btn btn-primary btn-full" />
</form>

{% endif %}

{% if registration_backends %}

<h5 class="login-label">{% trans "Create an account using:" %}</h5>

{% for name in registration_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 %}?next={{ next }}{% endif %}">{% auth_name name " " %}</a>
  </div>
{% endfor %}

{% endif %}

{% else %}

<p>
{% url 'contact' as contact_url %}
{% trans "Sorry, new registrations are turned off on this site." %}
<a href="{{ contact_url }}">{% trans "You can contact us for more details." %}</a>
</p>

{% endif %}


</div>
</div>

</div>
</div>
</div>
{% endblock %}
