From 5304aadbfaf0aff1f37540debec67e375659a3cf Mon Sep 17 00:00:00 2001 From: pluja Date: Tue, 6 Oct 2020 20:14:30 +0200 Subject: [PATCH] Improve login page UI --- app/forms.py | 3 ++- app/templates/base.html | 19 ++++++++++--------- app/templates/login.html | 16 +++++++--------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/app/forms.py b/app/forms.py index b34cd4e..78f8b6b 100644 --- a/app/forms.py +++ b/app/forms.py @@ -5,10 +5,11 @@ from app.models import User class LoginForm(FlaskForm): + style={'class': 'ui primary button'} username = StringField('Username', validators=[DataRequired()]) password = PasswordField('Password', validators=[DataRequired()]) remember_me = BooleanField('Remember Me') - submit = SubmitField('Sign In') + submit = SubmitField('Sign In', render_kw=style) class SearchForm(FlaskForm): username = StringField('Username') diff --git a/app/templates/base.html b/app/templates/base.html index 51348d6..0f83f60 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -45,17 +45,18 @@ {% with messages = get_flashed_messages() %} {% if messages %} -
-
- Information +
+
+
+ Information +
+
    + {% for message in messages %} +
  • {{ message }}
  • + {% endfor %} +
-
    - {% for message in messages %} -
  • {{ message }}
  • - {% endfor %} -
- {% endif %} {% endwith %} diff --git a/app/templates/login.html b/app/templates/login.html index 523e67b..4038322 100644 --- a/app/templates/login.html +++ b/app/templates/login.html @@ -11,13 +11,13 @@
{% endif %} -

Login

-
-
-
+

LOGIN

+
+
{{ form.hidden_tag() }}

+ {{ form.username.label }}
{{ form.username(size=32) }}
{% for error in form.username.errors %} @@ -25,6 +25,7 @@ {% endfor %}

+ {{ form.password.label }}
{{ form.password(size=32) }}
{% for error in form.password.errors %} @@ -35,11 +36,8 @@

{{ form.submit() }}

-
-
-

New user? Click to Register!

-
+ -
{% endblock %}