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

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

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.

Summary ID
Fix the default form IDs in the admin change form pages.
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.
987fee268176978293a00f60edc3cc386122343d
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.0.x (128139c)
Loading...