stylised the login page

This commit is contained in:
Faraphel 2024-01-04 23:22:06 +01:00
parent d55ac2e4f8
commit 6a7a824a7e
9 changed files with 48 additions and 22 deletions

View file

@ -0,0 +1,11 @@
#login-form {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
#login-form input {
box-sizing: border-box;
width: 100%;
}

View file

@ -1,6 +1,8 @@
{% extends "Palto/base.html" %} {% extends "Palto/base/base-features.html" %}
{% block body %} {% block body %}
{{ block.super }}
<h1>Palto</h1> <h1>Palto</h1>
<p> <p>

View file

@ -12,7 +12,7 @@
<form id="login-form" method="POST"> <form id="login-form" method="POST">
{% csrf_token %} {% csrf_token %}
<table> <table>
{{ form_login.as_table }} {{ form_login.as_p }}
</table> </table>
<input type="submit" value="Se connecter"> <input type="submit" value="Se connecter">
</form> </form>

View file

@ -1,7 +1,9 @@
{% extends "Palto/base.html" %} {% extends "Palto/base/base-features.html" %}
{% load dict_tags %} {% load dict_tags %}
{% block body %} {% block body %}
{{ block.super }}
{{ profile.username }} {{ profile.username }}
{{ profile.email }} {{ profile.email }}
{% if profile.is_superuser %}Administrator{% endif %} {% if profile.is_superuser %}Administrator{% endif %}

View file

@ -1,6 +1,8 @@
{% extends "Palto/base.html" %} {% extends "Palto/base/base-features.html" %}
{% block body %} {% block body %}
{{ block.super }}
{# group's information #} {# group's information #}
<table> <table>
<tr> <tr>

View file

@ -1,6 +1,7 @@
{% extends "Palto/base.html" %} {% extends "Palto/base/base-features.html" %}
{% block body %} {% block body %}
{{ block.super }}
{# table of all the sessions #} {# table of all the sessions #}
<table> <table>
<thead> <thead>

View file

@ -1,7 +1,9 @@
{% extends "Palto/base.html" %} {% extends "Palto/base/base-features.html" %}
{% load dict_tags %} {% load dict_tags %}
{% block body %} {% block body %}
{{ block.super }}
{# session's information #} {# session's information #}
<table> <table>
<tr> <tr>

View file

@ -1,7 +1,9 @@
{% extends "Palto/base.html" %} {% extends "Palto/base/base-features.html" %}
{% load dict_tags %} {% load dict_tags %}
{% block body %} {% block body %}
{{ block.super }}
{# unit's information #} {# unit's information #}
<table> <table>
<tr> <tr>

View file

@ -24,6 +24,8 @@ def homepage_view(request: WSGIRequest):
def login_view(request: WSGIRequest): def login_view(request: WSGIRequest):
# create a login form # create a login form
if request.POST:
form_login = forms.LoginForm(request.POST) form_login = forms.LoginForm(request.POST)
if form_login.is_valid(): if form_login.is_valid():
@ -42,6 +44,8 @@ def login_view(request: WSGIRequest):
else: else:
# otherwise the credentials were invalid. # otherwise the credentials were invalid.
form_login.add_error(field=None, error="Invalid credentials.") form_login.add_error(field=None, error="Invalid credentials.")
else:
form_login = forms.LoginForm()
# return the page # return the page
return render( return render(