• 
      

    Add previous and next buttons to navigate between file attachments

    Review Request #8443 — Created Sept. 27, 2016 and submitted

    Information

    Review Board
    release-3.0.x
    0992759...

    Reviewers

    The file attachment UI previously did not have any way to navigate
    between any file attachments. A user would have to navigate back to the
    review request and select the next one they wished to review.

    Now there are previous and next buttons on the edges of the page when
    there are more file attachments to review. They follow the order of the
    review request UI and only navigate to active (and latest revisions).
    When they are hovered over, they expand out to show the thumbnail of the
    attachment that will be navigated to.

    Ran unit tests.

    Tested in the following browsers on OSX:

    • Chrome
    • Firefox release
    • Firefox developer edition
    • Safari

    Verified the links were correct on local site review requests.


    Description From Last Updated

    Can you show screenshots/add Testing Done for this on both Firefox (stable) and Chrome?

    chipx86 chipx86

    Can you also test with Local Sites to make sure links are correct?

    chipx86 chipx86

    Can we give this a bit of a box-shadow so that the layering is more apparent?

    david david

    It might be nice to break this out into a method, or at least comment it and explain what it's …

    david david

    Perhaps we can change get_latest_file_attachments to return a generator expression instead of a list?

    david david

    I don't think this change is correct.

    david david

    Where does the 14px come from?

    david david

    There's an extra space before this templatetag.

    david david

    This is all indented 1 space too much.

    david david

    Indented 1 space too much.

    david david

    undefined name 'next_obj'

    reviewbot reviewbot

    undefined name 'prev_obj'

    reviewbot reviewbot

    Col: 80 E501 line too long (117 > 79 characters)

    reviewbot reviewbot

    It might be nice to say what "next" and "previous" mean.

    david david

    Col: 80 E501 line too long (117 > 79 characters)

    reviewbot reviewbot

    Can we define a constant for this?

    david david

    Col: 80 E501 line too long (117 > 79 characters)

    reviewbot reviewbot

    If we made a change to have @page-container-padding be in px instead of em, we could use LESS's calculations here …

    david david

    Col: 80 E501 line too long (117 > 79 characters)

    reviewbot reviewbot

    Col: 80 E501 line too long (117 > 79 characters)

    reviewbot reviewbot

    Col: 80 E501 line too long (117 > 79 characters)

    reviewbot reviewbot

    Should be: Yields: reviewboard.attachments.models.FileAttachment ...

    chipx86 chipx86

    Col: 80 E501 line too long (117 > 79 characters)

    reviewbot reviewbot

    Swap these. Elements before classes. (Elements, then IDs, then classes.)

    chipx86 chipx86

    Swap these.

    chipx86 chipx86

    Two blank lines.

    chipx86 chipx86

    You shouldn't need to use the "localsite" template tag for anything. The url tag from there is automatically injected globally …

    chipx86 chipx86

    We want to use the display ID, not the database ID, for review requests on these URLs.

    chipx86 chipx86

    Col: 80 E501 line too long (117 > 79 characters)

    reviewbot reviewbot
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/reviews/views.py
          reviewboard/reviews/ui/base.py
          reviewboard/attachments/models.py
      
      Ignored Files:
          reviewboard/templates/reviews/ui/base.html
          reviewboard/static/rb/css/pages/reviews.less
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/reviews/views.py
          reviewboard/reviews/ui/base.py
          reviewboard/attachments/models.py
      
      Ignored Files:
          reviewboard/templates/reviews/ui/base.html
          reviewboard/static/rb/css/pages/reviews.less
      
      
    2. 
        
    david
    1. 
        
    2. reviewboard/reviews/ui/base.py (Diff revision 1)
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
      Show all issues

      It might be nice to break this out into a method, or at least comment it and explain what it's doing.

    3. reviewboard/reviews/ui/base.py (Diff revision 1)
       
       
      Show all issues

      Perhaps we can change get_latest_file_attachments to return a generator expression instead of a list?

    4. reviewboard/reviews/views.py (Diff revision 1)
       
       
      Show all issues

      I don't think this change is correct.

      1. Thanks for catching that.

    5. Show all issues

      Where does the 14px come from?

    6. Show all issues

      There's an extra space before this templatetag.

    7. reviewboard/templates/reviews/ui/base.html (Diff revision 1)
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
      Show all issues

      This is all indented 1 space too much.

    8. reviewboard/templates/reviews/ui/base.html (Diff revision 1)
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
      Show all issues

      Indented 1 space too much.

    9. 
        
    brennie
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/reviews/views.py
          reviewboard/reviews/ui/base.py
          reviewboard/attachments/models.py
      
      Ignored Files:
          reviewboard/templates/reviews/ui/base.html
          reviewboard/static/rb/css/pages/reviews.less
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/reviews/views.py
          reviewboard/reviews/ui/base.py
          reviewboard/attachments/models.py
      
      Ignored Files:
          reviewboard/templates/reviews/ui/base.html
          reviewboard/static/rb/css/pages/reviews.less
      
      
    2. reviewboard/reviews/ui/base.py (Diff revision 2)
       
       
      Show all issues
       undefined name 'next_obj'
      
    3. reviewboard/reviews/ui/base.py (Diff revision 2)
       
       
      Show all issues
       undefined name 'prev_obj'
      
    4. reviewboard/reviews/ui/base.py (Diff revision 2)
       
       
      Show all issues
      Col: 80
       E501 line too long (117 > 79 characters)
      
    5. 
        
    brennie
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/reviews/views.py
          reviewboard/reviews/ui/base.py
          reviewboard/attachments/models.py
      
      Ignored Files:
          reviewboard/templates/reviews/ui/base.html
          reviewboard/static/rb/css/pages/reviews.less
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/reviews/views.py
          reviewboard/reviews/ui/base.py
          reviewboard/attachments/models.py
      
      Ignored Files:
          reviewboard/templates/reviews/ui/base.html
          reviewboard/static/rb/css/pages/reviews.less
      
      
    2. reviewboard/reviews/ui/base.py (Diff revision 3)
       
       
      Show all issues
      Col: 80
       E501 line too long (117 > 79 characters)
      
    3. 
        
    david
    1. 
        
    2. Show all issues

      Can we give this a bit of a box-shadow so that the layering is more apparent?

    3. reviewboard/reviews/ui/base.py (Diff revision 3)
       
       
      Show all issues

      It might be nice to say what "next" and "previous" mean.

    4. 
        
    brennie
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/reviews/views.py
          reviewboard/reviews/ui/base.py
          reviewboard/attachments/models.py
      
      Ignored Files:
          reviewboard/templates/reviews/ui/base.html
          reviewboard/static/rb/css/pages/reviews.less
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/reviews/views.py
          reviewboard/reviews/ui/base.py
          reviewboard/attachments/models.py
      
      Ignored Files:
          reviewboard/templates/reviews/ui/base.html
          reviewboard/static/rb/css/pages/reviews.less
      
      
    2. reviewboard/reviews/ui/base.py (Diff revision 4)
       
       
      Show all issues
      Col: 80
       E501 line too long (117 > 79 characters)
      
    3. 
        
    david
    1. 
        
    2. reviewboard/static/rb/css/pages/reviews.less (Diff revisions 3 - 4)
       
       
      Show all issues

      Can we define a constant for this?

      1. Replaced this with a calc() expression.

    3. 
        
    brennie
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/reviews/views.py
          reviewboard/reviews/ui/base.py
          reviewboard/attachments/models.py
      
      Ignored Files:
          reviewboard/templates/reviews/ui/base.html
          reviewboard/static/rb/css/pages/reviews.less
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/reviews/views.py
          reviewboard/reviews/ui/base.py
          reviewboard/attachments/models.py
      
      Ignored Files:
          reviewboard/templates/reviews/ui/base.html
          reviewboard/static/rb/css/pages/reviews.less
      
      
    2. reviewboard/reviews/ui/base.py (Diff revision 5)
       
       
      Show all issues
      Col: 80
       E501 line too long (117 > 79 characters)
      
    3. 
        
    david
    1. 
        
    2. reviewboard/static/rb/css/pages/reviews.less (Diff revisions 4 - 5)
       
       
      Show all issues

      If we made a change to have @page-container-padding be in px instead of em, we could use LESS's calculations here instead of calc().

    3. 
        
    brennie
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/reviews/views.py
          reviewboard/reviews/ui/base.py
          reviewboard/attachments/models.py
      
      Ignored Files:
          reviewboard/templates/reviews/ui/base.html
          reviewboard/static/rb/css/pages/reviews.less
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/reviews/views.py
          reviewboard/reviews/ui/base.py
          reviewboard/attachments/models.py
      
      Ignored Files:
          reviewboard/templates/reviews/ui/base.html
          reviewboard/static/rb/css/pages/reviews.less
      
      
    2. reviewboard/reviews/ui/base.py (Diff revision 6)
       
       
      Show all issues
      Col: 80
       E501 line too long (117 > 79 characters)
      
    3. 
        
    brennie
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/reviews/views.py
          reviewboard/reviews/ui/base.py
          reviewboard/attachments/models.py
      
      Ignored Files:
          reviewboard/templates/reviews/ui/base.html
          reviewboard/static/rb/css/pages/reviews.less
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/reviews/views.py
          reviewboard/reviews/ui/base.py
          reviewboard/attachments/models.py
      
      Ignored Files:
          reviewboard/templates/reviews/ui/base.html
          reviewboard/static/rb/css/pages/reviews.less
      
      
    2. reviewboard/reviews/ui/base.py (Diff revision 7)
       
       
      Show all issues
      Col: 80
       E501 line too long (117 > 79 characters)
      
    3. 
        
    brennie
    brennie
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/reviews/views.py
          reviewboard/reviews/ui/base.py
          reviewboard/attachments/models.py
      
      Ignored Files:
          reviewboard/templates/reviews/ui/base.html
          reviewboard/static/rb/css/pages/reviews.less
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/reviews/views.py
          reviewboard/reviews/ui/base.py
          reviewboard/attachments/models.py
      
      Ignored Files:
          reviewboard/templates/reviews/ui/base.html
          reviewboard/static/rb/css/pages/reviews.less
      
      
    2. reviewboard/reviews/ui/base.py (Diff revision 8)
       
       
      Show all issues
      Col: 80
       E501 line too long (117 > 79 characters)
      
    3. 
        
    chipx86
    1. 
        
    2. Show all issues

      Can you show screenshots/add Testing Done for this on both Firefox (stable) and Chrome?

    3. Show all issues

      Can you also test with Local Sites to make sure links are correct?

    4. reviewboard/attachments/models.py (Diff revision 8)
       
       
       
      Show all issues

      Should be:

      Yields:
          reviewboard.attachments.models.FileAttachment
          ...
      
    5. reviewboard/static/rb/css/pages/reviews.less (Diff revision 8)
       
       
       
       
       
       
       
       
      Show all issues

      Swap these. Elements before classes. (Elements, then IDs, then classes.)

    6. Show all issues

      Swap these.

    7. reviewboard/static/rb/css/pages/reviews.less (Diff revision 8)
       
       
       
       
      Show all issues

      Two blank lines.

    8. Show all issues

      You shouldn't need to use the "localsite" template tag for anything. The url tag from there is automatically injected globally by Review Board.

    9. Show all issues

      We want to use the display ID, not the database ID, for review requests on these URLs.

    10. 
        
    brennie
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/reviews/views.py
          reviewboard/reviews/ui/base.py
          reviewboard/attachments/models.py
      
      Ignored Files:
          reviewboard/templates/reviews/ui/base.html
          reviewboard/static/rb/css/pages/reviews.less
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/reviews/views.py
          reviewboard/reviews/ui/base.py
          reviewboard/attachments/models.py
      
      Ignored Files:
          reviewboard/templates/reviews/ui/base.html
          reviewboard/static/rb/css/pages/reviews.less
      
      
    2. reviewboard/reviews/ui/base.py (Diff revision 9)
       
       
      Show all issues
      Col: 80
       E501 line too long (117 > 79 characters)
      
    3. 
        
    chipx86
    1. 
        
    2. 
        
    brennie
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-3.0.x (e68e977)