Ticket #917: change_list_template_overloading.patch

File change_list_template_overloading.patch, 2.1 KB (added by rjwittams, 19 years ago)
  • django/contrib/admin/templates/admin/change_list.html

    === django/contrib/admin/templates/admin/change_list.html
    ==================================================================
     
     1{% extends "admin/base_site" %}
    12{% load adminmedia admin_list i18n %}
    2 {% extends "admin/base_site" %}
    33{% block bodyclass %}change-list{% endblock %}
    44{% if not is_popup %}{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans "Home" %}</a> &rsaquo; {{ cl.opts.verbose_name_plural|capfirst }} </div>{% endblock %}{% endif %}
    55{% block coltype %}flex{% endblock %}
     
    99<ul class="object-tools"><li><a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink">{% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}</a></li></ul>
    1010{% endif %}
    1111<div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
    12 {% search_form cl %}
    13 {% date_hierarchy cl %}
    14 {% filters cl %}
    15 {% result_list cl %}
    16 {% pagination cl %}
     12{% block search %}{% search_form cl %}{%endblock%}
     13{% block date_hierarchy %}{% date_hierarchy cl %}{%endblock%}
     14{% block filters %}{% filters cl %}{%endblock%}
     15{% block result_list %}{% result_list cl %}{%endblock%}
     16{% block pagination %}{% pagination cl %}{%endblock%}
    1717</div>
    1818</div>
    1919{% endblock %}
  • django/contrib/admin/views/main.py

    === django/contrib/admin/views/main.py
    ==================================================================
     
    242242        'cl' : cl
    243243    })
    244244    c.update( { 'has_add_permission': c['perms'][app_label][cl.opts.get_add_permission()]}),
    245     return render_to_response('admin/change_list',
     245    return render_to_response(["admin/%s/%s/change_list" % (app_label, cl.opts.object_name.lower() ),
     246                               "admin/%s/change_list" % app_label ,
     247                               "admin/change_list" ],
    246248                               context_instance = c)
    247249change_list = staff_member_required(change_list)
    248250
Back to Top