{% extends "site_base.html" %}

{% load url from future %}
{% load i18n %}
{% load bootstrap_tags %}

{% block head_title %}{% trans "Sign up" %}{% endblock %}

{% block body %}
<div class="row">
  <div class="col-md-8">
  {% if REGISTRATION_OPEN %}
    <form id="signup_form" method="post" action="{% url "account_signup" %}" autocapitalize="off" class="form-horizontal"{% if form.is_multipart %} enctype="multipart/form-data"{% endif %}>
      <legend>{% trans "Sign up" %}</legend>
      <fieldset>
      {% csrf_token %}
      {{ form|as_bootstrap }}
      {% if redirect_field_value %}
        <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
      {% endif %}
        <div class="form-actions">
          <button type="submit" class="btn btn-primary">{% trans "Sign up" %}</button>
        </div>
      </fieldset>
    </form>
    {% else %}
    <p>{% trans "Sorry, registrations are not open at this time." %}</p>
    {% endif %}
  </div>
  <div class="col-md-4">
    {% include "account/_signup_sidebar.html" %}
  </div>
</div>
{% endblock %}

{% block extra_script %}
    <script type="text/javascript">
        $(document).ready(function() {
            $('#id_username').focus();
        });
    </script>
{% endblock %}
