{% extends "rest_framework/login_base.html" %}

{% block bootstrap_theme %}
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
        rel="stylesheet"
        integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
        crossorigin="anonymous">

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
        integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
        crossorigin="anonymous"></script>

    <link rel="stylesheet"
        href="https://code.jquery.com/ui/1.12.1/themes/ui-lightness/jquery-ui.css"
         crossorigin="anonymous">

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"
        crossorigin="anonymous"></script>

    <script
      src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"
      crossorigin="anonymous"></script>

    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css">

    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/v4-shims.css">
{% endblock %}

{% block body %}
<div class="container">

<h1 class="header page-header">Login</h1>

{% if next %}
  {% if user.is_authenticated %}
    <p class="alert alert-info">Your account doesn't have access to this page. To proceed,
    please login with an account that has access.</p>
  {% endif %}
{% endif %}

{% load crispy_forms_tags %}

<form method="post" action="{% url 'login' %}">
{% csrf_token %}
{{ form|crispy }}
<input type="submit" class="btn btn-primary" value="Login Locally" />
<input type="hidden" name="next" value="{{ next }}" />
</form>

{% if form.errors %}
  <br/>
  <p class="alert alert-info">If you dont have an account use Guest / user1234</p>
{% endif %}

{% if settings.SOCIAL_AUTH_GITHUB_KEY %}
<hr/>
<a class="btn btn-info" role="button" href="{% url 'social:begin' 'github' %}?next={{ next }}">
    <i class="fa fa-github" aria-hidden="true"></i>
    Login with GitHub</a>
{% endif %}

<!-- ROOT_URLCONF {{ settings.ROOT_URLCONF }} -->
</div>
{% endblock %}