Fix some issues with new file attachment thumbnails.

Review Request #6269 — Created Aug. 25, 2014 and submitted

Information

Review Board
release-2.0.x
9c1cbdb...

Reviewers

When uploading file attachments, the generated thumbnails end up with
some glitches with the caption editor and links.

Opening the caption editor would result in the editor being shifted
over. This happened because the buttons element defaulted to 'display:
span' and not 'display: block' (due to a recent Djblets change),
messing up calculations.

The download links for new attachments were also wrong, pointing to
nothing. When the attachment is first created, we have an empty
RB.FileAttachment, and we never updated those links.

Similarly, icon URLs were set to 'null', causing 404s, at first. Now,
they're just not set until there's a value.

All values going into the template are now escaped, preventing breakages
if uploading a filename that has special characters.

And finally, several this.model.on() calls have been replaced with
this.listenTo() calls.

Uploaded files and checked all the links. They were valid.

Edited the caption, and saw that it appeared correctly.

Saw that there weren't any requests to 'null' for the icon anymore.

Checked existing file attachments. All links were correct.

Unit tests pass.

reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        reviewboard/static/rb/css/reviews.less
        reviewboard/static/rb/js/views/fileAttachmentThumbnailView.js
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/static/rb/css/reviews.less
        reviewboard/static/rb/js/views/fileAttachmentThumbnailView.js
    
    
  2. 
      
david
  1. Ship It!

  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.0.x (2d6d1e1)
Loading...