Provide a model/view separation for comment blocks.

Review Request #3341 — Created Sept. 22, 2012 and submitted

Review Board
Provide a model/view separation for comment blocks.

Comment blocks on a screenshot have been reworked into a model/view
setup, and are now designed to be reused outside of screenshot
commenting. This makes use of Backbone.js to define the model and view.

We now have an AbstractCommentBlock model that keeps track of serialized
comments coming from the page, as well as any draft comment being made,
and the total count of comments.

There's a ScreenshotCommentBlock that knows how to store coordinate
information and create ScreenshotComments.

And finally, a ScreenshotCommentBlockView that knows how to render this
to the screen.

The code is not ideal yet, largely because we're still working with
lots of older code, so we can't use such constructs as Backbone
collections. In time, these models will be cleaned up a bit.
Tested viewing existing comments on a screenshot (including counts and tooltips).

Tested creating an empty comment and saving it.

Tested deleting the only comment in a block. Saw the bubble, and then the tooltip
and box fade out.

Tested deleting a draft comment when there were other comments. Saw the style
revert back to blue and the count and tooltip change.
  2. reviewboard/static/rb/js/screenshots.js (Diff revision 1)
    What's the xxx for?
    1. A note to myself that the positioning is accessing a private variable. This is replaced in my comment model change.
  1. Ship It!
Review request changed

Status: Closed (submitted)