Code

Ticket #8498: ticket8498-r8486.1.diff

File ticket8498-r8486.1.diff, 988 bytes (added by jezdez, 6 years ago)

Small patch to add support for app_index_template

Line 
1diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py
2index 81e43a1..4aa6975 100644
3--- a/django/contrib/admin/sites.py
4+++ b/django/contrib/admin/sites.py
5@@ -47,6 +47,7 @@ class AdminSite(object):
6 
7     index_template = None
8     login_template = None
9+    app_index_template = None
10 
11     def __init__(self):
12         self._registry = {} # model_class class -> admin_class instance
13@@ -397,7 +398,7 @@ class AdminSite(object):
14                         raise http.Http404('The requested admin page does not exist.')
15         # Sort the models alphabetically within each app.
16         app_dict['models'].sort(lambda x, y: cmp(x['name'], y['name']))
17-        return render_to_response('admin/app_index.html', {
18+        return render_to_response(self.app_index_template or 'admin/app_index.html', {
19             'title': _('%s administration' % capfirst(app_label)),
20             'app_list': [app_dict]
21         }, context_instance=template.RequestContext(request))