Fixed #2283 (again) - comment form templates don't validate as XHTML

Thanks to hjoreteg/thejaswi_puthraya for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13855 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Luke Plant 2010-09-14 14:22:35 +00:00
parent 3c19671711
commit 34a4af50be
7 changed files with 12 additions and 11 deletions

View File

@ -1,5 +1,5 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Comment post not allowed (400)</title> <title>Comment post not allowed (400)</title>

View File

@ -7,7 +7,7 @@
<h1>{% trans "Really make this comment public?" %}</h1> <h1>{% trans "Really make this comment public?" %}</h1>
<blockquote>{{ comment|linebreaks }}</blockquote> <blockquote>{{ comment|linebreaks }}</blockquote>
<form action="." method="post">{% csrf_token %} <form action="." method="post">{% csrf_token %}
{% if next %}<input type="hidden" name="next" value="{{ next }}" id="next" />{% endif %} {% if next %}<div><input type="hidden" name="next" value="{{ next }}" id="next" /></div>{% endif %}
<p class="submit"> <p class="submit">
<input type="submit" name="submit" value="{% trans "Approve" %}" /> or <a href="{{ comment.get_absolute_url }}">cancel</a> <input type="submit" name="submit" value="{% trans "Approve" %}" /> or <a href="{{ comment.get_absolute_url }}">cancel</a>
</p> </p>

View File

@ -1,5 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en"> .dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>{% block title %}{% endblock %}</title> <title>{% block title %}{% endblock %}</title>

View File

@ -7,7 +7,7 @@
<h1>{% trans "Really remove this comment?" %}</h1> <h1>{% trans "Really remove this comment?" %}</h1>
<blockquote>{{ comment|linebreaks }}</blockquote> <blockquote>{{ comment|linebreaks }}</blockquote>
<form action="." method="post">{% csrf_token %} <form action="." method="post">{% csrf_token %}
{% if next %}<input type="hidden" name="next" value="{{ next }}" id="next" />{% endif %} {% if next %}<div><input type="hidden" name="next" value="{{ next }}" id="next" /></div>{% endif %}
<p class="submit"> <p class="submit">
<input type="submit" name="submit" value="{% trans "Remove" %}" /> or <a href="{{ comment.get_absolute_url }}">cancel</a> <input type="submit" name="submit" value="{% trans "Remove" %}" /> or <a href="{{ comment.get_absolute_url }}">cancel</a>
</p> </p>

View File

@ -7,7 +7,7 @@
<h1>{% trans "Really flag this comment?" %}</h1> <h1>{% trans "Really flag this comment?" %}</h1>
<blockquote>{{ comment|linebreaks }}</blockquote> <blockquote>{{ comment|linebreaks }}</blockquote>
<form action="." method="post">{% csrf_token %} <form action="." method="post">{% csrf_token %}
{% if next %}<input type="hidden" name="next" value="{{ next }}" id="next" />{% endif %} {% if next %}<div><input type="hidden" name="next" value="{{ next }}" id="next" /></div>{% endif %}
<p class="submit"> <p class="submit">
<input type="submit" name="submit" value="{% trans "Flag" %}" /> or <a href="{{ comment.get_absolute_url }}">cancel</a> <input type="submit" name="submit" value="{% trans "Flag" %}" /> or <a href="{{ comment.get_absolute_url }}">cancel</a>
</p> </p>

View File

@ -1,9 +1,9 @@
{% load comments i18n %} {% load comments i18n %}
<form action="{% comment_form_target %}" method="post">{% csrf_token %} <form action="{% comment_form_target %}" method="post">{% csrf_token %}
{% if next %}<input type="hidden" name="next" value="{{ next }}" />{% endif %} {% if next %}<div><input type="hidden" name="next" value="{{ next }}" /></div>{% endif %}
{% for field in form %} {% for field in form %}
{% if field.is_hidden %} {% if field.is_hidden %}
{{ field }} <div>{{ field }}</div>
{% else %} {% else %}
{% if field.errors %}{{ field.errors }}{% endif %} {% if field.errors %}{{ field.errors }}{% endif %}
<p <p

View File

@ -6,7 +6,7 @@
{% block content %} {% block content %}
{% load comments %} {% load comments %}
<form action="{% comment_form_target %}" method="post">{% csrf_token %} <form action="{% comment_form_target %}" method="post">{% csrf_token %}
{% if next %}<input type="hidden" name="next" value="{{ next }}" />{% endif %} {% if next %}<div><input type="hidden" name="next" value="{{ next }}" /></div>{% endif %}
{% if form.errors %} {% if form.errors %}
<h1>{% blocktrans count form.errors|length as counter %}Please correct the error below{% plural %}Please correct the errors below{% endblocktrans %}</h1> <h1>{% blocktrans count form.errors|length as counter %}Please correct the error below{% plural %}Please correct the errors below{% endblocktrans %}</h1>
{% else %} {% else %}
@ -18,7 +18,7 @@
{% endif %} {% endif %}
{% for field in form %} {% for field in form %}
{% if field.is_hidden %} {% if field.is_hidden %}
{{ field }} <div>{{ field }}</div>
{% else %} {% else %}
{% if field.errors %}{{ field.errors }}{% endif %} {% if field.errors %}{{ field.errors }}{% endif %}
<p <p