{% extends 'trosnoth/base.html' %}

{% block loginbar %}
{% endblock %}

{% block main %}
  <div id="container">
    <h2>Login</h2>
    {% if user.is_authenticated %}
      <div id="message">
        You are already logged in as
        <a href="{% url 'trosnoth:profile' userId=user.pk nick=user.trosnothuser.nick  %}"
        >{{ user.trosnothuser.nick }}</a>.
        <a href="{% url 'logout' %}">Click here</a> to log out.
      </div>
    {% else %}
      <form method="post">
        {% csrf_token %}
        {{ form.as_p }}
        <button type="submit">Login</button>
      </form>
    {% endif %}
  </div>
{% endblock %}