{% extends "fa/foneastra_base.html" %}

{% load i18n %}

{% block page_stylesheets %}
<style>
    #branding h1 {
            background: url("/media/images/CSElogoText_65.png") no-repeat 100% 50%;
    }

    #branding h1 b {
        height: 65px;
        display: block;
        text-indent: -9999px;
        background: url("/media/images/foneastra.png") no-repeat 0 50%;
    }

    .scform ul.errorlist { list-style-type: none; color:red; margin: 0; padding: 0;}
</style>
{% endblock %}


{% block title %}{% trans "Login" %}{% endblock %}


{% block auth %}
    <div id="auth">
    {% if user.is_authenticated %}
    <p><a href="/fa/logout">{% trans "Log out" %} {{ user.username }}</a></p>
    {% else %}
    <p><a href="/fa/login">{% trans "Log in" %}</a></p>
    {% endif %}
    </div>
{% endblock %}


{% block content %}

{% if form.errors %}
<p>{% trans "Oops. Your username and password didn't match. Please try again." %}</p>
{% endif %}

{% if user.is_authenticated %}
<p>{% trans "You are already logged in." %}</p>

{% else %}

<h1>{% trans "Please log in to FoneAstra" %}</h1>


<form method="post" action="/fa/login">
{% csrf_token %}
<table>
<tr>
    <td>{{ form.username.label_tag }}</td>
    <td>{{ form.username }}</td>
</tr>
<tr>
    <td>{{ form.password.label_tag }}</td>
    <td>{{ form.password }}</td>
</tr>
</table>

<input type="submit" value="{% trans 'Login' %}" />
<input type="hidden" name="next" value="{{ next }}" />
</form>

{% endif %}
{% endblock %}
