Add support for expanding hidden context in the diff viewer

Review Request #105 — Created July 1, 2007 and submitted


Review Board SVN (deprecated)


This change adds a "[Expand]" link to the "n lines hidden" bars in the diff viewer that, when clicked, will replace the bar with the contents of that chunk. There's no way to collapse again aside from reloading the page, but it's probably not a major problem in practice, and keeps the UI from being too cluttered.

Any comment flags in the chunk being expanded will be displayed. Also fixed a bug where there was an infinite loop when trying to load a collapsed diff view when a comment existed in a collapsed region.
Loaded a diff and went around expanding sections. Placed some comments in the now expanded areas and in actual changed areas. Reloaded the page to re-collapse all chunks and saw only the comment flags that should be visible. Expanded the collapsed sections and saw the other command flags display.
  1. Just a few small things.
  2. Can you reindent this to match everything else?
    1. Yeah, but I'll do it as a separate change. I want to do some cleanups in there anyway.
  3. /trunk/reviewboard/diffviewer/ (Diff revision 1)
    What about your fancy new function?
    1. Thought about it, but is that really appropriate here? We'd be checking for pk=None, which of course will return None, but I'm not sure if that's an abuse of the function or not? Probably should just use the new function though.
  4. /trunk/reviewboard/ (Diff revision 1)
    1. It's just the browser wrapping it, as it's treating it as one large word. Notice how that line spans two lines. The first line contains the indentation.