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

{% load i18n %}
{% load account socialaccount %}

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

{% block content %}
      <h3 class="font-weight-400 mb-4">Log In</h3>
      <form id="loginForm" method="POST" action="{% url 'account_login' %}">
        {% csrf_token %}
        {% if form.non_field_errors %}
          <div class="p-2 my-4">
            {{ form.non_field_errors }}
          </div>
        {% endif %}
        <div class="form-group">
          <label for="username">{% trans "Username" %}</label>
          <input type="text" class="form-control" name="login" id="username" {% if form.login.value != None %}value="{{ form.login.value }}"{% endif %} required placeholder="{% trans 'Enter Your Username' %}">
          {{ form.login.errors }}
        </div>
        <div class="form-group">
          <label for="loginPassword">{% trans "Password" %}</label>
          <input type="password" class="form-control" name="password" id="loginPassword" {% if form.password.value != None %}value="{{ form.password.value }}"{% endif %} required placeholder="{% trans 'Enter Password' %}">
          {{ form.password.errors }}
          {% if redirect_field_value %}
            <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
          {% endif %}
        </div>
        <div class="row">
          <div class="col-sm">
            <div class="form-check custom-control custom-checkbox">
              <input id="remember-me" name="remember" class="custom-control-input" type="checkbox" {% if form.password.value != None %}value="{{ form.password.value }}"{% endif %}>
              <label class="custom-control-label" for="remember-me">{% trans "Remember Me" %}</label>
            </div>
          </div>
          <div class="col-sm text-right"><a class="btn-link" href="{% url 'account_reset_password' %}">{% trans "Forgot Password ?" %}</a></div>
        </div>
        <button class="btn btn-primary btn-block my-4" type="submit">{% trans "Login" %}</button>
      </form>
      <p class="text-3 text-center text-muted">{% trans "Don't have an account?" %}<a class="btn-link px-2" href="{{ signup_url }}">{% trans "Sign Up" %}</a></p>

{% endblock %}
