{% extends "account/layout_card.html" %}

{% load account bootstrap3 crispy_forms_tags i18n socialaccount %}

{% block head_title %}{% trans "Sign In" %}{% endblock %}

{% block content %}

  <h5 class="card-title">
    {% trans "Sign In" %}
  </h5>

  <form class="login" method="POST" action="{% url 'account_login' %}">
    {% csrf_token %}
    {{ form|crispy }}
    {% if redirect_field_value %}
      <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/>
    {% endif %}

    <p>
      {% blocktrans %}If you have not created an account yet, then please
        <a href="{{ signup_url }}">register</a> first.{% endblocktrans %}
    </p>

    <br><br>

    <div class="">
      <button class="btn btn-primary" type="submit">
        {% trans "Sign In" %}
      </button>
      &nbsp;
      <a class="btn btn-link" href="{% url 'account_reset_password' %}">
        {% trans "Forgot Password?" %}
      </a>
    </div>

  </form>


  {% get_providers as socialaccount_providers %}

  {% if socialaccount_providers %}

    <hr>

    <p>{% blocktrans with site.name as site_name %}Please sign in with one
      of your existing third party accounts. Or, <a href="{{ signup_url }}">sign up</a>
      for a {{ site_name }} account and sign in below:{% endblocktrans %}</p>

    <div class="socialaccount_ballot">

      <ul class="socialaccount_providers">
        {% include "socialaccount/parts/provider_list.html" with process="login" %}
      </ul>

      <div class="login-or">{% trans 'or' %}</div>

    </div>

    {% include "socialaccount/parts/login_extra.html" %}

  {% endif %}

{% endblock %}
