Skip to content

Commit 262847b

Browse files
committed
Simplify the template and stylish error messages
1 parent 2ccbcc8 commit 262847b

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

djangoproject/scss/_style.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,17 @@ a.cta {
13341334
}
13351335
}
13361336

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+
13371348
.callout-right {
13381349
@include respond-min(768px) {
13391350
float: right;

djangoproject/templates/contact/foundation.html

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,19 @@ <h1>{% translate "Contact the Django Software Foundation" %}</h1>
3131
</p>
3232
<form action="." method="post" accept-charset="utf-8" class="form-input">
3333
{% csrf_token %}
34-
<p>
35-
{{ form.name.label_tag }}
36-
{% if form.name.errors %}<p class="errors">{{ form.name.errors.as_text }}</p>{% endif %}
37-
{{ form.name }}
38-
</p>
39-
<p class="form-email">
40-
{{ form.email.label_tag }}
41-
{% if form.email.errors %}<p class="errors">{{ form.email.errors.as_text }}</p>{% endif %}
42-
{{ form.email }}
43-
</p>
44-
<p>
45-
{{ form.message_subject.label_tag }}
46-
{% if form.message_subject.errors %}<p class="errors">{{ form.message_subject.errors.as_text }}</p>{% endif %}
47-
{{ form.message_subject }}
48-
</p>
49-
<p>
50-
{{ form.body.label_tag }}
51-
{% if form.body.errors %}<p class="errors">{{ form.body.errors.as_text }}</p>{% endif %}
52-
{{ form.body }}
53-
</p>
54-
<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 }}
5547
<p class="submit"><input type="submit" class="cta" value="{% translate "Send &rarr;" %}"></p>
5648
</form>
5749
{% endblock %}

0 commit comments

Comments
 (0)