Pull out diff-related data into a "diff context" object and initialize models from it.
Review Request #4618 — Created Sept. 21, 2013 and submitted
Pull out diff-related data into a "diff context" object and initialize models from it.
The diff viewer needs a bunch of bits of data, which we render in a django
template as info in a <script> tag and then consume from javascript. This
change centralizes all of that info into a "diff_context" object which is
rendered using the json_dumps filter tag. This object is then consumed by a new
DiffViewerPageModel, which will parse the high-level object and create/update a
bunch of child models, which are then consumed by the various views that make
up the diff viewer UI.Coming soon, we'll be able to consume this diff context either from the
javascript rendered into the template, as well as when it comes from an API
payload.
- Tested various pieces of the diff viewer UI to make sure that the initial
data was still correct. - Used this in conjunction with other changes that load different parts of the
diff viewer without reloads. - Ran unit tests.
Description | From | Last Updated |
---|---|---|
Col: 80 E501 line too long (86 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (85 > 79 characters) |
reviewbot | |
undefined name 'escape' |
reviewbot | |
undefined name 'BaseComment' |
reviewbot | |
local variable 'diffset_pair' is assigned to but never used |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
Can you make this alphabetical while here? |
chipx86 | |
These are all separate sets of things. Blank lines between these three? |
chipx86 | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
Trailing comma. |
chipx86 | |
We fetch this and 'numDiffs' twice. Can you cache this? |
chipx86 | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot |
-
This is a review from Review Bot.
Tool: Pyflakes
Processed Files:
reviewboard/reviews/views.py
reviewboard/settings.py
reviewboard/reviews/tests.py
reviewboard/reviews/templatetags/reviewtags.py
reviewboard/diffviewer/views.py
reviewboard/reviews/context.py
Ignored Files:
reviewboard/static/rb/js/diffviewer/models/paginationModel.js
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/pages/models/diffViewerPageModel.js
reviewboard/static/rb/js/diffviewer/models/diffFileModel.js
reviewboard/static/rb/js/diffviewer/models/diffRevisionModel.js
reviewboard/static/rb/js/pages/views/diffViewerPageView.js -
-
-
-
- Diff:
-
Revision 2 (+294 -240)
-
This is a review from Review Bot.
Tool: PEP8 Style Checker
Processed Files:
reviewboard/reviews/views.py
reviewboard/settings.py
reviewboard/reviews/tests.py
reviewboard/reviews/templatetags/reviewtags.py
reviewboard/diffviewer/views.py
reviewboard/reviews/context.py
Ignored Files:
reviewboard/static/rb/js/diffviewer/models/paginationModel.js
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/pages/models/diffViewerPageModel.js
reviewboard/static/rb/js/diffviewer/models/diffFileModel.js
reviewboard/static/rb/js/diffviewer/models/diffRevisionModel.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/settings.py
reviewboard/reviews/tests.py
reviewboard/reviews/templatetags/reviewtags.py
reviewboard/diffviewer/views.py
reviewboard/reviews/context.py
Ignored Files:
reviewboard/static/rb/js/diffviewer/models/paginationModel.js
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/pages/models/diffViewerPageModel.js
reviewboard/static/rb/js/diffviewer/models/diffFileModel.js
reviewboard/static/rb/js/diffviewer/models/diffRevisionModel.js
reviewboard/static/rb/js/pages/views/diffViewerPageView.js -
- Diff:
-
Revision 3 (+299 -241)
-
This is a review from Review Bot.
Tool: PEP8 Style Checker
Processed Files:
reviewboard/reviews/views.py
reviewboard/settings.py
reviewboard/reviews/tests.py
reviewboard/reviews/templatetags/reviewtags.py
reviewboard/diffviewer/views.py
reviewboard/reviews/context.py
Ignored Files:
reviewboard/static/rb/js/diffviewer/models/paginationModel.js
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/pages/models/diffViewerPageModel.js
reviewboard/static/rb/js/diffviewer/models/diffFileModel.js
reviewboard/static/rb/js/diffviewer/models/diffRevisionModel.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/settings.py
reviewboard/reviews/tests.py
reviewboard/reviews/templatetags/reviewtags.py
reviewboard/diffviewer/views.py
reviewboard/reviews/context.py
Ignored Files:
reviewboard/static/rb/js/diffviewer/models/paginationModel.js
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/pages/models/diffViewerPageModel.js
reviewboard/static/rb/js/diffviewer/models/diffFileModel.js
reviewboard/static/rb/js/diffviewer/models/diffRevisionModel.js
reviewboard/static/rb/js/pages/views/diffViewerPageView.js -
- Diff:
-
Revision 4 (+299 -241)
-
This is a review from Review Bot.
Tool: PEP8 Style Checker
Processed Files:
reviewboard/reviews/views.py
reviewboard/settings.py
reviewboard/reviews/tests.py
reviewboard/reviews/templatetags/reviewtags.py
reviewboard/diffviewer/views.py
reviewboard/reviews/context.py
Ignored Files:
reviewboard/static/rb/js/diffviewer/models/paginationModel.js
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/pages/models/diffViewerPageModel.js
reviewboard/static/rb/js/diffviewer/models/diffFileModel.js
reviewboard/static/rb/js/diffviewer/models/diffRevisionModel.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/settings.py
reviewboard/reviews/tests.py
reviewboard/reviews/templatetags/reviewtags.py
reviewboard/diffviewer/views.py
reviewboard/reviews/context.py
Ignored Files:
reviewboard/static/rb/js/diffviewer/models/paginationModel.js
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/pages/models/diffViewerPageModel.js
reviewboard/static/rb/js/diffviewer/models/diffFileModel.js
reviewboard/static/rb/js/diffviewer/models/diffRevisionModel.js
reviewboard/static/rb/js/pages/views/diffViewerPageView.js -