Make the "Diff Revision" label dynamically rendered in javascript.
Review Request #4555 — Created Sept. 10, 2013 and submitted
Make the "Diff Revision" label dynamically rendered in javascript.
In order to be able to update the displayed revision, this content needs to be
generated on the client side instead of the server.
- Viewed various revisions of a diff, including interdiffs. Saw the expected
text each time. - Checked that the "latest diff" and "See what's changed" links worked
correctly. - Ran js-tests.
- Ran jshint.
Description | From | Last Updated |
---|---|---|
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
The <h1> shouldn't be part of the localized string. |
chipx86 | |
Same. |
chipx86 | |
It doesn't seem that all this should be localized. The "Diff revision XYZ" should, and the "This is not ..." … |
chipx86 | |
This should also be two strings, and should not involve tags. That's a layout thing for a template to deal … |
chipx86 | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
This is the only detail string without tags. Do we want to make sure we escape here? |
chipx86 | |
Maybe just have a string for the revision, and build the common parts after (or in the call to window.location). … |
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/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/diffviewer/views/diffRevisionLabelView.js
reviewboard/static/rb/js/diffviewer/models/diffRevisionModel.js
reviewboard/static/rb/js/pages/views/diffViewerPageView.js -
-
-
-
-
It doesn't seem that all this should be localized. The "Diff revision XYZ" should, and the "This is not ..." should, and the "See what's changed" should, but not as one big string.
The layout of this is going to change quite a lot soon anyway.
-
This should also be two strings, and should not involve tags. That's a layout thing for a template to deal with.
-
This is a review from Review Bot.
Tool: PEP8 Style Checker
Processed Files:
reviewboard/settings.py
Ignored Files:
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/diffviewer/views/diffRevisionLabelView.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/settings.py
Ignored Files:
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/diffviewer/views/diffRevisionLabelView.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: PEP8 Style Checker
Processed Files:
reviewboard/settings.py
Ignored Files:
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/diffviewer/views/diffRevisionLabelView.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/settings.py
Ignored Files:
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/diffviewer/views/diffRevisionLabelView.js
reviewboard/static/rb/js/diffviewer/models/diffRevisionModel.js
reviewboard/static/rb/js/pages/views/diffViewerPageView.js -
- Change Summary:
-
Empty out the element before sticking new data in. This isn't important for this change today, but will be once we get rid of reloads.
- Diff:
-
Revision 4 (+153 -37)
-
This is a review from Review Bot.
Tool: PEP8 Style Checker
Processed Files:
reviewboard/settings.py
Ignored Files:
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/diffviewer/views/diffRevisionLabelView.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/settings.py
Ignored Files:
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/diffviewer/views/diffRevisionLabelView.js
reviewboard/static/rb/js/diffviewer/models/diffRevisionModel.js
reviewboard/static/rb/js/pages/views/diffViewerPageView.js -
-
-
So here's another issue to figure out involving localization and tags and such.
In the main template, we're using <%= detail %>, so we won't get escaping. This is clearly done because the other templates contain tags, which is fine.
Now, way we localize and get some characters in the strings that need to be escaped. We now have no mechanism to escape them, so the translated strings themselves will have to be escaped. That means we have to trust the strings to never be wrong.
What are your thoughts on that?
-
Any reason we don't just operate on this.$el instead?
(I'm assuming it's for expansion, but just wanted to check.)
-
-
Maybe just have a string for the revision, and build the common parts after (or in the call to window.location). No sense in duplicating the diff/ and #index_header parts.
-
This is a review from Review Bot.
Tool: PEP8 Style Checker
Processed Files:
reviewboard/settings.py
Ignored Files:
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/diffviewer/views/diffRevisionLabelView.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/settings.py
Ignored Files:
reviewboard/templates/diffviewer/view_diff.html
reviewboard/static/rb/js/diffviewer/views/diffRevisionLabelView.js
reviewboard/static/rb/js/diffviewer/models/diffRevisionModel.js
reviewboard/static/rb/js/pages/views/diffViewerPageView.js -