Merge lp://staging/~adeuring/launchpad/js-translation-2 into lp://staging/launchpad

Proposed by Abel Deuring
Status: Merged
Approved by: Abel Deuring
Approved revision: no longer in the source branch.
Merged at revision: 12718
Proposed branch: lp://staging/~adeuring/launchpad/js-translation-2
Merge into: lp://staging/launchpad
Prerequisite: lp://staging/~adeuring/launchpad/js-translation
Diff against target: 471 lines (+326/-21)
3 files modified
lib/lp/translations/browser/sourcepackage.py (+84/-9)
lib/lp/translations/browser/tests/test_sharing_details.py (+235/-1)
lib/lp/translations/templates/sourcepackage-sharing-details.pt (+7/-11)
To merge this branch: bzr merge lp://staging/~adeuring/launchpad/js-translation-2
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+55575@code.staging.launchpad.net

Commit message

[r=allenap][bug=732639][incr] prepare the translation sharing settings page for YUIfication

Description of the change

This branch finishes the prepeataion of the translation sharing
settings page for source packages for its "YUIfication".

The page now always includes links to the translation configuration
page of the upstream product and to the translation sync page of
the upstream series. If no packaing link exists, i.e., if no
upstream product series is defined, a dummy link is rendered.

The second change of lib/lp/translations/browser/sourcepackage.py
(@@ -140,10 +142,10 @@) mimics the change from a branch submitted
by Henning earlier today which follows William's reminder to properly
use structured() when HTML data is generated in view class methods.

The third change (@@ -155,12 +157,13 @@) applies this reminder to
another method. This change is not strictly necessary, since the
text was already passed through cgi.escape(), but I think we should
be consistent in the way we generate HTML data in a view class.

The fourth hunk (@@ -339,10 +342,10 @@) lets anther method use
structured().

The two latter changes are a bit questionable, because they let
structured() expand an href attribute, which eequries in theory
a special treatment of characters like '"', '<', '>', but I
don't think this is a real issue, because we insert only Launchpad
URLs, and AFAIK we don't use these characters anywhere.

test: ./bin/test translations -vvt test_sharing_details

no lint

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) wrote :

Looks good :)

[1]

In getConfigureTranslationsLink():

+ url = '%s/%s' % (canonical_url(product), settings_link.target)

Could this be achieved with:

            url = canonical_url(product, view_name=settings_link.target)

?

There's similar code in getTranslationSynchronisationLink().

[2]

+ view = SourcePackageTranslationSharingDetailsView(
+ self.sourcepackage, LaunchpadTestRequest())
+ view.initialize()

It's not a huge saving, and you might well already know about it, but
lp.testing.views.create_initialized_view is a useful helper that does
this for you.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.