Add rendering of binary file attachments in the diff viewer.
Review Request #4468 — Created Aug. 20, 2013 and submitted
Add rendering of binary file attachments in the diff viewer. This introduces the ability to associate a FileAttachment with a path, revision and repository. The diff viewer can make use of this to render thumbnails for binary files. There's no way yet of associating a file outside of modifying the database. Later, there will be API and UI for this. This work is based on Tina Yang's work, with some fixes and a change in the association model. Previously, FileAttachments were associated with FileDiffs, but have been changed in order to reduce the number of duplicate files that exist in the database.
Generated a diff that introduced an image and modified another image. Initially, I saw the standard "This is a binary file," except with the Download links and the text in both the left-hand and right-hand sides. I then manually associated file attachments with these files. They didn't show up in the list of file attachments for the page, but they did show up in the diff viewer in the appropriate places.
Description | From | Last Updated |
---|---|---|
There's a lot more spacing between the second and third boxes than between the first and second. |
david | |
I really don't understand what this means. |
david | |
'DiffSet' imported but unused |
reviewbot | |
'DiffSetHistory' imported but unused |
reviewbot | |
thenew -> the new |
david | |
'AnonymousUser' imported but unused |
reviewbot | |
'Template' imported but unused |
reviewbot | |
'Context' imported but unused |
reviewbot | |
'Review' imported but unused |
reviewbot | |
'Tool' imported but unused |
reviewbot | |
Col: 80 E501 line too long (100 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (101 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (105 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (106 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (96 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (97 > 79 characters) |
reviewbot | |
local variable 'file_attachment' is assigned to but never used |
reviewbot | |
Col: 80 E501 line too long (101 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (102 > 79 characters) |
reviewbot | |
This comment is obsolete now, right? |
david | |
Col: 80 E501 line too long (100 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (101 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (105 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (106 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (96 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (97 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (101 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (102 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (100 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (101 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (105 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (106 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (96 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (97 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (101 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (102 > 79 characters) |
reviewbot |
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/attachments/managers.py reviewboard/attachments/models.py reviewboard/attachments/evolutions/file_attachment_repo_info.py reviewboard/attachments/admin.py reviewboard/scmtools/git.py reviewboard/attachments/tests.py reviewboard/attachments/templatetags/attachments.py reviewboard/attachments/evolutions/__init__.py Ignored Files: reviewboard/templates/diffviewer/diff_file_fragment.html reviewboard/static/rb/css/reviews.less reviewboard/static/rb/css/diffviewer.less reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/views/reviewRequestEditorView.js reviewboard/templates/reviews/reviewable_page_data.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js
-
-
-
-
-
-
-
-
- Change Summary:
-
* Removed a bunch of unused imports. * Fixed some documentation issues.
- Diff:
-
Revision 2 (+723 -139)
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/attachments/managers.py reviewboard/attachments/models.py reviewboard/attachments/evolutions/file_attachment_repo_info.py reviewboard/attachments/admin.py reviewboard/scmtools/git.py reviewboard/attachments/tests.py reviewboard/attachments/templatetags/attachments.py reviewboard/attachments/evolutions/__init__.py Ignored Files: reviewboard/templates/diffviewer/diff_file_fragment.html reviewboard/static/rb/css/reviews.less reviewboard/static/rb/css/diffviewer.less reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/views/reviewRequestEditorView.js reviewboard/templates/reviews/reviewable_page_data.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js
-
-
-
-
-
-
-
-
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/attachments/managers.py reviewboard/attachments/models.py reviewboard/attachments/evolutions/file_attachment_repo_info.py reviewboard/attachments/admin.py reviewboard/scmtools/git.py reviewboard/attachments/tests.py reviewboard/attachments/templatetags/attachments.py reviewboard/attachments/evolutions/__init__.py Ignored Files: reviewboard/templates/diffviewer/diff_file_fragment.html reviewboard/static/rb/css/reviews.less reviewboard/static/rb/css/diffviewer.less reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/views/reviewRequestEditorView.js reviewboard/templates/reviews/reviewable_page_data.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js
- Change Summary:
-
Changed the documentation for create_from_filediff.
- Diff:
-
Revision 3 (+726 -139)
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/attachments/managers.py reviewboard/attachments/models.py reviewboard/attachments/evolutions/file_attachment_repo_info.py reviewboard/attachments/admin.py reviewboard/scmtools/git.py reviewboard/attachments/tests.py reviewboard/attachments/templatetags/attachments.py reviewboard/attachments/evolutions/__init__.py Ignored Files: reviewboard/templates/diffviewer/diff_file_fragment.html reviewboard/static/rb/css/reviews.less reviewboard/static/rb/css/diffviewer.less reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/views/reviewRequestEditorView.js reviewboard/templates/reviews/reviewable_page_data.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js
-
-
-
-
-
-
-
-
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/attachments/managers.py reviewboard/attachments/models.py reviewboard/attachments/evolutions/file_attachment_repo_info.py reviewboard/attachments/admin.py reviewboard/scmtools/git.py reviewboard/attachments/tests.py reviewboard/attachments/templatetags/attachments.py reviewboard/attachments/evolutions/__init__.py Ignored Files: reviewboard/templates/diffviewer/diff_file_fragment.html reviewboard/static/rb/css/reviews.less reviewboard/static/rb/css/diffviewer.less reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/views/reviewRequestEditorView.js reviewboard/templates/reviews/reviewable_page_data.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js