Ticket #5715: admin_iriencode.diff

File admin_iriencode.diff, 3.4 KB (added by Takanao Endoh, 17 years ago)
  • django/contrib/admin/templatetags/admin_list.py

     
    77from django.utils.html import escape
    88from django.utils.text import capfirst
    99from django.utils.translation import get_date_formats, get_partial_date_formats, ugettext as _
    10 from django.utils.encoding import smart_unicode, smart_str, force_unicode
     10from django.utils.encoding import smart_unicode, smart_str, force_unicode, iri_to_uri
    1111from django.template import Library
    1212import datetime
    1313
     
    2121    elif i == cl.page_num:
    2222        return u'<span class="this-page">%d</span> ' % (i+1)
    2323    else:
    24         return u'<a href="%s"%s>%d</a> ' % (cl.get_query_string({PAGE_VAR: i}), (i == cl.paginator.pages-1 and ' class="end"' or ''), i+1)
     24        return u'<a href="%s"%s>%d</a> ' % (
     25            iri_to_uri(cl.get_query_string({PAGE_VAR: i})),
     26            (i == cl.paginator.pages-1 and ' class="end"' or ''), i+1)
    2527paginator_number = register.simple_tag(paginator_number)
    2628
    2729def pagination(cl):
  • django/contrib/admin/templates/admin/pagination.html

     
    77{% endfor %}
    88{% endif %}
    99{{ cl.result_count }} {% ifequal cl.result_count 1 %}{{ cl.opts.verbose_name|escape }}{% else %}{{ cl.opts.verbose_name_plural|escape }}{% endifequal %}
    10 {% if show_all_url %}&nbsp;&nbsp;<a href="{{ show_all_url }}" class="showall">{% trans 'Show all' %}</a>{% endif %}
     10{% if show_all_url %}&nbsp;&nbsp;<a href="{{ show_all_url|iriencode }}" class="showall">{% trans 'Show all' %}</a>{% endif %}
    1111</p>
  • django/contrib/admin/templates/admin/change_list_results.html

     
    33<thead>
    44<tr>
    55{% for header in result_headers %}<th{{ header.class_attrib }}>
    6 {% if header.sortable %}<a href="{{ header.url }}">{% endif %}
     6{% if header.sortable %}<a href="{{ header.url|iriencode }}">{% endif %}
    77{{ header.text|capfirst }}
    88{% if header.sortable %}</a>{% endif %}</th>{% endfor %}
    99</tr>
  • django/contrib/admin/templates/admin/date_hierarchy.html

     
    11{% if show %}
    22<div class="xfull">
    33<ul class="toplinks">
    4 {% if back %}<li class="date-back"><a href="{{ back.link }}">&lsaquo; {{ back.title|escape }}</a></li>{% endif %}
     4{% if back %}<li class="date-back"><a href="{{ back.link|iriencode }}">&lsaquo; {{ back.title|escape }}</a></li>{% endif %}
    55{% for choice in choices %}
    6 <li> {% if choice.link %}<a href="{{ choice.link }}">{% endif %}{{ choice.title|escape }}{% if choice.link %}</a>{% endif %}</li>
     6<li> {% if choice.link %}<a href="{{ choice.link|iriencode }}">{% endif %}{{ choice.title|escape }}{% if choice.link %}</a>{% endif %}</li>
    77{% endfor %}
    88</ul><br class="clear" />
    99</div>
Back to Top