{% 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 %}

{% show_message "info" _("By registering you agree to use your name and email in version control system commits and provide your contribution under license defined by each translated project.") %}

{% if form.errors %}
{% show_message "error" _("Please fix errors in the registration form.") %}
{% endif %}
<div class="row">

{% if registration_email %}

<div class="col-lg-6">
<form action="{% url 'register' %}" method="post" accept-charset="utf-8">

<div class="panel panel-primary">
  <div class="panel-heading"><h4 class="panel-title">{% trans "Register using email" %}</h4></div>
  <div class="panel-body">

{% csrf_token %}
{{ form|crispy }}
</div>
<div class="panel-footer">
<input type="submit" value="{% trans 'Register' %}" class="btn btn-default" />
</div>
</div>
</form>
</div>

{% endif %}

{% if registration_backends %}

<div class="col-lg-6">
<div class="panel panel-primary">
  <div class="panel-heading"><h4 class="panel-title">{% trans "Third party registration" %}</h4></div>
  <div class="panel-body">

{% for name in registration_backends %}
  <a class="btn btn-link" href="{% url 'social:begin' name %}">{% auth_name name %}</a>
{% endfor %}
</div>
</div>
</div>

{% endif %}

{% else %}

<p>
{% url 'contact' as contact_url %}
{% blocktrans %}Sorry, but registrations on this site are disabled. You can <a href="{{ contact_url }}">contact us</a> for more details.{% endblocktrans %}
</p>

{% endif %}

{% endblock %}
