{% extends "misago/admin/base_thin.html" %}
{% load i18n static %}


{% block title %}{% trans "Log in" %} | {% if target == "django" %}{% trans "Django Admin" %}{% else %}{% trans "Misago Admin" %}{% endif %}{% endblock %}


{% block body %}
<div class="login-form">

  {% if target == "misago" %}
  <div class="form-admin-logo">
    <img src="{% static 'misago/admin/img/misago.png' %}" alt="Misago">
  </div>
  {% elif target == "django" %}
  <div class="form-admin-logo">
    <img src="{% static 'misago/admin/img/django.png' %}" alt="Django">
  </div>
  {% endif  %}

  <div class="form-panel">
    <form method="POST" role="form">
      {% csrf_token %}

      <div class="form-header">
        <h1>{% trans "Administration" %}</h1>
      </div>

      <div class="form-body no-fieldsets">

        {% for error in form.non_field_errors %}
        <div class="misago-alerts">
          <p class="alert alert-danger lead">
            {{ error }}
            <br>{% trans "Please try again." %}
          </p>
        </div>
        {% endfor %}
        {% for message in messages %}
        <div class="misago-alerts">
          {% if 'success' in message.tags %}
          <p class="alert alert-success lead">
          {% elif 'warning' in message.tags %}
          <p class="alert alert-warning lead">
          {% elif 'error' in message.tags %}
          <p class="alert alert-danger lead">
          {% else %}
          <p class="alert alert-info lead">
          {% endif %}
            {{ message }}
          </p>
        </div>
        {% endfor %}

        <div class="form-group">
          <div class="control-input">
            <input type="text" name="username" class="form-control input-lg" placeholder="{% trans "Username or e-mail" %}" {% if form.username.value %}value="{{ form.username.value }}"{% endif %}>
          </div>
        </div>
        <div class="form-group">
          <div class="control-input">
            <input type="password" name="password" class="form-control input-lg" placeholder="{% trans "Password" %}">
          </div>
        </div>
        <div class="form-group">
          <div class="control-input">
            <button class="btn btn-primary btn-block btn-lg">{% trans "Sign in" %}</button>
          </div>
        </div>

      </div>


    </form>
  </div>

</div>
{% endblock body %}
