{% extends "form.jinja2" %}

{% block title %}Log In{% endblock %}

{% block content %}
<h1>Log In</h1>

{% if status %}
<div class="status {{status_type}}">{{status}}</div>
{% endif %}

{% if logged_in %}
<div class="login-action logout">You are already logged in. <a href="{{request.relative_url('logout')}}">Log out.</a></div>
{% else %}
<form class="uniForm login" action="{{request.url}}" method="POST">
  <fieldset class="inlineLabels">
    <legend>Halt and be identified.</legend>
    <div class="ctrlHolder">
      <label for="username">Username</label>
      <input type="text" name="username" class="textInput" value="{{username}}" />
      <p class="formHint">May contain only letters, numbers, or one of @, _, .</p>
    </div>
    <div class="ctrlHolder">
      <label for="password">Password</label>
      <input type="password" class="textInput" name="password" />
    </div>
  </fieldset>
  <div class="buttonHolder">
    <input type="hidden" name="came_from" value="{{request.params.get('came_from', '')}}" />
    <input class="primaryAction" type="submit" value="Log-In" name="form.submitted" />
  </div>
  <div class="ctrlHolder">
    {{ signup_link }}
    {{ password_reset_link }}
  </div>
</form>

{% endif %}

{% endblock %}
