diff options
author | Matthew Lemon <y@yulqen.org> | 2024-09-04 12:07:17 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-09-04 12:07:17 +0100 |
commit | 370b16f4156ccdc9956dedc00e5dfb6106380d9d (patch) | |
tree | d5d3b1ed80c8e84680f3512a1b4286472dfffffd /core/templates | |
parent | a26857dfb80c5427fd819fd231994ea5be187a9f (diff) |
UI changes
- ripped out more w3 stuff
- better login page template
- redirects to home after successful login
Diffstat (limited to 'core/templates')
-rw-r--r-- | core/templates/core/base.html | 13 | ||||
-rw-r--r-- | core/templates/registration/login.html | 101 |
2 files changed, 63 insertions, 51 deletions
diff --git a/core/templates/core/base.html b/core/templates/core/base.html index 682395f..1bf6886 100644 --- a/core/templates/core/base.html +++ b/core/templates/core/base.html @@ -5,25 +5,12 @@ <head> <meta charset="UTF-8"/> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> -{# <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">#} <link rel="stylesheet" href="{% static 'css/output.css' %}"> <link rel="preconnect" href="https://fonts.gstatic.com"> - <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700' rel='stylesheet' type='text/css'/> -{# <link rel="stylesheet" href="{% static 'css/styles.css' %}"/>#} <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <script src="https://unpkg.com/htmx.org@1.9.0" integrity="sha384-aOxz9UdWG0yBiyrTwPeMibmaoq07/d3a96GCbb9x60f3mOt5zwkjdbcHFnKH8qls" crossorigin="anonymous"></script> <title>{% block title %}{% endblock title %}</title> {% block extra_head_tags %}{% endblock extra_head_tags %} - <style type="text/css" media="screen"> - - * { - font-family: "Roboto Slab"; - } - - body, h1, h2, h3, h4, h5, h6 { - font-family: "Roboto Slab", sans-serif; -} - </style> </head> <body> {% block navbar %} diff --git a/core/templates/registration/login.html b/core/templates/registration/login.html index 9e00087..f2f0284 100644 --- a/core/templates/registration/login.html +++ b/core/templates/registration/login.html @@ -1,43 +1,68 @@ {% extends "core/base.html" %} +{% load widget_tweaks %} +{% load static %} {% block content %} -<div class="w3-container"> - {% if form.errors %} - <p>Your username and password didn't match. Please try again.</p> - {% endif %} - - {% 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 %} - - <form method="post" action="{% url 'login' %}"> - {% csrf_token %} - <div class="form-group"> - {{ form.username.label_tag }} - {{ form.username }} - </div> - - <div class="form-group"> - {{ form.password.label_tag }} - {{ form.password }} - </div> - - <div class="form-group"> - <button type="submit" class="btn btn-primary" value="login">Log In</button> - </div> - <input type="hidden" name="next" value="{{ next }}"> - </form> - - <div class="form-group"> - {# Assumes you set up the password_reset view in your URLconf #} - <a href="{% url 'password_reset' %}">Lost password?</a> - </div> - - {% endblock content %} +{# <div class="container">#} +{# {% if form.errors %}#} +{# <p>Your username and password didn't match. Please try again.</p>#} +{# {% endif %}#} +{##} +{# {% 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 %}#} + + <div class="flex min-h-full flex-col justify-center px-6 py-12 lg:px-8"> + <div class="sm:mx-auto sm:w-full sm:max-w-sm"> + <p class="text-center font-bold text-3xl">Defence Nuclear Security Regulator Engagement Database (DED)</p> + <h2 class="mt-10 text-center text-2xl font-bold leading-9 tracking-tight text-gray-900">Sign in to your + account</h2> + </div> + + <div class="mt-10 sm:mx-auto sm:w-full sm:max-w-sm"> + <form class="space-y-6" action="{% url 'login' %}" method="POST"> + {% csrf_token %} + <div> +{# <label for="email" class="block text-sm font-medium leading-6 text-gray-900">Email address</label>#} + {{ form.username.label_tag }} + <div class="mt-2"> +{# <input id="email" name="email" type="email" autocomplete="email" required#} +{# class="block w-full rounded-md border-0 p-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6">#} + {% render_field form.username class+="block w-full rounded-md border-0 p-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6" %} + </div> + </div> + + <div> + <div class="flex items-center justify-between"> +{# <label for="password" class="block text-sm font-medium leading-6 text-gray-900">Password</label>#} + {{ form.password.label_tag }} + <div class="text-sm"> + <a href="#" class="font-semibold text-indigo-600 hover:text-indigo-500">Forgot password?</a> + </div> + </div> + <div class="mt-2"> +{# <input id="password" name="password" type="password" autocomplete="current-password" required#} +{# class="block w-full rounded-md border-0 p-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6">#} + {% render_field form.password class+="block w-full rounded-md border-0 p-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6" %} + </div> + </div> + + <div> + <button type="submit" + class="flex w-full justify-center rounded-md bg-indigo-600 px-3 py-1.5 text-sm font-semibold leading-6 text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"> + Sign in + </button> + </div> + </form> + </div> + </div> + + +{% endblock content %} </div> |