Render the diff change index from JS instead of Django.
Review Request #4545 — Created Sept. 9, 2013 and submitted
Render the diff change index from JS instead of Django.
The new change index was about half template half javascript--we'd render the
basic table with each of the files from a django template, and then as diffs
were loaded, update it.This change moves the initial render into the javascript as well. The data is
plumbed into javascript by passing it into the DiffViewerPageView. This change
is one step towards being able to update the displayed diff (revision/page/etc)
without reloading everything.
- Viewed a handful of diff revisions and interdiffs. Saw the table as before in
each case. - Ran js-tests
- Ran jshint
Description | From | Last Updated |
---|---|---|
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
<table/>, for consistency. |
chipx86 | |
Where does print come from? Is that something from underscore? |
chipx86 | |
!== |
chipx86 | |
!== |
chipx86 | |
Can probably be one line. |
chipx86 | |
This feels weird. Why not just use <% %> as usual for these? |
chipx86 | |
The indentation level for the for statement doesn't seem to match where it should be respective to other tags. Same … |
chipx86 | |
Make sure we're escaping for JavaScript. We had a security hole due to exactly this once. |
chipx86 | |
Here too. |
chipx86 | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
The $ should probably be #, I'm guessing? |
chipx86 | |
These probably need to be escaped too, right? Not sure I see much reason to use print() over underscore's standard … |
chipx86 | |
On the model, revision is an integer. We may as well reflect that here. |
chipx86 | |
Same here. |
chipx86 | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot |
-
This is a review from Review Bot.
Tool: Pyflakes
Processed Files:
reviewboard/settings.py
Ignored Files:
reviewboard/static/rb/js/diffviewer/models/diffFileModel.js
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/diffviewer/collections/diffFileCollection.js
reviewboard/templates/diffviewer/changeindex.html
reviewboard/static/rb/js/pages/views/diffViewerPageView.js -
- Diff:
-
Revision 2 (+115 -37)
-
This is a review from Review Bot.
Tool: PEP8 Style Checker
Processed Files:
reviewboard/settings.py
Ignored Files:
reviewboard/static/rb/js/diffviewer/models/diffFileModel.js
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/diffviewer/collections/diffFileCollection.js
reviewboard/templates/diffviewer/changeindex.html
reviewboard/static/rb/js/pages/views/diffViewerPageView.js
-
This is a review from Review Bot.
Tool: Pyflakes
Processed Files:
reviewboard/settings.py
Ignored Files:
reviewboard/static/rb/js/diffviewer/models/diffFileModel.js
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/diffviewer/collections/diffFileCollection.js
reviewboard/templates/diffviewer/changeindex.html
reviewboard/static/rb/js/pages/views/diffViewerPageView.js -
- Diff:
-
Revision 3 (+115 -37)
-
This is a review from Review Bot.
Tool: PEP8 Style Checker
Processed Files:
reviewboard/settings.py
Ignored Files:
reviewboard/static/rb/js/diffviewer/models/diffFileModel.js
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/diffviewer/collections/diffFileCollection.js
reviewboard/templates/diffviewer/changeindex.html
reviewboard/static/rb/js/pages/views/diffViewerPageView.js
-
This is a review from Review Bot.
Tool: Pyflakes
Processed Files:
reviewboard/settings.py
Ignored Files:
reviewboard/static/rb/js/diffviewer/models/diffFileModel.js
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/diffviewer/collections/diffFileCollection.js
reviewboard/templates/diffviewer/changeindex.html
reviewboard/static/rb/js/pages/views/diffViewerPageView.js -