Add "form-control" class to "first_name" and "last_name" fields

This commit is contained in:
Maël Solard
2014-08-07 18:38:42 +02:00
parent 9fc7d2537c
commit 093f82c252
2 changed files with 10 additions and 0 deletions
+4
View File
@@ -37,6 +37,10 @@ class ProfileForm(forms.ModelForm):
class Meta:
model = User
fields = ("first_name", "last_name")
widgets = {
'first_name': forms.TextInput(attrs={'class': 'form-control'}),
'last_name': forms.TextInput(attrs={'class': 'form-control'})
}
def __init__(self, update_password, *args, **kwargs):
super(ProfileForm, self).__init__(*args, **kwargs)
@@ -38,6 +38,12 @@ class AccountFormGeneral(forms.ModelForm):
widget=forms.PasswordInput(attrs={"class": "form-control"}),
help_text=ugettext_lazy("Enter the same password as above, for verification.")
)
first_name= forms.CharField(
widget=forms.TextInput(attrs={"class": "form-control"}),
)
last_name= forms.CharField(
widget=forms.TextInput(attrs={"class": "form-control"}),
)
class Meta:
model = User