fix(spec): enforce read-time budget and re-render invalid comment submissions
This commit is contained in:
@@ -69,12 +69,20 @@
|
||||
{% empty %}
|
||||
<p>No comments yet.</p>
|
||||
{% endfor %}
|
||||
{% if comment_form and comment_form.errors %}
|
||||
<div aria-label="Comment form errors">
|
||||
{{ comment_form.non_field_errors }}
|
||||
{% for field in comment_form %}
|
||||
{{ field.errors }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<form method="post" action="{% url 'comment_post' %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="article_id" value="{{ page.id }}" />
|
||||
<input type="text" name="author_name" required />
|
||||
<input type="email" name="author_email" required />
|
||||
<textarea name="body" required></textarea>
|
||||
<input type="text" name="author_name" value="{% if comment_form %}{{ comment_form.author_name.value|default:'' }}{% endif %}" required />
|
||||
<input type="email" name="author_email" value="{% if comment_form %}{{ comment_form.author_email.value|default:'' }}{% endif %}" required />
|
||||
<textarea name="body" required>{% if comment_form %}{{ comment_form.body.value|default:'' }}{% endif %}</textarea>
|
||||
<input type="text" name="honeypot" style="display:none" />
|
||||
<button type="submit">Post comment</button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user