Centralize the templates used for review request page entries.

Review Request #9038 — Created June 27, 2017 and submitted

Information

Review Board
release-3.0.x
988be7b...

Reviewers

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.

daviddavid

Please call this "box-status-updates"

daviddavid

Col: 2 Expected a string and instead saw %.

reviewbotreviewbot

Col: 4 Expected ':' and instead saw 'load'.

reviewbotreviewbot

Col: 9 Expected a JSON value.

reviewbotreviewbot

Col: 9 Expected '}' and instead saw 'djblets_js'.

reviewbotreviewbot

Col: 9 Unrecoverable syntax error. (7% scanned).

reviewbotreviewbot

Please use either "status_area" or "status_updates_area" to be consistent with the naming throughout the rest of the code.

daviddavid

Please use either "status_area" or "status_updates_area" to be consistent with the naming throughout the rest of the code.

daviddavid

Col: 2 Expected a string and instead saw %.

reviewbotreviewbot

Col: 4 Expected ':' and instead saw 'load'.

reviewbotreviewbot

Col: 9 Expected a JSON value.

reviewbotreviewbot

Col: 9 Expected '}' and instead saw 'djblets_js'.

reviewbotreviewbot

Col: 9 Unrecoverable syntax error. (7% scanned).

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 passed.
JSHint failed.

JSHint

david
  1. 
      
  2. Show all issues

    Please use either "status_area" or "status_updates_area" to be consistent with the naming throughout the rest of the code.

    1. This isn't about status updates. This is the box-statuses section of the entry box where the Ship It and the Fix It labels are, along with avatars. It predates the status updates work.

    2. My bad.

    3. No worries, very easy to confuse the two. We might want to rename the thing on the side.

  3. Show all issues

    Please call this "box-status-updates"

  4. Show all issues

    Please use either "status_area" or "status_updates_area" to be consistent with the naming throughout the rest of the code.

  5. Show all issues

    Please use either "status_area" or "status_updates_area" to be consistent with the naming throughout the rest of the code.

  6. 
      
chipx86
Review request changed

Change Summary:

  • StatusUpdatesEntryMixin now inherits from DiffCommentsSerializerMixin and ReviewSerializerMixin and provides a common version of get_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:

-41260af4df16fd1246da79c3c6c06f3d14938dec
+988be7b39d2b0a85a810c5e3134c9d1fa9528b37

Diff:

Revision 2 (+382 -255)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 passed.
JSHint failed.

JSHint

david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (dfa1389)
Loading...