• 
      

    Move the main diffviewer views to extensible class-based views.

    Review Request #4471 — Created Aug. 21, 2013 and submitted — Latest diff uploaded

    Information

    Review Board
    master

    Reviewers

    Move the main diffviewer views to extensible class-based views.
    
    Django's pushing for class-based generic views for things, and in the
    case of the diff viewer, it provides a lot of advantages.
    
    So far, diffviewer has had a nice separation, where the code in
    diffviewer was able to focus solely on diff-related work, and the code
    in reviews was able to focus on objects related to review requests. This
    was getting hard to maintain with the new review UI support in the diff
    viewer, though, and it was clear a more extensible solution was needed.
    
    Now, the code for rendering the diff viewer and diff fragments are
    class-based. This simplifies part of the code, and gives us a foundation
    for some better extensibility by subclasses. The code in reviews will
    soon be able to do a lot more with the resulting renders without having
    to inject a bunch of new code into diffviewer.
    
    No logic was changed, but much of the code moved around.
    
    Going forward, some mixins for things like fetching review request data
    and checking login support will be created to reduce what these classes
    have to do. I'm leaving them out of this change, though.
    Tested standard diffs, interdiffs, and selecting revisions.
    
    Unit tests pass.