Best way to change the behavior of a collapsed set of fields in admin?
When a collapsed class is assigned to the given admin class, it is displayed with the Show / Hide link set by CollapsedFieldset.js, which collapses or extends it.
In all cases where the collapse class appears, I would like the link to be a field of the entire field (or a div of that dimension), not just "Show".
What is the best way to "override" the default Javascript file? If there was an extrahead block in the stacked.html template, it looks like this would be the way to do it, but it isn't - maybe because at the time stacked.html is used the head is already written?
I could just change the admin Javascript file, but that doesn't seem right.
a source to share
You can probably add your own Javascript to the page, which just removes the link created by CollapsedFieldset.js and creates the link as you wish. The JS required would be no more than two lines of jQuery that you would ideally include in the custom form's inner media class the subclass you use in your ModelAdmin subclass (although it should appear after CollapsedFieldsets.js and I haven't checked if it will).
Another alternative would be to ignore class = "collapse" altogether and just apply your own class to the fieldset, then include your own Javascript (via the inner Media class as above) that duplicates all CollapsedFieldset functionality. js except what you want.
a source to share
I posted my answer here:
Django Admin - add collapse to fieldset, but start running it
You can easily modify this example to dynamically rewrite
<h2><a>
build in
<a><h2>
one.
a source to share