Repository: ocadotechnology/codeforlife-portal

Issue:
Class model, list view and creation form



Discussion:

Resolving patch:
diff --git a/portal/forms/play.py b/portal/forms/play.py
--- a/portal/forms/play.py
+++ b/portal/forms/play.py
@@ -204,20 +204,26 @@ def are_password_and_confirm_password_different(password, confirm_password):
 
 class IndependentStudentSignupForm(forms.Form):
     name = forms.CharField(
-        label="Name",
         max_length=100,
-        widget=forms.TextInput(attrs={"autocomplete": "off"}),
+        help_text="Enter full name",
+        widget=forms.TextInput(
+            attrs={"autocomplete": "off", "placeholder": "Full name"}
+        ),
     )
 
     username = forms.CharField(
-        label="Username",
         max_length=100,
-        widget=forms.TextInput(attrs={"autocomplete": "off"}),
+        help_text="Enter a username",
+        widget=forms.TextInput(
+            attrs={"autocomplete": "off", "placeholder": "Username"}
+        ),
     )
 
     email = forms.EmailField(
-        label="Email address",
-        widget=forms.EmailInput(attrs={"autocomplete": "off"}),
+        help_text="Enter your email address",
+        widget=forms.EmailInput(
+            attrs={"autocomplete": "off", "placeholder": "Email address"}
+        ),
     )
 
     newsletter_ticked = forms.BooleanField(initial=False, required=False)
@@ -225,12 +231,17 @@ class IndependentStudentSignupForm(forms.Form):
     is_over_required_age = forms.BooleanField(initial=False, required=True)
 
     password = forms.CharField(
-        label="Password", widget=forms.PasswordInput(attrs={"autocomplete": "off"})
+        help_text="Enter a password",
+        widget=forms.PasswordInput(
+            attrs={"autocomplete": "off", "placeholder": "Password"}
+        ),
     )
 
     confirm_password = forms.CharField(
-        label="Confirm Password",
-        widget=forms.PasswordInput(attrs={"autocomplete": "off"}),
+        help_text="Repeat password",
+        widget=forms.PasswordInput(
+            attrs={"autocomplete": "off", "placeholder": "Repeat password"}
+        ),
     )
 
     captcha = ReCaptchaField(widget=ReCaptchaV2Invisible)
diff --git a/portal/forms/teach.py b/portal/forms/teach.py
--- a/portal/forms/teach.py
+++ b/portal/forms/teach.py
@@ -19,18 +19,24 @@
 class TeacherSignupForm(forms.Form):
 
     teacher_first_name = forms.CharField(
-        label="First name",
+        help_text="Enter your first name",
         max_length=100,
-        widget=forms.TextInput(attrs={"autocomplete": "off"}),
+        widget=forms.TextInput(
+            attrs={"autocomplete": "off", "placeholder": "First name"}
+        ),
     )
     teacher_last_name = forms.CharField(
-        label="Last name",
+        help_text="Enter your last name",
         max_length=100,
-        widget=forms.TextInput(attrs={"autocomplete": "off"}),
+        widget=forms.TextInput(
+            attrs={"autocomplete": "off", "placeholder": "Last name"}
+        ),
     )
     teacher_email = forms.EmailField(
-        label="Email address",
-        widget=forms.EmailInput(attrs={"autocomplete": "off"}),
+        help_text="Enter your email address",
+        widget=forms.EmailInput(
+            attrs={"autocomplete": "off", "placeholder": "Email address"}
+        ),
     )
 
     newsletter_ticked = forms.BooleanField(
@@ -38,11 +44,16 @@ class TeacherSignupForm(forms.Form):
     )
 
     teacher_password = forms.CharField(
-        label="Password", widget=forms.PasswordInput(attrs={"autocomplete": "off"})
+        help_text="Enter a password",
+        widget=forms.PasswordInput(
+            attrs={"autocomplete": "off", "placeholder": "Password"}
+        ),
     )
     teacher_confirm_password = forms.CharField(
-        label="Confirm Password",
-        widget=forms.PasswordInput(attrs={"autocomplete": "off"}),
+        help_text="Repeat password",
+        widget=forms.PasswordInput(
+            attrs={"autocomplete": "off", "placeholder": "Repeat password"}
+        ),
     )
 
     captcha = ReCaptchaField(widget=ReCaptchaV2Invisible)


Test patch: