{% extends "base.html" %}
{% load i18n baseurl cache legalpages locale %}

{% block title %}{% trans "Register" %} | {{ block.super }}{% endblock %}

{% block breadcrumbs %}
{{ block.super }}<li>{% trans "Register" %}</li>
{% endblock %}
 
{% block content %}
<div id="register" class="form" dir="{% locale_dir %}">
    <h2>{% trans "Register a New Pootle Account" %}</h2>
    <p>{% trans "Fill in the following form to get started translating." %}</p>
    <form method="post" action="" name="registerform" id="registerform">
    {% csrf_token %}
    {% if form.non_field_errors %}
        {{ form.non_field_errors }}
    {% endif %}
    <p>
        <label for="username">{% trans "Username" %}</label>
        {{ form.username }}
        {{ form.username.errors }}
    </p>
    <p>
        <label for="email">{% trans "Email Address" %}</label>
        {{ form.email }}
        {{ form.email.errors }}
    </p>
    <p>
        <label for="password1">{% trans "Password" %}</label>
        {{ form.password1 }}
        {{ form.password1.errors }}
    </p>
    <p>
        <label for="password2">{% trans "Password (again)" %}</label>
        {{ form.password2 }}
        {{ form.password2.errors }}
    </p>
    {% cache settings.CACHE_TIMEOUT legalpages_reg LANGUAGE_CODE %}
    {% get_legalpages as legalpages reg %}
    {% if legalpages %}
    <p>{% trans "Make sure to read the following:" %}</p>
    <ul>
    {% for lp in legalpages %}
    <li><a href="{{ lp.get_absolute_url }}" class="fancybox">{% if lp.url %}<i class="icon-external-link"></i> {% endif %}{{ lp.localized_title }}</a></li>
    {% endfor %}
    </ul>
    {% endif %}
    {% endcache %}
    <p class="buttons">
        <input type="submit" class="register" name="register" value="{% trans 'Register' %}" />
    </p>
</form>
</div>

<h2 class="formlink">{% trans "Already have an account?" %}
    <a href='{{ "/accounts/login/"|l }}' title="{% trans "Log In." %}">{% trans "Log In." %}</a>
</h2>
{% endblock %}

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