Fix duplicating the "whitespace changes only" banner when expanding lines.

Review Request #8799 - Created March 6, 2017 and submitted

Christian Hammond
Review Board
release-2.0.x
4422
0ea4887...
reviewboard
Files that just have whitespace-only changes have a yellow banner saying
"This file contains only whitespace changes." This was being
unconditionally generated in the template for the first chunk in a file,
which meant that if you expanded the lines for the first chunk, you'd
get another copy of the banner, and same with collapsing.

This change adds a check in the template to prevent this banner from
appearing in "standalone" mode (where chunks of a diff are being
returned without the rest of the file).

It also adds a bottom border to this, so that when the chunk is
expanded, it has a nice clean separation from any equals lines.

Tested with a file containing only whitespace changes. Expanding and
collapsing the first chunk didn't result in duplicate banners.

Review Bot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/css/pages/diffviewer.less
    
    
    
    Tool: Pyflakes
    Ignored Files:
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/css/pages/diffviewer.less
    
    
  2. 
      
David Trowbridge
  1. Ship It!
  2. 
      
Christian Hammond
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.0.x (4f5e2f5)
Loading...