From 6aa6ef9023de45909c5ef731c51b2a146bb0a7df Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 5 Oct 2020 14:39:44 +0000 Subject: [PATCH] update login view --- fet2020/authentications/forms.py | 6 + fet2020/authentications/views.py | 10 +- fet2020/templates/authentications/login.html | 132 +++---------------- 3 files changed, 30 insertions(+), 118 deletions(-) create mode 100644 fet2020/authentications/forms.py diff --git a/fet2020/authentications/forms.py b/fet2020/authentications/forms.py new file mode 100644 index 00000000..204803e6 --- /dev/null +++ b/fet2020/authentications/forms.py @@ -0,0 +1,6 @@ +from django import forms + + +class LoginForm(forms.Form): + username = forms.CharField() + password = forms.CharField(label='Passwort', widget=forms.PasswordInput()) diff --git a/fet2020/authentications/views.py b/fet2020/authentications/views.py index 0d9981b2..bbf8b0a3 100644 --- a/fet2020/authentications/views.py +++ b/fet2020/authentications/views.py @@ -3,9 +3,11 @@ from django.contrib.auth import login, logout from django.contrib import messages from django.contrib.auth.models import User +from documents.etherpadlib import del_ep_cookie + from .authentications import authentication from .decorators import unauthenticated_user, authenticated_user -from documents.etherpadlib import del_ep_cookie +from .forms import LoginForm @unauthenticated_user @@ -27,7 +29,11 @@ def loginPage(request): else: messages.info(request, 'username or password is incorrect') - context = {} + form = LoginForm() + + context = { + "form": form, + } return render(request, 'authentications/login.html', context) diff --git a/fet2020/templates/authentications/login.html b/fet2020/templates/authentications/login.html index 85620a87..20fc8a90 100644 --- a/fet2020/templates/authentications/login.html +++ b/fet2020/templates/authentications/login.html @@ -1,123 +1,23 @@ - - - - - Login - - - +{% extends 'layout.html' %} +{% block content %} +
+
- - - - -
-
-
-
- - -

LOGIN

-
-
-
- {% csrf_token %} -
-
- -
- - -
- -
-
- -
- - -
- - -
- -
- - {% for message in messages %} -

{{message}}

- {% endfor %} - -
-
-
-
- - - \ No newline at end of file +{% endblock %}