{% extends "base.html" %}
{% load url from future %}
{% load i18n %}

{% block content %}

{% if form.errors %}
<div class="ui-widget">
    <div style="padding: 0pt 0.7em;" class="ui-state-error ui-corner-all"> 
        <p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-alert"></span>
        {% trans "This username/password combination was not found. Please try again." %}
        </p>
    </div>
</div>
{% endif %}

<h2>{% trans "Password login" %}</h2>

{% if demo_server %}
<p>{% trans "To test Weblate, you can login as <code>demo</code> user with password <code>demo</code>." %}</p>
{% endif %}

<form method="post" action="{% url 'login' %}">
{% csrf_token %}
<table>
{{ form.as_table }}
</table>

<input type="submit" value="{% trans "Login" %}" class="button" />
<input type="hidden" name="next" value="{{ next }}" />
</form>

{% if registration_open %}
<p>
{% url 'register' as register_url %}
{% blocktrans %}Do not have an account yet? You can <a href="{{ register_url }}">register</a>.{% endblocktrans %}
</p>
{% endif %}

<p>
{% url 'password_reset' as reset_url %}
{% blocktrans %}Forgot your password? You can <a href="{{ reset_url }}">reset it</a>.{% endblocktrans %}
</p>

{% if login_backends %}

<h2>{% trans "Third party login" %}</h2>

{% for name in login_backends %}
  <a class="button" href="{% url 'social:begin' name %}?next={{ next }}">{{ name }}</a>
{% endfor %}

{% endif %}

{% endblock %}
