unb-mds/2023-2-Squad06

View on GitHub
templates/registration/login.html

Summary

Maintainability
Test Coverage
{% extends "base.html" %}

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

{% block content %}

{% if next %}
  {% if user.is_authenticated %}
    <p>
      Your account doesn't have access to this page. To proceed, please login
      with an account that has access.
    </p>
  {% else %}
    <p>
      Please login to see this page.
    </p>
  {% endif %}
{% endif %}

{% load crispy_forms_tags %}

<form method="post" action="{% url 'login' %}">
  {% csrf_token %}

  <div class="row justify-content-center">
    <div class="col-md-9">
      <div class="card">
        <div class="card-header">
          Sign in to your account
        </div>
        <div class="card-body">
          {{ form|crispy }}

          <input type="submit" class="btn btn-primary" style="width: 100%; margin-top: 25px;" value="Login">
          <input type="hidden" name="next" value="{{ next }}">
        </div>
      </div>
    </div>
  </div>
</form>

{% endblock %}