feat: finalize UI/UX
This commit is contained in:
@@ -11,7 +11,6 @@ class SignUpForm(UserCreationForm):
|
||||
email = forms.EmailField(required=True)
|
||||
company = forms.CharField(max_length=200, required=False)
|
||||
phone = forms.CharField(max_length=50, required=False)
|
||||
timezone = forms.ChoiceField(choices=ClientProfile.TIMEZONE_CHOICES, required=True)
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
@@ -19,7 +18,7 @@ class SignUpForm(UserCreationForm):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
for field_name in ("username", "first_name", "last_name", "email", "company", "phone", "timezone"):
|
||||
for field_name in ("username", "first_name", "last_name", "email", "company", "phone"):
|
||||
if field_name in self.fields:
|
||||
self.fields[field_name].widget.attrs.setdefault("class", "form-control")
|
||||
for field_name in ("password1", "password2"):
|
||||
@@ -42,7 +41,6 @@ class SignUpForm(UserCreationForm):
|
||||
user=user,
|
||||
company=self.cleaned_data.get("company", ""),
|
||||
phone=self.cleaned_data.get("phone", ""),
|
||||
timezone=self.cleaned_data.get("timezone", "UTC"),
|
||||
)
|
||||
return user
|
||||
|
||||
@@ -65,11 +63,17 @@ class ClientProfileForm(forms.ModelForm):
|
||||
|
||||
class Meta:
|
||||
model = ClientProfile
|
||||
fields = ("company", "phone", "timezone")
|
||||
fields = ("avatar", "company", "job_title", "phone", "bio")
|
||||
widgets = {
|
||||
"avatar": forms.ClearableFileInput(
|
||||
attrs={"class": "profile-avatar-input", "accept": "image/jpeg,image/png,image/webp"}
|
||||
),
|
||||
"company": forms.TextInput(attrs={"class": "form-control"}),
|
||||
"job_title": forms.TextInput(attrs={"class": "form-control"}),
|
||||
"phone": forms.TextInput(attrs={"class": "form-control"}),
|
||||
"timezone": forms.Select(attrs={"class": "form-control"}),
|
||||
"bio": forms.Textarea(
|
||||
attrs={"class": "form-control", "rows": 4, "placeholder": "A short introduction to your work and research interests"}
|
||||
),
|
||||
}
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user