Ticket #6396: admin_changelist-6396.diff
File admin_changelist-6396.diff, 2.4 KB (added by , 16 years ago) |
---|
-
Users/mwdiers/Documents/workspace/django-trunk/django/contrib/admin/templates/admin/change_list_results.html
10 10 </thead> 11 11 <tbody> 12 12 {% for result in results %} 13 <tr class="{% cycle 'row1' 'row2' %}">{% for item in result %}{{ item }}{% endfor %}</tr> 13 <tr class="{% cycle 'row1' 'row2' %}"> 14 {% for item in result %}<{{ item.table_tag }} {{ item.row_class }}>{% if item.url %}<a href="{{ item.url }}" {{ item.event }}>{{ item.result_repr }}</a>{% else %}{{ item.result_repr }}{% endif %}</{{ item.table_tag }}>{% endfor %} 15 </tr> 14 16 {% endfor %} 15 17 </tbody> 16 18 </table> -
Users/mwdiers/Documents/workspace/django-trunk/django/contrib/admin/templatetags/admin_list.py
196 196 # Convert the pk to something that can be used in Javascript. 197 197 # Problem cases are long ints (23L) and non-ASCII strings. 198 198 result_id = repr(force_unicode(getattr(result, pk)))[1:] 199 yield mark_safe(u'<%s%s><a href="%s"%s>%s</a></%s>' % \ 200 (table_tag, row_class, url, (cl.is_popup and ' onclick="opener.dismissRelatedLookupPopup(window, %s); return false;"' % result_id or ''), conditional_escape(result_repr), table_tag)) 199 yield {'row_class': row_class, 'url': url, 'event': (cl.is_popup and ' onclick="opener.dismissRelatedLookupPopup(window, %s); return false;"' % result_id or ''), 'result_repr': conditional_escape(result_repr), 'result': result, 'table_tag': table_tag} 201 200 else: 202 yield mark_safe(u'<td%s>%s</td>' % (row_class, conditional_escape(result_repr)))201 yield {'row_class': row_class, 'url': '', 'event': '', 'result_repr': conditional_escape(result_repr), 'result': result, 'table_tag': 'td'} 203 202 204 203 def results(cl): 205 204 for res in cl.result_list: