{% extends "base.html" %}
{% block title %}Login{% endblock %}
{% block path %}&rarr; <a href="/login">login</a>{% endblock %}
{% block includes %}
    <script type="text/javascript">
    $(function() {
        $("#email").focus()
    })
    </script>
{% endblock %}
{% block content %}
    {% if oauth_enabled %}
    <div class="login_block">
        <div class="login_button">
            <div class="heading directions">
                If you have an R'Mail account, please log in with it by clicking
                the button below.
            </div>
            <a href="/login/?type=rmail"><input type="button" value="Login with R'Mail"></a>
        </div>
    </div>
    {% endif %}
    <div class="login_block">
        <form method="post">
            {% if oauth_enabled %}
            <div class="heading directions">
                You can also use your Galah username and password if you were
                assigned one.
            </div>
            {% endif %}
            <div class="fields">
                {{ form.hidden_tag() }}
                <div class="heading">
                    {{ form.email.label }}
                    {% if form.email.errors %}
                    <span class="error">({{ form.email.errors[0] }})</span>
                    {% endif %}
                </div>
                {{ form.email() }}
                <div class="heading">
                    {{ form.password.label }}
                    {% if form.password.errors %}
                    <span class="error">({{ form.password.errors[0] }})</span>
                    {% endif %}
                </div>
                {{ form.password() }}
            </div>
            <div class="login_button">
                <input type="submit" value="Login">
            </div>
        </form>
    </div>
{% endblock %}
