Opened 7 years ago

Closed 5 years ago

#8933 closed (fixed)

Make more admin templates overridable

Reported by: jezdez Owned by: jezdez
Component: contrib.admin Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: UI/UX:

Description

The following methods are missing options to override their templates:

  • django.contrib.admin.sites.AdminSite: logout, password_change and password_change_done
  • django.contrib.auth.admin.UserAdmin: add_view and user_change_password

Attachments (2)

ticket8933-r8979.diff (3.2 KB) - added by jezdez 7 years ago.
fix to make more templates overridable
ticket8933-r8979.2.diff (3.5 KB) - added by jezdez 7 years ago.
small fix to appease SmilyChris' niticking

Download all attachments as: .zip

Change History (14)

Changed 7 years ago by jezdez

fix to make more templates overridable

comment:1 Changed 7 years ago by jezdez

  • Has patch set
  • milestone post-1.0 deleted
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 7 years ago by jezdez

Just to be a bit more specific why this is useful:

I use the new admin in django-mobileadmin to provide a special admin interface for mobile devices by loading admin templates depending on the user agent of the browser. The templates used in most of the admin views can already be overridden, those five are missing.

comment:5 Changed 7 years ago by brosner

  • Triage Stage changed from Unreviewed to Accepted

comment:6 Changed 7 years ago by brosner

This must have slipped under my radar before 1.0. It would have been best to have gotten it in before 1.0, but the timing was a bit off. This looks good heading towards 1.1 though.

comment:7 Changed 7 years ago by brosner

  • Owner changed from jezdez to brosner

comment:8 Changed 7 years ago by brosner

  • Status changed from new to assigned

comment:9 Changed 7 years ago by SmileyChris

If I was to nitpick, I'd say that the new 'registration' templates shouldn't add the keyword arg unless they need to (otherwise you're hard-coding a default in two places)

Changed 7 years ago by jezdez

small fix to appease SmilyChris' niticking

comment:10 Changed 7 years ago by brosner

  • Needs tests set

This ticket is going to need some tests. There are tests located in tests/regressiontests/admin_views/tests.py for AdminSite templates. The UserAdmin templates are new so similar tests will likely need to be added in the auth app. Ultimately this patch needs documentation as well. However, I am going to tackle that as a part of getting more complete admin docs of the options available. Most of what is missing is template related anyways.

comment:11 Changed 5 years ago by jezdez

  • Owner changed from brosner to jezdez
  • Status changed from assigned to new
  • Version changed from 1.0 to SVN

comment:12 Changed 5 years ago by jezdez

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

(In [12217]) Fixed #8933 - Allow more admin templates to be overridden.

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