+ Log in to AnnoMemo +
+ {% if form.non_field_errors %} ++ Don't have an account? + Sign up +
+diff --git a/penparse/webui/forms.py b/penparse/webui/forms.py index 1eed6e0..d626266 100644 --- a/penparse/webui/forms.py +++ b/penparse/webui/forms.py @@ -1,6 +1,19 @@ from django import forms from .models import User -from django.contrib.auth.forms import UserCreationForm +from django.contrib.auth.forms import UserCreationForm, AuthenticationForm + + +class LoginForm(AuthenticationForm): + class Meta: + model = User + fields = ['email', 'password'] + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.fields['email'].widget.attrs.update( + {'class': 'shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline'}) + self.fields['password'].widget.attrs.update( + {'class': 'shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline'}) class RegisterForm(UserCreationForm): diff --git a/penparse/webui/templates/register.html b/penparse/webui/templates/register.html index 2eb2f8b..aa6f55b 100644 --- a/penparse/webui/templates/register.html +++ b/penparse/webui/templates/register.html @@ -80,7 +80,9 @@
diff --git a/penparse/webui/templates/registration/login.html b/penparse/webui/templates/registration/login.html new file mode 100644 index 0000000..13ae6ae --- /dev/null +++ b/penparse/webui/templates/registration/login.html @@ -0,0 +1,74 @@ +{% extends "main.html" %} {% block content %} ++ Don't have an account? + Sign up +
+