feat: added changeform_fullwidth option to ModelAdmin - #2168
feat: added changeform_fullwidth option to ModelAdmin#2168ciaransanders wants to merge 2 commits into
Conversation
|
I was already considering this feature. My question is why you need that? May you describe your issue with the current non-fullwidth layout? |
|
Yeah that's a good question, because I agree that the current width is perfect for 99% of use cases. But in my scenario, I have a high traffic admin page which has a couple of needs for more screen space. First, It contains a "step" inline. This step inline is sortable, must be a tabular inline, and now has too many fields to fit within the screen width. I could just switch over to using a stacked inline, but the issue is a lot of the objects on this page have a lot of steps which the user wants to easily be able to view, and they by and large prefer the stacked inline for this purpose. This admin page also has a customized template displaying images, for reference and design purposes. Having the page be full width would allow us to display the images larger; a small QOL thing. It's probably something I could work around, and just keep this admin page the current width. But setting the page as full width would be a nice feature, at least I would find use in it 👍 |
|
I think tabular inline with a lot of columns is good enough example for me. I will take a look at this but as always, I'm not promising anything. |
Summary
Add new option on
src.unfold.admin.ModelAdmincalledchangeform_fullwidth. When set toTrue, the changeform page for the correspondingModelAdminhas thecontainerclass remove, allowing the page to be full width.Test plan
Visually tested, by trying all permutations of True/False for both
list_fullwidthandchangeform_fullwidthto verify they do not interfere with each other.Use of AI
Yes, AI was used to help determine a method by which we could have
list_fullwidthandchangeform_fullwidthnot accidentally interfere with each other in the logic of theifstatement.Improvements
This implementation depends on the fact that
clis only available on the change list view andadminformis only available on the change form page. Not my favorite idea, personally... but it works, so I'm just going to create this draft pull request for the moment and I can iterate on the idea later; especially if someone has suggestions!