Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
protokollsystem
proto3
Commits
bf3ebb1c
Commit
bf3ebb1c
authored
Feb 17, 2018
by
Julian Rother
Browse files
Autofocus username input on login page
/close
#101
parent
21a1c964
Changes
1
Hide whitespace changes
Inline
Side-by-side
views/forms.py
View file @
bf3ebb1c
...
...
@@ -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
=
Focused
StringField
(
"Benutzer"
,
validators
=
[
InputRequired
(
"Bitte gib deinen Benutzernamen ein."
)])
password
=
PasswordField
(
"Passwort"
,
validators
=
[
InputRequired
(
"Bitte gib dein Passwort ein."
)])
permanent
=
BooleanField
(
"Eingeloggt bleiben?"
)
...
...
Julian Rother
@julianr
mentioned in commit
247b6c4d
·
Feb 17, 2018
mentioned in commit
247b6c4d
mentioned in commit 247b6c4dc984b41ba18b865b4d98afeb1eb703e2
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment