Fix the default form IDs in the admin change form pages.
Review Request #10955 — Created March 13, 2020 and submitted — Latest diff uploaded
The admin change form pages were heavily reliant on there being a model
that was being modified. We were basing the form IDs on this entirely.
We did allow the ID to be customized through aform_id
block, but that
only worked for the<form>
tag. The attribute was not passed to the
underlyingPageView
class. Since those are in entirely separate blocks
on the page, we weren't able to really define the variable in any good
place.Now that Djblets and Review Board support definition of global variables
in templates, we can address this. This change defines theform_id
variable as a new global variable in the newglobal-vars
block,
utilizing theform_id
block. We can then reference this both for the
form and the JavaScript.This fixes a handful of issues with the settings pages, and other pages
using thechange_form.html
template.
Tested several pages using this template. Verified that the form ID was
correct in each case, both those that used a model-based ID and those
that overrode the block.