{% extends "base.html" %}
{% load browserid %}
{% load i18n %}
{% load staticfiles %}
{% load wger_extras %}

{% block title %}{% trans "Login" %}{% endblock %}


{% block header %}
<link rel="stylesheet" href="{% static 'browserid/persona-buttons.css' %}">
<script src="https://login.persona.org/include.js"></script>
<script src="{% static 'browserid/api.js' %}"></script>
<script src="{% static 'browserid/browserid.js' %}"></script>

{% browserid_info %}
{% endblock %}

{% block content %}
<form action="{% url 'core:user:login' %}{% if next %}?next={{next}}{% endif %}"
      method="post"
      class="form-horizontal">
    {% trans 'Login' as submit_text %}
    {% render_form_fields form submit_text %}
</form>

{% if not hide_persona %}
<div class="col-md-offset-3 col-md-9">

<div style="text-align:center;">
<h3>— {% trans "or" %} —</h3>
    <div style="padding-top:1em;"></div>
    <a id="browserid-login"
       href="#"
       class="browserid-login persona-button dark browserid-login"
       data-site-name="Workout Manager"
       data-next="/">
        <span>{% trans "Sign in with your Email" %}</span>
    </a>
</div>

<p>
    {% blocktrans %}Persona (BrowserID) replaces multiple passwords, you don't
    need to remember a new password for this site. For more information, please
    take a look at the <a href="https://login.persona.org/" target="_blank">the
    Persona website</a>.{% endblocktrans %}
</p>
</div>
{% endif %}
{% endblock %}


{% block sidebar %}
<h4>{% trans "No account?" %}</h4>
<p>
    <a href="{% url 'core:user:registration' %}" {% auto_link_css flavour %}>
        <img src="{% static 'images/icons/register.svg' %}"
             width="32"
             height="32"
             alt="{% trans 'Register' %}">
        {% trans "Register" %}</a>
</p>

<h4>{% trans "Forgot password?" %}</h4>
<p>
    <a href="{% url 'core:user:password_reset' %}" {% auto_link_css flavour %}>
        <img src="{% static 'images/icons/reset-password.svg' %}"
             width="32"
             height="32"
             alt="{% trans 'Reset password' %}">
        {% trans "Reset password" %}</a>
</p>
{% endblock %}
