Commit bf3ebb1c authored by Julian Rother's avatar Julian Rother
Browse files

Autofocus username input on login page

/close #101
parent 21a1c964
......@@ -99,8 +99,12 @@ class IPNetworkField(Field):
raise ValueError(self.gettext("Not a valid IP Network: {}".format(str(exc))))
self.data = ",".join(map(str, result_parts))
class FocusedStringField(StringField):
def __call__(self, **kwargs):
return super().__call__(**kwargs, autofocus=True)
class LoginForm(FlaskForm):
username = StringField("Benutzer", validators=[InputRequired("Bitte gib deinen Benutzernamen ein.")])
username = FocusedStringField("Benutzer", validators=[InputRequired("Bitte gib deinen Benutzernamen ein.")])
password = PasswordField("Passwort", validators=[InputRequired("Bitte gib dein Passwort ein.")])
permanent = BooleanField("Eingeloggt bleiben?")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment