Hi all,

Attached is a small patch to fix 3 HTML errors in the admin.  There is
one more that I can't think how to fix -- <select> elements must
contain one or <options>.  Foreign key relationships on models can
sometimes means that empty <select> elements are generated.  However
you can't just remove the <select>, as it is needed by the javascript
'+' popup thingy to put the new option into.  I can't think of a nice
solution to that one.  It's probably at this point that I'd be tempted
to say "well what do w3c know, anyway?" :-)

Luke

-- 
"Whom have I in heaven but You?
And there is none upon earth that I desire besides You." Psalm 73:25

Luke Plant || L.Plant.98 (at) cantab.net || http://lukeplant.me.uk/
Index: django/contrib/admin/templates/admin/search_form.html
===================================================================
--- django/contrib/admin/templates/admin/search_form.html	(revision 1616)
+++ django/contrib/admin/templates/admin/search_form.html	(working copy)
@@ -2,7 +2,8 @@
 {% load i18n %}
 {% if cl.lookup_opts.admin.search_fields %}
 <div id="toolbar"><form id="changelist-search" action="" method="get">
-<label><img src="{% admin_media_prefix %}img/admin/icon_searchbox.png" /></label>
+<div>
+<label><img src="{% admin_media_prefix %}img/admin/icon_searchbox.png" alt="Search"/></label>
 <input type="text" size="40" name="{{ search_var }}" value="{{ cl.query|escape }}" id="searchbar" />
 <input type="submit" value="{% trans 'Go' %}" />
 {% if show_result_count %}
@@ -11,6 +12,7 @@
 {% for pair in cl.params.items %}
     {% ifnotequal pair.0 search_var %}<input type="hidden" name="{{ pair.0|escape }}" value="{{ pair.1|escape }}"/>{% endifnotequal %}
 {% endfor %}
+</div>
 </form></div>
 <script type="text/javascript">document.getElementById("searchbar").focus();</script>
 {% endif %}
Index: django/contrib/admin/templates/admin/change_list_results.html
===================================================================
--- django/contrib/admin/templates/admin/change_list_results.html	(revision 1616)
+++ django/contrib/admin/templates/admin/change_list_results.html	(working copy)
@@ -1,3 +1,4 @@
+{% if results %}
 <table cellspacing="0">
 <thead>
 <tr>
@@ -7,7 +8,10 @@
 {% if header.sortable %}</a>{% endif %}</th>{% endfor %}
 </tr>
 </thead>
+<tbody>
 {% for result in results %}
 <tr class="{% cycle row1,row2 %}">{% for item in result %}{{ item }}{% endfor %}</tr>
 {% endfor %}
+</tbody>
 </table>
+{% endif %}
\ No newline at end of file

Reply via email to