{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}

{% block modal-header %}{% trans "Log In" %}{% endblock %}
{% block modal_class %}login {% if hide %}modal hide{% endif %}{% endblock %}

{% block form_action %}{% url 'login' %}{% endblock %}
{% block autocomplete %}{{ HORIZON_CONFIG.password_autocomplete }}{% endblock %}

{% block modal-body %}
  <fieldset>
    {% if request.user.is_authenticated and 'next' in request.GET %}
    <div class="form-group clearfix error">
      <span class="help-block"><p>{% trans "You do not have permission to access the resource:" %}</p>
        <p><b>{{ request.GET.next }}</b></p>
        <p>{% url 'horizon:user_home' as home_url %}{% blocktrans %}Login as different user or go back to <a href="{{ home_url }}"> home page</a>{% endblocktrans %}</p>
      </span>
    </div>
    {% endif  %}
    {% if request.COOKIES.logout_reason %}
    <div class="form-group clearfix error">
      <span class="help-block"><p>{{ request.COOKIES.logout_reason }}</p></span>
    </div>
    {% endif %}
    {% if next %}<input type="hidden" name="{{ redirect_field_name }}" value="{{ next }}" />{% endif %}
    {% include "horizon/common/_form_fields.html" %}
  </fieldset>
{% endblock %}

{% block modal-footer %}
  <button type="submit" class="btn btn-primary pull-right">{% trans "Sign In" %}</button>
{% endblock %}
