{% extends 'base.html' %}

{% block content %}
<!-- To understand how this all works, with invisible default behaviour, see

troggle/templates/login/logout.html
troggle/templates/registration/ 

because magic 
This is because Django is Opinionated and does lots of Invisible Defaults

This file is actually identical to troggle/templates/login/index.html
-->
<div class='middle'>
<h2>Troggle user login</h2>
</div>

{% if message %}
    <div style='width: 350px;'  class='middle3 login'>
        {% if title %}
        <div class='align-center'>
        <h3>{{title}}</h3>
        <div class='space'></div>
        {% endif %}
    <p>{{message }}</p>
    </div>
{% endif %}
<h3>Troggle ordinary user login - no access to Django control panel</h3>
<p>(This is using template registration/login.html)
<div style='width: 250px;'  class='middle3 login'>
<div class='align-center'>

<div class='space'></div>
{% if invalid %}
	<p class='error'>The username and password you provided don't match. Please try again.</p>
	<p>Have you <a href='/accounts/password_reset/'>forgotten your password - reset it</a>?<br/>
	   Or perhaps <a href='/accounts/password_change/'>change your password</a>?</p>
       
    <p>Neither of those links work properly yet, by the way, I'm only trying to *appear* helpful.

	<div class='space'></div>
{% endif %}
<div class='align-center'>
    <form action="" method="post" accept-charset="utf-8">{% csrf_token %}
        <table class='form'>
            <tr><th><label for="id_username">Username:</label></th><td><input id="id_username" type="text" name="username" maxlength="30" /></td></tr>
            <tr><th><label for="id_password">Password:</label></th><td><input type="password" name="password" id="id_password" /></td></tr>
        </table>
        <div class='space'></div>
    
    <br/>
    <p><input type="submit" value="Login &rarr;"></p>
    </form>
	
	<hr/>
	{{form}}
</div>
{% endblock %}
