39 lines
1.0 KiB
Python
39 lines
1.0 KiB
Python
from django import forms
|
|
from django.contrib.auth.forms import AuthenticationForm, UsernameField
|
|
from django.utils.text import gettext_lazy as _
|
|
|
|
from web.mixins import StylingMixin
|
|
|
|
|
|
class LoginForm(StylingMixin, AuthenticationForm):
|
|
styled_fields = []
|
|
placeholder_for_field = {"username": _("pablo@shoppy.com"), "password": "********"}
|
|
|
|
username = UsernameField(
|
|
widget=forms.EmailInput(
|
|
attrs={
|
|
"autofocus": True,
|
|
"class": "input-text",
|
|
}
|
|
)
|
|
)
|
|
password = forms.CharField(
|
|
label=_("Contraseña"),
|
|
strip=False,
|
|
widget=forms.PasswordInput(
|
|
attrs={
|
|
"autocomplete": "current-password",
|
|
"class": "input-text",
|
|
}
|
|
),
|
|
)
|
|
remember_me = forms.BooleanField(
|
|
label=_("Mantener sesión iniciada"),
|
|
required=False,
|
|
widget=forms.CheckboxInput(
|
|
attrs={
|
|
"class": "input-text"
|
|
}
|
|
),
|
|
)
|