Opened 7 years ago

Closed 6 years ago

Last modified 4 years ago

#9908 closed (fixed)

Allow individual app_index templates for different apps

Reported by: arne Owned by: jezdez
Component: contrib.admin Version: master
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: UI/UX:

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 7 years ago.
app_index_docs.diff (452 bytes) - added by arne 6 years ago.
app_index_r9814.diff (1.1 KB) - added by arne 6 years ago.
Merged both patches and updated to r9814

Download all attachments as: .zip

Change History (10)

Changed 7 years ago by arne

comment:1 Changed 7 years ago by jezdez

  • Needs documentation set
  • Needs tests unset
  • Owner changed from nobody to jezdez
  • Patch needs improvement unset
  • Status changed from new to assigned

Changed 6 years ago by arne

Changed 6 years ago by arne

Merged both patches and updated to r9814

comment:2 Changed 6 years ago by jezdez

  • Needs documentation unset
  • Needs tests set
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 6 years ago by Alex

  • milestone set to 1.1
  • Needs tests unset
  • Triage Stage changed from Accepted to Ready for checkin

comment:4 Changed 6 years ago by jacob

  • Triage Stage changed from Ready for checkin to Accepted

Needs a test of the new template.

comment:5 Changed 6 years ago by jacob

  • Triage Stage changed from Accepted to Ready for checkin

OK, never mind.

comment:6 Changed 6 years ago by jacob

  • Resolution set to fixed
  • Status changed from assigned to closed

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

comment:7 Changed 4 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

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