{% 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 %}
{% if has_legal %}
<div class="alert alert-info">
{% url 'legal:terms' as legal_url %}
<a href="{{ legal_url }}">{% blocktrans %}Please read our Terms of Service before registering.{% endblocktrans %}</a>
</div>
{% else %}
{% trans "By registering you agree to use your name and e-mail in version control system commits and provide your contribution under license defined by each translated project." as msg %}
{% show_message "info" msg %}
{% endif %}

{% if form.errors %}
{% trans "Please fix errors in the registration form." as msg%}
{% show_message "error" msg %}
{% 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-default">
  <div class="panel-heading"><h4 class="panel-title">{% trans "Register using e-mail" %}</h4></div>
  <div class="panel-body">

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

{% endif %}

{% if registration_backends %}

<div class="col-lg-6">
<div class="panel panel-default">
  <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 link-post" href="{% url 'social:begin' name %}">{% auth_name name %}</a>
{% endfor %}
</div>
</div>
</div>

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

{% endblock %}
