File tree Expand file tree Collapse file tree 3 files changed +31
-25
lines changed Expand file tree Collapse file tree 3 files changed +31
-25
lines changed Original file line number Diff line number Diff line change 17
17
class BaseContactForm (ContactForm ):
18
18
message_subject = forms .CharField (
19
19
max_length = 100 ,
20
- widget = forms .TextInput (
21
- attrs = {"class" : "required" , "placeholder" : _ ("Message subject" )}
22
- ),
20
+ widget = forms .TextInput (attrs = {"class" : "required" }),
23
21
label = _ ("Message subject" ),
24
22
)
25
23
email = forms .EmailField (
26
- widget = forms .TextInput (attrs = {"class" : "required" , "placeholder" : _ ("E-mail" )})
24
+ widget = forms .TextInput (attrs = {"class" : "required" }),
25
+ label = _ ("E-mail" ),
27
26
)
28
27
name = forms .CharField (
29
- widget = forms .TextInput (attrs = {"class" : "required" , "placeholder" : _ ("Name" )})
28
+ widget = forms .TextInput (attrs = {"class" : "required" }),
29
+ label = _ ("Name" ),
30
30
)
31
31
body = forms .CharField (
32
- widget = forms .Textarea (
33
- attrs = {"class" : "required" , "placeholder" : _ ("Your message" )}
34
- )
32
+ widget = forms .Textarea (attrs = {"class" : "required" }),
33
+ label = _ ("Your message" ),
35
34
)
36
35
captcha = ReCaptchaField (widget = ReCaptchaV3 )
37
36
Original file line number Diff line number Diff line change @@ -1334,6 +1334,17 @@ a.cta {
1334
1334
}
1335
1335
}
1336
1336
1337
+ label [for ] {
1338
+ font-weight : bold ;
1339
+ }
1340
+
1341
+ .errorlist {
1342
+ color : var (--error-fg );
1343
+ background-color : var (--error-light-l10 );
1344
+ border-radius : .3em ;
1345
+ margin : 10px 0 ;
1346
+ }
1347
+
1337
1348
.callout-right {
1338
1349
@include respond-min (768px ) {
1339
1350
float : right ;
Original file line number Diff line number Diff line change @@ -31,23 +31,19 @@ <h1>{% translate "Contact the Django Software Foundation" %}</h1>
31
31
</ p >
32
32
< form action =". " method ="post " accept-charset ="utf-8 " class ="form-input ">
33
33
{% csrf_token %}
34
- < p >
35
- {% if form.name.errors %}< p class ="errors "> {{ form.name.errors.as_text }}</ p > {% endif %}
36
- {{ form.name }}
37
- </ p >
38
- < p class ="form-email ">
39
- {% if form.email.errors %}< p class ="errors "> {{ form.email.errors.as_text }}</ p > {% endif %}
40
- {{ form.email }}
41
- </ p >
42
- < p >
43
- {% if form.message_subject.errors %}< p class ="errors "> {{ form.message_subject.errors.as_text }}</ p > {% endif %}
44
- {{ form.message_subject }}
45
- </ p >
46
- < p >
47
- {% if form.body.errors %}< p class ="errors "> {{ form.body.errors.as_text }}</ p > {% endif %}
48
- {{ form.body }}
49
- </ p >
50
- < p > {{ form.captcha }}</ p >
34
+ < div >
35
+ {{ form.name.as_field_group }}
36
+ </ div >
37
+ < div >
38
+ {{ form.email.as_field_group }}
39
+ </ div >
40
+ < div >
41
+ {{ form.message_subject.as_field_group }}
42
+ </ div >
43
+ < div >
44
+ {{ form.body.as_field_group }}
45
+ </ div >
46
+ {{ form.captcha }}
51
47
< p class ="submit "> < input type ="submit " class ="cta " value ="{% translate "Send → " %}"> </ p >
52
48
</ form >
53
49
{% endblock %}
You can’t perform that action at this time.
0 commit comments