{% extends "base_bootstrap.html" %}

{% block title %} Login {% endblock %}

{% block content %}

<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 }} -->

{% endblock %}

