{% extends "pxy_dashboard/account/base.html" %}
{% load static crispy_forms_tags socialaccount %}


{% block title %}Log In{% endblock title %}

{% block body_attr %}
    class="authentication-bg position-relative"
{% endblock %}

{% block page_content %}
    {% include "pxy_dashboard/partials/background.html" %}

    <div class="account-pages pt-2 pt-sm-5 pb-4 pb-sm-5 position-relative">
        <div class="container">
            <div class="row justify-content-center">
                <div class="col-xxl-4 col-lg-5">
                    <div class="card">

                        <!-- Logo -->
                        <div class="card-header pt-4 text-center">
                            <div class="auth-brand mb-0">
                                <a href="{% url 'index' %}" class="logo-dark">
                                    <span><img src="{% static 'dashboard/images/logo-dark.png' %}" alt="dark logo" height="28"></span>
                                </a>
                                <a href="{% url 'index' %}" class="logo-light">
                                    <span><img src="{% static 'dashboard/images/logo.png' %}" alt="logo" height="28"></span>
                                </a>
                            </div>
                        </div>

                        <div class="card-body p-4">

                            <div class="text-center w-75 m-auto">
                                <h4 class="text-dark-50 text-center pb-0 fw-bold">Sign In</h4>
                                <p class="text-muted mb-4">Use GitHub or your admin email and password to access the dashboard.</p>
                            </div>

{% load socialaccount %}

{% if True %}
  <div class="text-center my-3">
    <a href="{% provider_login_url 'github' %}" class="btn btn-dark">
      <i class="mdi mdi-github me-1"></i> Sign in with GitHub
    </a>
  </div>
{% endif %}

                            <form method="POST" action="{% url 'account_login' %}" novalidate>
                               {% csrf_token %}

                                 {{ form|crispy }}
                                {% if redirect_field_value %}
                                    <input type="hidden" name="{{ redirect_field_name }}"
                                           value="{{ redirect_field_value }}"/>
                                {% endif %}

                                <div class="mb-3 mb-0 text-center">
                                    <button class="btn btn-primary" type="submit"> Log In </button>
                                </div>

                            </form>
                        </div> <!-- end card-body -->
                    </div>
                    <!-- end card -->

                    <div class="row mt-3">
                        <div class="col-12 text-center">
                            <p class="text-white-50">Don't have an account? <a href="{{ signup_url }}"
                                    class="text-white ms-1 link-offset-3 text-decoration-underline"><b>Sign Up</b></a>
                            </p>
                        </div> <!-- end col -->
                    </div>
                    <!-- end row -->

                </div> <!-- end col -->
            </div>
            <!-- end row -->
        </div>
        <!-- end container -->
    </div>
    <!-- end page -->

    <footer class="footer footer-alt">
        <span class="text-white-50">
            <script>document.write(new Date().getFullYear())</script> © Polisplexity - Coderthemes.com
        </span>
    </footer>
{% endblock %}
