Fix the default form IDs in the admin change form pages.

Review Request #10955 — Created March 13, 2020 and submitted — Latest diff uploaded

Information

Review Board
release-4.0.x

Reviewers

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 a form_id block, but that
only worked for the <form> tag. The attribute was not passed to the
underlying PageView 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 the form_id
variable as a new global variable in the new global-vars block,
utilizing the form_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 the change_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.

Commits

Files