Centralize the templates used for review request page entries.
Review Request #9038 — Created June 27, 2017 and submitted
Entries on the review request page (reviews, changes, and the initial
status updates) now share the same base templates, with information
provided by the entry classes on the Python side.The base template provides the general structure used for boxes on the
review request page, handling anchors, avatars, labels, the header,
banners, and container for the main content. The specific entries
subclass this, filling out the necessary blocks to set the CSS classes,
header title, entry content, labels, etc. that are needed.Avatars are based on a new
avatar_user
attribute on entries. If set,
and if avatars are enabled, that user's avatar will be rendered.
Templates can also provide custom images to use here.There's now only a single JavaScript template for constructing the
model/view for each entry. The data and options are provided by new
methods on the entry classes on the Python side, as are the names of the
model/view JavaScript classes to use.These changes make it easier to maintain entries, and will lead to
extension-provided entries for the review request page.
Tested that reviews, replies, changes (with and without status updates),
and the initial status updates entries all looked correct and all had
complete functionality (replying, collapsing, revoking Ship Its, etc. all
worked).Tested with avatars enabled and disabled.
Description | From | Last Updated |
---|---|---|
Please use either "status_area" or "status_updates_area" to be consistent with the naming throughout the rest of the code. |
david | |
Please call this "box-status-updates" |
david | |
Col: 2 Expected a string and instead saw %. |
reviewbot | |
Col: 4 Expected ':' and instead saw 'load'. |
reviewbot | |
Col: 9 Expected a JSON value. |
reviewbot | |
Col: 9 Expected '}' and instead saw 'djblets_js'. |
reviewbot | |
Col: 9 Unrecoverable syntax error. (7% scanned). |
reviewbot | |
Please use either "status_area" or "status_updates_area" to be consistent with the naming throughout the rest of the code. |
david | |
Please use either "status_area" or "status_updates_area" to be consistent with the naming throughout the rest of the code. |
david | |
Col: 2 Expected a string and instead saw %. |
reviewbot | |
Col: 4 Expected ':' and instead saw 'load'. |
reviewbot | |
Col: 9 Expected a JSON value. |
reviewbot | |
Col: 9 Expected '}' and instead saw 'djblets_js'. |
reviewbot | |
Col: 9 Unrecoverable syntax error. (7% scanned). |
reviewbot |
-
-
Please use either "status_area" or "status_updates_area" to be consistent with the naming throughout the rest of the code.
-
-
Please use either "status_area" or "status_updates_area" to be consistent with the naming throughout the rest of the code.
-
Please use either "status_area" or "status_updates_area" to be consistent with the naming throughout the rest of the code.
- Change Summary:
-
StatusUpdatesEntryMixin
now inherits fromDiffCommentsSerializerMixin
andReviewSerializerMixin
and provides a common version ofget_js_model_data
.- JavaScript model data for reviews and diff comments is now only serialized if there's something to serialize (no more empty entries).
- Commit:
-
41260af4df16fd1246da79c3c6c06f3d14938dec988be7b39d2b0a85a810c5e3134c9d1fa9528b37
- Diff:
-
Revision 2 (+382 -255)