Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#9908 closed (fixed)

Allow individual app_index templates for different apps

Reported by: arne Owned by: Jannis Leidel
Component: contrib.admin Version: dev
Severity: Keywords: app_index
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

django.contrib.admin allows customization of individual change_list or change_form templates by using a list of templates in the form of (example from render_change_form method):

self.change_form_template or [
    "admin/%s/%s/change_form.html" % (app_label, opts.object_name.lower()),
    "admin/%s/change_form.html" % app_label,
    "admin/change_form.html"
]

This mechanism does not work for the app_index template but could easily be implmented. I've attached a diff, which allows placing templates at 'admin/<app_label>/app_index.html' for individual apps, while still allowing global customization by setting the app_index_template class attribute and still falling back to 'admin/app_index.html'

Attachments (3)

app_index_template.diff (642 bytes ) - added by arne 16 years ago.
app_index_docs.diff (452 bytes ) - added by arne 16 years ago.
app_index_r9814.diff (1.1 KB ) - added by arne 16 years ago.
Merged both patches and updated to r9814

Download all attachments as: .zip

Change History (10)

by arne, 16 years ago

Attachment: app_index_template.diff added

comment:1 by Jannis Leidel, 16 years ago

Needs documentation: set
Owner: changed from nobody to Jannis Leidel
Status: newassigned

by arne, 16 years ago

Attachment: app_index_docs.diff added

by arne, 16 years ago

Attachment: app_index_r9814.diff added

Merged both patches and updated to r9814

comment:2 by Jannis Leidel, 16 years ago

Needs documentation: unset
Needs tests: set
Triage Stage: UnreviewedAccepted

comment:3 by Alex Gaynor, 16 years ago

milestone: 1.1
Needs tests: unset
Triage Stage: AcceptedReady for checkin

comment:4 by Jacob, 16 years ago

Triage Stage: Ready for checkinAccepted

Needs a test of the new template.

comment:5 by Jacob, 16 years ago

Triage Stage: AcceptedReady for checkin

OK, never mind.

comment:6 by Jacob, 16 years ago

Resolution: fixed
Status: assignedclosed

(In [10317]) Fixed #9908: allow individual app index templates in the admin. Thanks, arne.

comment:7 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

Note: See TracTickets for help on using tickets.
Back to Top