Opened 3 years ago

Closed 3 years ago

#32289 closed New feature (wontfix)

Multi Theme support for the Admin

Reported by: Ramez Issac Owned by: nobody
Component: contrib.admin Version: 3.1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Issue:
There is no way to mix between several admin themes.
Say i installed a 3rd party admin theme and i want to use it along with the default (or with another 3rd party theme)

While we can have many different admin sites, all admin sites currently must share the same theme.
Because the admin assumes the template directory 'admin' all the time.

Proposal:
A way to direct each AdminSite to the template path where it should find the templates.

Example:
Add a setting called ADMIN_DEFAULT_THEME = 'admin'
Add an attribute to AdminSite called theme which default to ADMIN_DEFAULT_THEME, and basically this setting controls which directory this admin site looks for templates.

So whenever a path like 'admin/some_file_name.html' occurs, it is to be replaced with something like
f'{admin_theme}/some_file_name.html'
This will take effect in extends statements, AdminSite templates loading(index/app index / etc) and ModelAdmin template loading (change form/list/delete etc..)

If accepted then i'd love to start working on it.

Change History (3)

comment:1 by Mariusz Felisiak, 3 years ago

Resolution: duplicate
Status: newclosed

You can use AdminSite.index_template/app_index_template and override CSS to use different theme for each admin site. Also with #32018 changing a theme will be much simpler. I think we can close it as a duplicate of #32018.

comment:2 by Ramez Issac, 3 years ago

Resolution: duplicate
Status: closednew

I don't think it qualifies as a duplicate .

By "theme" i mean a complete HTML structure (not just the colors as #32018 aims) and there is currently no way to have this HTML structure unique per AdminSite.. and that's what this ticket is about adding.

Replying on Changing the app index and the index template:
This is not the same a new theme.. because clicking on any admin link inside those "edited pages" would mean either 1.going back to the default theme for that clicked link or 2. that those ModelAdmin templates were explicitly set as well.

I hope i made the ticket clearer.

Thanks

comment:3 by Mariusz Felisiak, 3 years ago

Resolution: wontfix
Status: newclosed

If you need/want to change all templates, then you shouldn't use django.contrib.admin but rather prepare your own admin interface. I don't think that we would like to support such an extensive customization. You can start a discussion on DevelopersMailingList (where you'll reach a wider audience) if you don't agree.

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