{% extends 'yaccounts/base.html' %}

{% load i18n %}

{% load staticfiles %}

{% block body %}

<div class="container">
  <div class="row">
    <div class="col-sm-6 col-md-4 col-md-offset-4">
      <h1 class="text-center login-title">{% trans 'Login' %}</h1>
      
      <!-- Frame -->
      <div class="account-wall">

        <img class="profile-img" src="{% static 'yaccounts/images/avatar_default.png' %}" alt="Avatar">

        <!-- Social Auth -->
        <div class="social-box">
          <div class="row mg-btm">
            <div class="col-md-12">
              <a href="{% url 'yaccounts:facebook_login' %}{% if next %}?next={{ next }}{% endif %}" class="btn btn-primary btn-block">
                <i class="fa fa-facebook-square"></i></i>
                &nbsp;&nbsp;{% trans 'Login with Facebook' %}
              </a>
            </div>
          </div>
          <br>
          <div class="row">
            <div class="col-md-12">
              <a href="{% url 'yaccounts:twitter_login' %}{% if next %}?next={{ next }}{% endif %}" class="btn btn-info btn-block" >
                <i class="fa fa-twitter-square"></i>
                &nbsp;&nbsp;{% trans 'Login with Twitter' %}
              </a>
            </div>
          </div>
        </div>
        
        <!-- Divider -->
        <div class="login-or">
          <hr class="hr-or">
          <span class="span-or">or</span>
        </div>
        
        <!-- Django Messages -->
        {% include 'yaccounts/django_messages.html' %}

        <!-- Email Login -->
        <form class="form-signin" method="POST" action="{% url 'yaccounts:login' %}">
          {% csrf_token %}

          <!-- Email -->
          <input type="text" class="form-control" placeholder="{% trans 'Email' %}" name="email" value="{{ email }}" required autofocus>

          <!-- Password -->
          <input type="password" class="form-control" placeholder="{% trans 'Password' %}" name="password" required>
          
          <!-- Page to redirect after login -->
          {% if next %}
            <input type="hidden" name="next" value="{{ next }}">
          {% endif %}
          
          <!-- Submit -->
          <button class="btn btn-lg btn-default btn-block" type="submit">{% trans 'Sign in' %}</button>

          <!-- Keep account logged in -->
          <label class="checkbox pull-left"><input type="checkbox" value="remember-me" name="remember"> {% trans 'Remember me' %}</label>
          
          <!-- Reset password -->
          <a href="{% url 'yaccounts:reset' %}" class="pull-right need-help">{% trans 'Forgot password?' %} </a>

          <span class="clearfix"></span>
        </form>
      
      </div>

      <a href="{% url 'yaccounts:create' %}" class="text-center new-account">{% trans 'Create an account' %}</a>

    </div>
  </div>
</div>

{% endblock %}