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

{% load i18n %}
{% load account %}
{% load url from future %}

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

{% block content %}

  <h1>{% trans "Sign In" %}</h1>

  {% if socialaccount.providers  %}
    <p>You can sign in to KarmaNotes with any of the existing accounts you might have below.
    Or, <a href="{{ signup_url }}">sign up</a> for a KarmaNotes account and sign in below.</p>

    <div class="socialaccount_ballot">

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

    </div>

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

  <form class="login" method="POST" action="{% url 'account_login' %}">
    {% csrf_token %}
    {{ form.as_p }}
    {% if redirect_field_value %}
      <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
    {% endif %}
      <a class="button secondaryAction" href="{% url 'account_reset_password' %}">{% trans "Forgot Password?" %}</a>
    <button class="primaryAction" type="submit">{% trans "Sign In" %}</button>
  </form>

{% endblock %}
