Move the ReviewablePageView data generation to a template tag.
Review Request #9154 — Created Aug. 28, 2017 and submitted
The review request, diff viewer, and review UI pages all need a large
payload for the options for the page views (
particular). We generated this with an includable template, but over
time this has grown to the point where it's a pain to maintain and not
This change replaces the template with a template tag. The new tag
generates the same data, but does so server-side, encoding to JSON at
the end (instead of having to encode various bits of data through other
template tags). This should speed up render times and make it much
easier for us to augment the data down the road.
This is part of a larger set of changes that are needed for dynamic
updating of the review request page.
Tested that all the pages worked correctly. All data was provided and
the UIs still work as normal.
Performed JSON comparisons of the old and new data. Aside from some
fields that are no longer provided if empty, the data has not changed.
- Moved the
send_emaildata into the common context dictionary for all pages.
- Conditionally check the file attachments data instead of assuming it always exists.
Revision 2 (+271 -138)