Merge lp://staging/~danilo/launchpad/complex-forms into lp://staging/launchpad

Proposed by Данило Шеган
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~danilo/launchpad/complex-forms
Merge into: lp://staging/launchpad
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~danilo/launchpad/complex-forms
Reviewer Review Type Date Requested Status
Jeroen T. Vermeulen (community) Approve
Review via email: mp+11047@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) wrote :

= Bug #423103, #423104 =

Migrate a few "complex" forms: those which do use LaunchpadForm, but
embedded in a bigger page. Changes are mostly mechanical to make them
3.0-compatible.

== Implementation details ==

Lots of whitespace fixes (replacing tabs with spaces and similar) and
reindentation increase the size of the diff.

For translationimportqueueentry-index.pt, I also improve next_url
handling so we get back to the import queue which we started from
(basically, +imports page is registered on all of IProduct,
IProductSeries, IDistribution, IDistroSeries, IPerson, but they all go
to the same ITranslationImportQueueEntry edit form, and after
submission should go back). A separate test is added for that, though
it does exhibit some Zope testbrowser bugs in referrer handling.

Everything else is just bits and pieces moved around.

I've also moved translation import queue tests into a separate "story"
so they are easier to run when needed.

== Tests ==

bin/test -vvt stories.importqueue -t translations-xpi-import.txt -t productseries-translations-bzr-request -t distroseries-language-pack

== Demo and Q/A ==

translationsimportqueueentry-index.pt:

 https://translations.launchpad.dev/+imports/1
 (and get there through /+imports, /evolution/+imports, /~name16/+imports)

distroseries-language-packs.pt:

 https://translations.launchpad.dev/ubuntu/hoary/+language-packs

productseries-translations-bzr-import.pt:

 https://translations.launchpad.dev/evolution/trunk/+request-bzr-import

productseries-translations-settings.pt:

 https://translations.launchpad.dev/evolution/trunk/+translations-settings

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/translations/stories/standalone/xx-translations-xpi-import.txt
  lib/lp/translations/stories/productseries/xx-productseries-translations-bzr-request.txt
  lib/lp/translations/stories/importqueue/xx-translation-import-queue-entry.txt
  lib/canonical/launchpad/pagetitles.py
  lib/lp/translations/templates/distroseries-language-packs.pt
  lib/lp/translations/browser/translationimportqueue.py
  lib/lp/translations/stories/importqueue/xx-translation-import-queue-filtering.txt
  lib/lp/translations/templates/productseries-translations-settings.pt
  lib/lp/translations/templates/productseries-translations-bzr-import.pt
  lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt
  lib/lp/translations/browser/productseries.py
  lib/lp/translations/templates/translationimportqueueentry-index.pt
  lib/lp/translations/stories/importqueue/xx-translation-import-queue-edit-autofilling.txt
  lib/lp/translations/stories/distroseries/xx-distroseries-language-packs.txt

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Hi Danilo,

Sheer poetry. My main gripe—because I just _had_ to find one!—is that
you didn't turn the icons into sprites. Any chance of getting that in?

Also, in productseries-translations-settings.pt, the TAL still composes
links to branches the painful way, complete with icons. I was probably
guilty of that myself in the case of the export branch. Can't we use
fmt:link for these?

All this will break some pagetests, but I heard it will make our hair
glow with natural beauty and make our cars use less gasoline.

As for the whitespace cleanup: are you out to prove that emacs is good
for this? Not that I'd mind if you were. :-)

Jeroen

review: Approve
Revision history for this message
Данило Шеган (danilo) wrote :

У сре, 02. 09 2009. у 13:08 +0000, Jeroen T. Vermeulen пише:
> Sheer poetry. My main gripe—because I just _had_ to find one!—is that
> you didn't turn the icons into sprites. Any chance of getting that
> in?

Sure, done that now.

> Also, in productseries-translations-settings.pt, the TAL still
> composes links to branches the painful way, complete with icons. I
> was probably guilty of that myself in the case of the export branch.
> Can't we use fmt:link for these?

Yeah, I did this, but that one of yours caused me the most trouble: you
set an ID on it, and then used that in a pagetest. When using fmt:link,
you can't do that, and there's no getLink() on anything other than the
browser. Doing browser.open(link['href']) caused more trouble then it
helped so I resorted to using browser.getLink(url=branch_name) which
worked, but it was an exercise in its own right.

> All this will break some pagetests, but I heard it will make our hair
> glow with natural beauty and make our cars use less gasoline.

If our cars use less gasoline, what are we going to do with what we are
left on Earth? It's not like we can eat it so we should better spend it
all.

> As for the whitespace cleanup: are you out to prove that emacs is good
> for this? Not that I'd mind if you were. :-)

Nah, I wasn't actually expecting you to review this :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed directory 'lib/canonical/launchpad/pagetests/distroseries'
=== modified file 'lib/canonical/launchpad/pagetitles.py'
--- lib/canonical/launchpad/pagetitles.py 2009-09-01 11:09:53 +0000
+++ lib/canonical/launchpad/pagetitles.py 2009-09-01 11:38:24 +0000
@@ -943,9 +943,6 @@
943943
944productseries_translations_settings = 'Settings for translations'944productseries_translations_settings = 'Settings for translations'
945945
946productseries_translations_bzr_import = (
947 'Request translations import from Bazaar branch')
948
949project_add = 'Register a project group with Launchpad'946project_add = 'Register a project group with Launchpad'
950947
951project_index = ContextTitle('%s in Launchpad')948project_index = ContextTitle('%s in Launchpad')
952949
=== modified file 'lib/lp/translations/browser/productseries.py'
--- lib/lp/translations/browser/productseries.py 2009-08-31 14:29:30 +0000
+++ lib/lp/translations/browser/productseries.py 2009-09-01 11:38:24 +0000
@@ -435,6 +435,17 @@
435 schema = IProductSeries435 schema = IProductSeries
436 field_names = []436 field_names = []
437437
438 label = "Request one-time import of translations"
439
440 @property
441 def next_url(self):
442 return canonical_url(self.context)
443
444 @property
445 def page_title(self):
446 return "One-time import of %s %s translations from bazaar" % (
447 self.context.product.displayname, self.context.displayname)
448
438 def __init__(self, context, request):449 def __init__(self, context, request):
439 super(ProductSeriesTranslationsBzrImportView, self).__init__(450 super(ProductSeriesTranslationsBzrImportView, self).__init__(
440 context, request)451 context, request)
441452
=== modified file 'lib/lp/translations/browser/translationimportqueue.py'
--- lib/lp/translations/browser/translationimportqueue.py 2009-08-31 22:18:05 +0000
+++ lib/lp/translations/browser/translationimportqueue.py 2009-09-01 19:36:28 +0000
@@ -111,10 +111,36 @@
111 return field_values111 return field_values
112112
113 @property113 @property
114 def cancel_url(self):
115 """See `LaunchpadFormView`."""
116 referrer = self.referrer_url
117 if referrer is None:
118 translationimportqueue_set = getUtility(ITranslationImportQueue)
119 return canonical_url(translationimportqueue_set)
120 else:
121 return referrer
122
123 @property
124 def referrer_url(self):
125 referrer = self.request.getHeader('referer')
126 if referrer != canonical_url(self.context):
127 return referrer
128 else:
129 return None
130
131 @property
114 def next_url(self):132 def next_url(self):
115 """Return the URL of the main import queue at 'rosetta/imports'."""133 """See `LaunchpadFormView`."""
116 translationimportqueue_set = getUtility(ITranslationImportQueue)134 # The referer header we want is only available before the view's
117 return canonical_url(translationimportqueue_set)135 # form submits to itself. This field is a hidden input in the form.
136 referrer = self.request.form.get('next_url')
137
138 if (referrer is not None
139 and referrer.startswith(self.request.getApplicationURL())):
140 return referrer
141 else:
142 translationimportqueue_set = getUtility(ITranslationImportQueue)
143 return canonical_url(translationimportqueue_set)
118144
119 def initialize(self):145 def initialize(self):
120 """Remove some fields based on the entry handled."""146 """Remove some fields based on the entry handled."""
121147
=== renamed file 'lib/canonical/launchpad/pagetests/distroseries/xx-distroseries-language-packs.txt' => 'lib/lp/translations/stories/distroseries/xx-distroseries-language-packs.txt'
--- lib/canonical/launchpad/pagetests/distroseries/xx-distroseries-language-packs.txt 2009-04-24 09:15:26 +0000
+++ lib/lp/translations/stories/distroseries/xx-distroseries-language-packs.txt 2009-09-01 21:12:37 +0000
@@ -54,7 +54,7 @@
54 >>> print extract_text(find_tag_by_id(browser.contents, "language_packs"))54 >>> print extract_text(find_tag_by_id(browser.contents, "language_packs"))
55 Language packs for Ubuntu 5.0455 Language packs for Ubuntu 5.04
56 ...56 ...
57 Current language packs57 Active language packs
58 Base pack: 2007-09-10 19:16:01 UTC58 Base pack: 2007-09-10 19:16:01 UTC
59 A complete set of translations for the OS.59 A complete set of translations for the OS.
60 Delta pack:60 Delta pack:
@@ -63,9 +63,9 @@
63 Language pack being tested63 Language pack being tested
64 No pack is being tested right now.64 No pack is being tested right now.
65 Currently unused language packs65 Currently unused language packs
66 Delta language pack: 2007-09-10 19:15:19 UTC .66 Delta language pack: 2007-09-10 19:15:19 UTC
67 Delta language pack: 2007-09-10 19:15:01 UTC .67 Delta language pack: 2007-09-10 19:15:01 UTC
68 Full language pack: 2007-09-10 19:14:26 UTC .68 Full language pack: 2007-09-10 19:14:26 UTC
6969
70There is also an option to set/unset whether next language pack generation is70There is also an option to set/unset whether next language pack generation is
71a full export:71a full export:
7272
=== added directory 'lib/lp/translations/stories/importqueue'
=== renamed file 'lib/lp/translations/stories/standalone/empty.tar.bz2' => 'lib/lp/translations/stories/importqueue/empty.tar.bz2'
=== renamed file 'lib/lp/translations/stories/standalone/truncated.tar.bz2' => 'lib/lp/translations/stories/importqueue/truncated.tar.bz2'
=== renamed file 'lib/lp/translations/stories/standalone/xx-translation-import-queue-edit-autofilling.tar.gz' => 'lib/lp/translations/stories/importqueue/xx-translation-import-queue-edit-autofilling.tar.gz'
=== renamed file 'lib/lp/translations/stories/standalone/xx-translation-import-queue-edit-autofilling.txt' => 'lib/lp/translations/stories/importqueue/xx-translation-import-queue-edit-autofilling.txt'
--- lib/lp/translations/stories/standalone/xx-translation-import-queue-edit-autofilling.txt 2009-08-30 20:27:52 +0000
+++ lib/lp/translations/stories/importqueue/xx-translation-import-queue-edit-autofilling.txt 2009-09-01 21:03:51 +0000
@@ -7,7 +7,7 @@
7 >>> import os.path7 >>> import os.path
8 >>> test_file_name = os.path.join(8 >>> test_file_name = os.path.join(
9 ... os.path.dirname(lp.translations.__file__),9 ... os.path.dirname(lp.translations.__file__),
10 ... 'stories/standalone/xx-translation-import-queue-edit-autofilling.tar.gz')10 ... 'stories/importqueue/xx-translation-import-queue-edit-autofilling.tar.gz')
11 >>> tarball = open(test_file_name)11 >>> tarball = open(test_file_name)
1212
13 >>> browser = setupBrowser(auth='Basic carlos@canonical.com:test')13 >>> browser = setupBrowser(auth='Basic carlos@canonical.com:test')
1414
=== added file 'lib/lp/translations/stories/importqueue/xx-translation-import-queue-entry.txt'
--- lib/lp/translations/stories/importqueue/xx-translation-import-queue-entry.txt 1970-01-01 00:00:00 +0000
+++ lib/lp/translations/stories/importqueue/xx-translation-import-queue-entry.txt 2009-09-01 20:06:37 +0000
@@ -0,0 +1,43 @@
1TranslationImportQueueEntry page
2================================
3
4Submission and cancellation links
5---------------------------------
6
7If we load an import queue entry directly from the global import queue and
8approve it, we end up back on the global translations import queue.
9
10XXX DaniloSegan 2009-09-01: due to Zope bug #98437 we can't test that
11this works properly when no "referer" header is sent.
12
13 >>> admin_browser.open('http://translations.launchpad.dev/+imports')
14 >>> admin_browser.getLink(url='imports/1').click()
15 >>> print admin_browser.getLink('Cancel').url
16 http://translations.launchpad.dev/+imports
17 >>> admin_browser.getControl('Approve').click()
18 >>> print admin_browser.url
19 http://translations.launchpad.dev/+imports
20
21Going to the same entry from the Evolution import queue, and then approving
22it, brings us back to the Evolution import queue.
23
24 >>> admin_browser.open(
25 ... 'http://translations.launchpad.dev/evolution/+imports')
26 >>> admin_browser.getLink(url='imports/1').click()
27 >>> print admin_browser.getLink('Cancel').url
28 http://translations.launchpad.dev/evolution/+imports
29 >>> admin_browser.getControl('Approve').click()
30 >>> print admin_browser.url
31 http://translations.launchpad.dev/evolution/+imports
32
33Similarly, if we go to an import queue entry through the user's import
34queue, after approving the entry we are back looking at user's import queue.
35
36 >>> admin_browser.open(
37 ... 'http://translations.launchpad.dev/~name16/+imports')
38 >>> admin_browser.getLink(url='imports/1').click()
39 >>> print admin_browser.getLink('Cancel').url
40 http://translations.launchpad.dev/~name16/+imports
41 >>> admin_browser.getControl('Approve').click()
42 >>> print admin_browser.url
43 http://translations.launchpad.dev/~name16/+imports
044
=== renamed file 'lib/lp/translations/stories/standalone/xx-translation-import-queue-filtering.tar.gz' => 'lib/lp/translations/stories/importqueue/xx-translation-import-queue-filtering.tar.gz'
=== renamed file 'lib/lp/translations/stories/standalone/xx-translation-import-queue-filtering.txt' => 'lib/lp/translations/stories/importqueue/xx-translation-import-queue-filtering.txt'
--- lib/lp/translations/stories/standalone/xx-translation-import-queue-filtering.txt 2009-08-30 20:27:52 +0000
+++ lib/lp/translations/stories/importqueue/xx-translation-import-queue-filtering.txt 2009-09-01 21:03:51 +0000
@@ -10,7 +10,7 @@
10 >>> import os.path10 >>> import os.path
11 >>> test_file_name = os.path.join(11 >>> test_file_name = os.path.join(
12 ... os.path.dirname(lp.translations.__file__),12 ... os.path.dirname(lp.translations.__file__),
13 ... 'stories/standalone/xx-translation-import-queue-filtering.tar.gz')13 ... 'stories/importqueue/xx-translation-import-queue-filtering.tar.gz')
14 >>> tarball = open(test_file_name)14 >>> tarball = open(test_file_name)
1515
16Our star for this session is Carlos, who has full access rights to the16Our star for this session is Carlos, who has full access rights to the
1717
=== renamed file 'lib/lp/translations/stories/standalone/xx-translation-import-queue-targets.txt' => 'lib/lp/translations/stories/importqueue/xx-translation-import-queue-targets.txt'
=== renamed file 'lib/lp/translations/stories/standalone/xx-translation-import-queue.tar' => 'lib/lp/translations/stories/importqueue/xx-translation-import-queue.tar'
=== renamed file 'lib/lp/translations/stories/standalone/xx-translation-import-queue.tar.bz2' => 'lib/lp/translations/stories/importqueue/xx-translation-import-queue.tar.bz2'
=== renamed file 'lib/lp/translations/stories/standalone/xx-translation-import-queue.tar.gz' => 'lib/lp/translations/stories/importqueue/xx-translation-import-queue.tar.gz'
=== renamed file 'lib/lp/translations/stories/standalone/xx-translation-import-queue.txt' => 'lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt'
--- lib/lp/translations/stories/standalone/xx-translation-import-queue.txt 2009-08-30 20:27:52 +0000
+++ lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt 2009-09-01 21:03:51 +0000
@@ -18,7 +18,7 @@
18 >>> import os.path18 >>> import os.path
19 >>> test_file_name = os.path.join(19 >>> test_file_name = os.path.join(
20 ... os.path.dirname(lp.translations.__file__),20 ... os.path.dirname(lp.translations.__file__),
21 ... 'stories/standalone/xx-translation-import-queue.tar.gz')21 ... 'stories/importqueue/xx-translation-import-queue.tar.gz')
22 >>> tarball = open(test_file_name, "rb")22 >>> tarball = open(test_file_name, "rb")
23 >>> upload = ff_owner_browser.getControl('File')23 >>> upload = ff_owner_browser.getControl('File')
24 >>> upload24 >>> upload
@@ -166,6 +166,12 @@
166166
167Open the edit form for the fourth entry.167Open the edit form for the fourth entry.
168168
169XXX DaniloSegan 2009-09-01: it seems we are hitting Zope testbrowser
170bug, so we need to reopen the page we are currently at to set 'referer'
171header properly. This seems similar to #98437 but the fix proposed
172there doesn't help.
173
174 >>> browser.open('http://translations.launchpad.dev/+imports')
169 >>> browser.getLink(url='imports/4').click()175 >>> browser.getLink(url='imports/4').click()
170176
171And provide information for this IPOFile to be newly created.177And provide information for this IPOFile to be newly created.
@@ -193,7 +199,7 @@
193 po/es.po in199 po/es.po in
194 Mozilla Firefox 1.0 series200 Mozilla Firefox 1.0 series
195 Approved201 Approved
196 ... 202 ...
197 Spanish (es) translation of pkgconf-mozilla in Mozilla Firefox 1.0203 Spanish (es) translation of pkgconf-mozilla in Mozilla Firefox 1.0
198 ...204 ...
199205
@@ -335,7 +341,7 @@
335341
336 >>> test_file_name = os.path.join(342 >>> test_file_name = os.path.join(
337 ... os.path.dirname(lp.translations.__file__),343 ... os.path.dirname(lp.translations.__file__),
338 ... 'stories/standalone/xx-translation-import-queue.tar.bz2')344 ... 'stories/importqueue/xx-translation-import-queue.tar.bz2')
339 >>> tarball = open(test_file_name)345 >>> tarball = open(test_file_name)
340346
341 >>> evo_owner_browser.getControl('File').add_file(347 >>> evo_owner_browser.getControl('File').add_file(
@@ -368,7 +374,7 @@
368374
369 >>> test_file_name = os.path.join(375 >>> test_file_name = os.path.join(
370 ... os.path.dirname(lp.translations.__file__),376 ... os.path.dirname(lp.translations.__file__),
371 ... 'stories/standalone/xx-translation-import-queue.tar')377 ... 'stories/importqueue/xx-translation-import-queue.tar')
372 >>> tarball = open(test_file_name)378 >>> tarball = open(test_file_name)
373379
374 >>> evo_owner_browser.getControl('File').add_file(380 >>> evo_owner_browser.getControl('File').add_file(
@@ -389,7 +395,7 @@
389395
390 >>> test_file_name = os.path.join(396 >>> test_file_name = os.path.join(
391 ... os.path.dirname(lp.translations.__file__),397 ... os.path.dirname(lp.translations.__file__),
392 ... 'stories/standalone/empty.tar.bz2')398 ... 'stories/importqueue/empty.tar.bz2')
393 >>> tarball = open(test_file_name)399 >>> tarball = open(test_file_name)
394400
395 >>> evo_owner_browser.getControl('File').add_file(401 >>> evo_owner_browser.getControl('File').add_file(
@@ -409,7 +415,7 @@
409415
410 >>> test_file_name = os.path.join(416 >>> test_file_name = os.path.join(
411 ... os.path.dirname(lp.translations.__file__),417 ... os.path.dirname(lp.translations.__file__),
412 ... 'stories/standalone/truncated.tar.bz2')418 ... 'stories/importqueue/truncated.tar.bz2')
413 >>> tarball = open(test_file_name)419 >>> tarball = open(test_file_name)
414420
415 >>> evo_owner_browser.getControl('File').add_file(421 >>> evo_owner_browser.getControl('File').add_file(
416422
=== modified file 'lib/lp/translations/stories/productseries/xx-productseries-translations-bzr-request.txt'
--- lib/lp/translations/stories/productseries/xx-productseries-translations-bzr-request.txt 2009-07-10 12:49:30 +0000
+++ lib/lp/translations/stories/productseries/xx-productseries-translations-bzr-request.txt 2009-09-01 19:36:28 +0000
@@ -57,7 +57,7 @@
57 <input type="submit"...value="Request one-time import"...57 <input type="submit"...value="Request one-time import"...
58 >>> browser.getControl('Request one-time import').click()58 >>> browser.getControl('Request one-time import').click()
59 >>> print browser.url59 >>> print browser.url
60 http://translations.l...d.dev/evolution/trunk/+request-bzr-import60 http://translations.launchpad.dev/evolution/trunk
61 >>> print "\n".join(get_feedback_messages(browser.contents))61 >>> print "\n".join(get_feedback_messages(browser.contents))
62 The import has been requested.62 The import has been requested.
6363
6464
=== modified file 'lib/lp/translations/stories/standalone/xx-translations-xpi-import.txt'
--- lib/lp/translations/stories/standalone/xx-translations-xpi-import.txt 2009-08-30 20:27:52 +0000
+++ lib/lp/translations/stories/standalone/xx-translations-xpi-import.txt 2009-09-01 19:36:28 +0000
@@ -49,6 +49,6 @@
49 >>> browser.getControl('Translation domain').value = 'firefox'49 >>> browser.getControl('Translation domain').value = 'firefox'
50 >>> browser.getControl('Approve').click()50 >>> browser.getControl('Approve').click()
51 >>> print browser.url51 >>> print browser.url
52 http://translations.launchpad.dev/+imports52 http://translations.launchpad.dev/firefox/trunk/+imports
53 >>> browser.getControl(name='field.status_3').value53 >>> browser.getControl(name='field.status_3').value
54 ['APPROVED']54 ['APPROVED']
5555
=== modified file 'lib/lp/translations/templates/distroseries-language-packs.pt'
--- lib/lp/translations/templates/distroseries-language-packs.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/translations/templates/distroseries-language-packs.pt 2009-09-01 20:59:00 +0000
@@ -3,10 +3,7 @@
3 xmlns:tal="http://xml.zope.org/namespaces/tal"3 xmlns:tal="http://xml.zope.org/namespaces/tal"
4 xmlns:metal="http://xml.zope.org/namespaces/metal"4 xmlns:metal="http://xml.zope.org/namespaces/metal"
5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
6 xml:lang="en"6 metal:use-macro="view/macro:page/main_only"
7 lang="en"
8 dir="ltr"
9 metal:use-macro="view/macro:page/onecolumn"
10 i18n:domain="launchpad" >7 i18n:domain="launchpad" >
11 <body>8 <body>
12 <div metal:fill-slot="head_epilogue">9 <div metal:fill-slot="head_epilogue">
@@ -19,91 +16,116 @@
1916
20 <div metal:fill-slot="main">17 <div metal:fill-slot="main">
21 <div id="language_packs">18 <div id="language_packs">
22 <h1>19 <h1>
23 Language packs for20 Language packs for
24 <tal:title replace="view/displayname">Ubuntu 5.04</tal:title>21 <tal:title replace="view/displayname">Ubuntu 5.04</tal:title>
25 </h1>22 </h1>
2623
27 <p id="description">24 <div class="top-portlet">
28 A language pack is an export of all translation files used at run time25 <p id="description">
29 by the applications in26 A language pack is an export of all translation files used at run time
30 <tal:distribution replace="view/displayname" />.27 by the applications in
31 These language packs are the last ones generated or in use by28 <tal:distribution replace="view/displayname" />.
32 <tal:distribution replace="view/displayname" />29 These language packs are the last ones generated or in use by
33 </p>30 <tal:distribution replace="view/displayname" />
3431 </p>
35 <h2>Current language packs</h2>32
36 <dl>33 <p tal:condition="context/distribution/language_pack_admin">
37 <dt>34 Language packs are administered by
38 <img tal:condition="context/language_pack_base"35 <tal:admin replace="
39 alt="download icon" src="/@@/download" />36 structure context/distribution/language_pack_admin/fmt:link">
40 Base pack: 37 Peter Langomat
41 <a tal:condition="context/language_pack_base"38 </tal:admin><a
42 tal:attributes="href context/language_pack_base/file/http_url">39 tal:condition="context/distribution/required:launchpad.Edit"
43 <tal:export-date40 tal:attributes="href string:${context/distribution/fmt:url}/+select-language-pack-admin"
44 replace="context/language_pack_base/date_exported/fmt:datetime" />41 title="Change language pack administrator"><img
45 </a>42 class="edit sprite"/></a>.
46 <tal:not-export-date condition="not: context/language_pack_base">43 </p>
47 none yet44 </div>
48 </tal:not-export-date>45 <div class="yui-g">
49 <br />A complete set of translations for the OS.46 <div class="yui-u first portlet">
50 </dt>47 <h2>Active language packs</h2>
51 <dt>48 <dl>
52 <img tal:condition="context/language_pack_delta"49 <dt>
53 alt="download icon" src="/@@/download" />50 Base pack:
54 Delta pack: 51 <a tal:condition="context/language_pack_base"
55 <a tal:condition="context/language_pack_delta"52 tal:attributes="href context/language_pack_base/file/http_url">
56 tal:attributes="href context/language_pack_delta/file/http_url">53 <tal:export-date
57 <tal:export-date54 replace="context/language_pack_base/date_exported/fmt:datetime" />
58 replace="context/language_pack_delta/date_exported/fmt:datetime" />55 <img tal:condition="context/language_pack_base"
59 </a>56 alt="download icon" src="/@@/download" />
60 <tal:not-export-date condition="not: context/language_pack_delta">57 </a>
61 none yet58 <tal:not-export-date condition="not: context/language_pack_base">
62 </tal:not-export-date>59 none yet
63 <br />Translation updates, applied on top of the base pack.60 </tal:not-export-date>
64 </dt>61 </dt>
65 </dl>62 <dd>A complete set of translations for the OS.</dd>
6663 <dt>
67 <h2>Language pack being tested</h2>64 Delta pack:
68 <dl tal:condition="context/language_pack_proposed">65 <a tal:condition="context/language_pack_delta"
69 <dt>66 tal:attributes="href context/language_pack_delta/file/http_url">
70 <img alt="download icon" src="/@@/download" />67 <tal:export-date
71 <tal:type content="context/language_pack_proposed/type/name" />68 replace="context/language_pack_delta/date_exported/fmt:datetime" />
72 language pack:69 <img tal:condition="context/language_pack_delta"
73 <a tal:attributes="70 alt="download icon" src="/@@/download" />
74 href context/language_pack_proposed/file/http_url">71 </a>
75 <tal:export-date72 <tal:not-export-date condition="not: context/language_pack_delta">
76 condition="context/language_pack_proposed"73 none yet
77 replace="context/language_pack_proposed/date_exported/fmt:datetime"74 </tal:not-export-date>
78 />75 </dt>
79 </a>76 <dd>Translation updates, applied on top of the base pack.</dd>
80 <br />This one is being tested to become the new77 </dl>
81 <tal:type content="context/language_pack_proposed/type/name" />78 </div>
82 language pack.79 <div class="yui-u">
83 </dt>80 <div class="portlet">
84 </dl>81 <h2>Language pack being tested</h2>
85 <p tal:condition="not:context/language_pack_proposed">82 <dl tal:condition="context/language_pack_proposed">
86 No pack is being tested right now.83 <dt>
87 </p>84 <tal:type content="context/language_pack_proposed/type/name" />
8885 language pack:
89 <tal:has-unused condition="view/unused_language_packs">86 <a tal:attributes="
90 <h2>Currently unused language packs</h2>87 href context/language_pack_proposed/file/http_url">
91 <dl>88 <tal:export-date
92 <dt tal:repeat="lang_pack view/unused_language_packs">89 condition="context/language_pack_proposed"
93 <img alt="download icon" src="/@@/download" />90 replace="context/language_pack_proposed/date_exported/fmt:datetime"
94 <tal:type content="lang_pack/type/title" /> language pack: 91 />
95 <a tal:attributes="href lang_pack/file/http_url">92 <img alt="download icon" src="/@@/download" />
96 <tal:date-exported93 </a>
97 content="lang_pack/date_exported/fmt:datetime" />94 </dt>
98 </a>.95 <dd>This one is being tested to become the new
99 </dt>96 <tal:type content="context/language_pack_proposed/type/name" />
100 </dl>97 language pack.
101 </tal:has-unused>98 </dd>
102 </div>99 </dl>
103 <div tal:condition="view/is_admin">100 <p tal:condition="not:context/language_pack_proposed">
104 <h2 class="adminlabel"101 No pack is being tested right now.
105 tal:content="view/adminlabel">Language pack settings</h2>102 </p>
106 <div metal:use-macro="context/@@launchpad_form/form"> </div>103 </div>
104 </div>
105 </div>
106
107 <div class="yui-g">
108 <div class="yui-u first portlet" tal:condition="view/is_admin">
109 <h2 class="adminlabel"
110 tal:content="view/adminlabel">Language pack settings</h2>
111 <div metal:use-macro="context/@@launchpad_form/form"> </div>
112 </div>
113 <div class="yui-u" tal:condition="view/unused_language_packs">
114 <div class="portlet">
115 <h2>Currently unused language packs</h2>
116 <ul>
117 <li tal:repeat="lang_pack view/unused_language_packs">
118 <tal:type content="lang_pack/type/title" /> language pack:
119 <a tal:attributes="href lang_pack/file/http_url">
120 <tal:date-exported
121 content="lang_pack/date_exported/fmt:datetime" />
122 <img alt="download icon" src="/@@/download" />
123 </a>
124 </li>
125 </ul>
126 </div>
127 </div>
128 </div>
107 </div>129 </div>
108130
109 </div>131 </div>
110132
=== modified file 'lib/lp/translations/templates/productseries-translations-bzr-import.pt'
--- lib/lp/translations/templates/productseries-translations-bzr-import.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/translations/templates/productseries-translations-bzr-import.pt 2009-09-01 19:36:28 +0000
@@ -3,10 +3,7 @@
3 xmlns:tal="http://xml.zope.org/namespaces/tal"3 xmlns:tal="http://xml.zope.org/namespaces/tal"
4 xmlns:metal="http://xml.zope.org/namespaces/metal"4 xmlns:metal="http://xml.zope.org/namespaces/metal"
5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
6 xml:lang="en"6 metal:use-macro="view/macro:page/main_only"
7 lang="en"
8 dir="ltr"
9 metal:use-macro="view/macro:page/onecolumn"
10 i18n:domain="launchpad"7 i18n:domain="launchpad"
11>8>
12<body>9<body>
@@ -21,57 +18,69 @@
2118
22<div metal:fill-slot="main">19<div metal:fill-slot="main">
2320
24 <h1>Request one-time import of translations</h1>21 <tal:form tal:condition="context/branch">
2522 <div metal:use-macro="context/@@launchpad_form/form">
26 <p23 <div metal:fill-slot="extra_info">
27 class="not-translated-in-launchpad"24 <p class="not-translated-in-launchpad"
28 tal:condition="not: context/product/official_rosetta">25 tal:condition="not: context/product/official_rosetta">
29 <strong>26 <strong>
30 This project is not configured to use Launchpad for translations.27 This project is not configured to use Launchpad for
31 </strong>28 translations.
32 <tal:admin_or_owner condition="context/product/required:launchpad.Edit">29 </strong>
33 You can change this in the30 <tal:admin_or_owner condition="
34 <a tal:attributes="href view/product_edit_url">31 context/product/required:launchpad.Edit">
35 project settings</a>. (<a href="/+help/getting-started-for-your-project.html" target="help">Getting started with translating your project in Launchpad</a>)32 You can change this in the
36 </tal:admin_or_owner>33 <a tal:attributes="href view/product_edit_url">
37 </p>34 project settings</a>.
3835 (<a href="/+help/getting-started-for-your-project.html"
39 <tal:rosetta condition="context/product/official_rosetta">36 target="help">Getting started with translating your project
40 <p>37 in Launchpad</a>)
41 You can ask Launchpad for a one-time import of all the translation files38 </tal:admin_or_owner>
42 (templates and translations) that it finds in39 </p>
43 <strong><tal:series replace="structure view/series_title">40
44 Evolution Series:trunk</tal:series>'s</strong> official Bazaar branch.41 <tal:rosetta condition="context/product/official_rosetta">
45 (<a href="https://help.launchpad.net/Translations/ImportPolicy">Read the42 <p>
46 translations import policy</a>)43 You can ask Launchpad for a one-time import of all the
47 </p>44 translation files (templates and translations) that it finds in
48 <p tal:condition="not:view/has_imports_enabled" id="settings-display">45 <strong><tal:series replace="structure view/series_title">
49 <img src="/@@/info" class="inline-icon" />46 Evolution Series:trunk</tal:series>'s</strong>
50 To enable continuous imports please change the settings47 official Bazaar branch.
51 <a tal:attributes="href view/translations_settings_url">here</a>.48 (<a href="https://help.launchpad.net/Translations/ImportPolicy"
52 </p>49 >Read the translations import policy</a>)
53 <p tal:condition="view/context/branch"50 </p>
54 tal:define="branch view/context/branch"51 <p tal:condition="not:view/has_imports_enabled"
55 id="branch-display">52 id="settings-display">
56 The official Bazaar branch is:53 <img src="/@@/info" class="inline-icon" />
57 <img src="/@@/branch" class="inline-icon" />54 To enable continuous imports please change the settings
58 <a tal:attributes="href branch/fmt:url; title branch/bzr_identity"55 <a tal:attributes="href view/translations_settings_url">here</a>.
59 tal:content="branch/displayname">56 </p>
60 branchname57 </tal:rosetta>
61 </a>58 <p tal:define="branch context/branch"
62 <a tal:attributes="href view/link_branch_url;59 id="branch-display">
63 title string:Change official branch"60 The official Bazaar branch is:
64 ><img src="/@@/edit" class="inline-icon" /></a>61 <img src="/@@/branch" class="inline-icon" />
65 </p>62 <a tal:attributes="href branch/fmt:url; title branch/bzr_identity"
66 <p tal:condition="not:view/context/branch"63 tal:content="branch/displayname">
67 id="no-branch-display">64 branchname
68 This series does not have an official Bazaar branch.65 </a>
69 <a tal:attributes="href view/link_branch_url">66 <a tal:attributes="href view/link_branch_url;
70 Please set it first.</a></p>67 title string:Change official branch"
71 <tal:form tal:condition="view/context/branch">68 ><img src="/@@/edit" class="inline-icon" /></a>
72 <div metal:use-macro="context/@@launchpad_form/form"></div>69 </p>
70 </div>
71 </div>
73 </tal:form>72 </tal:form>
74 </tal:rosetta>73 <tal:no-branch condition="not:context/branch">
74 <h1 tal:content="view/label" />
75 <div class="main-portlet">
76 <p tal:condition="not:view/context/branch"
77 id="no-branch-display">
78 This series does not have an official Bazaar branch.
79 <a tal:attributes="href view/link_branch_url">
80 Please set it first.</a>
81 </p>
82 </div>
83 </tal:no-branch>
75</div>84</div>
7685
77</body>86</body>
7887
=== modified file 'lib/lp/translations/templates/productseries-translations-settings.pt'
--- lib/lp/translations/templates/productseries-translations-settings.pt 2009-07-19 04:41:14 +0000
+++ lib/lp/translations/templates/productseries-translations-settings.pt 2009-09-01 12:00:37 +0000
@@ -3,10 +3,7 @@
3 xmlns:tal="http://xml.zope.org/namespaces/tal"3 xmlns:tal="http://xml.zope.org/namespaces/tal"
4 xmlns:metal="http://xml.zope.org/namespaces/metal"4 xmlns:metal="http://xml.zope.org/namespaces/metal"
5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
6 xml:lang="en"6 metal:use-macro="view/macro:page/main_only"
7 lang="en"
8 dir="ltr"
9 metal:use-macro="view/macro:page/onecolumn"
10 i18n:domain="launchpad"7 i18n:domain="launchpad"
11>8>
12<body>9<body>
@@ -21,99 +18,113 @@
2118
22<div metal:fill-slot="main">19<div metal:fill-slot="main">
2320
24 <h1>Translations settings</h1>21 <div class="top-portlet">
2522 <h1>Translations settings</h1>
26 <p23 <p
27 class="not-translated-in-launchpad"24 class="not-translated-in-launchpad"
28 tal:condition="not: context/product/official_rosetta">25 tal:condition="not: context/product/official_rosetta">
29 <strong>26 <strong>
30 This project is not configured to use Launchpad for translations.27 This project is not configured to use Launchpad for translations.
31 </strong>28 </strong>
32 <tal:admin_or_owner condition="context/product/required:launchpad.Edit">29 <tal:admin_or_owner condition="context/product/required:launchpad.Edit">
33 You can change this in the30 You can change this in the
34 <a tal:attributes="href view/product_edit_url">31 <a tal:attributes="href view/product_edit_url">
35 project settings</a>.32 project settings</a>.
36 </tal:admin_or_owner>33 </tal:admin_or_owner>
37 </p>34 </p>
3835 </div>
39 <tal:rosetta condition="context/product/official_rosetta">36
40 <h2>Import translations from branch</h2>37 <div class="yui-g">
41 <p>38 <div class="yui-u first portlet">
42 You can ask Launchpad to continuously import any translation39 <div metal:use-macro="context/@@launchpad_form/form" class="portlet">
43 files (templates and translations) that it finds in 40 <div metal:fill-slot="extra_info">
44 <strong><tal:series replace="structure view/series_title">41
45 Evolution Series:trunk</tal:series>'s</strong> official Bazaar branch.42 <tal:rosetta condition="context/product/official_rosetta">
46 After the initial import, Launchpad will continue to scan your Bazaar43 <h2>Import translations from branch</h2>
47 branch for updates to template and translation files.44 <p>
48 </p>45 You can ask Launchpad to continuously import any translation
49 <p id="bzr-request-display">46 files (templates and translations) that it finds in
50 <img src="/@@/info" class="inline-icon" />47 <strong><tal:series replace="structure view/series_title">
51 If you only need a one-time import, please request it 48 Evolution Series:trunk</tal:series>'s</strong> official Bazaar branch.
52 <a tal:attributes="href view/request_bzr_import_url">here</a>.49 After the initial import, Launchpad will continue to scan your Bazaar
53 </p>50 branch for updates to template and translation files.
54 <p tal:condition="view/context/branch"51 </p>
55 tal:define="branch view/context/branch"52 <p id="bzr-request-display">
56 id="branch-display">53 <img src="/@@/info" class="inline-icon" />
57 The official Bazaar branch is:54 If you only need a one-time import, please request it
58 <img src="/@@/branch" class="inline-icon" />55 <a tal:attributes="href view/request_bzr_import_url">here</a>.
59 <a tal:attributes="href branch/fmt:url; title branch/bzr_identity"56 </p>
60 tal:content="branch/displayname">57 <p tal:condition="view/context/branch"
61 branchname58 tal:define="branch view/context/branch"
62 </a>59 id="branch-display">
63 <a tal:attributes="href view/link_branch_url;60 The official Bazaar branch is:
64 title string:Change official branch"61 <img src="/@@/branch" class="inline-icon" />
65 ><img src="/@@/edit" class="inline-icon" /></a>62 <a tal:attributes="href branch/fmt:url; title branch/bzr_identity"
66 </p>63 tal:content="branch/displayname">
67 <p tal:condition="not:view/context/branch"64 branchname
68 id="no-branch-display">65 </a>
69 This series does not have an official Bazaar branch. 66 <a tal:attributes="href view/link_branch_url;
70 <a tal:attributes="href view/link_branch_url">Set it now!</a>67 title string:Change official branch"
71 </p>68 ><img src="/@@/edit" class="inline-icon" /></a>
72 <div metal:use-macro="context/@@launchpad_form/form"></div>69 </p>
7370 <p tal:condition="not:view/context/branch"
74 <h2>Export translations to branch</h2>71 id="no-branch-display">
75 <p>72 This series does not have an official Bazaar branch.
76 Launchpad can commit daily snapshots of the translations for this73 <a tal:attributes="href view/link_branch_url">Set it now!</a>
77 release series to a code branch.74 </p>
78 </p>75 </tal:rosetta>
79 <p>76 </div>
80 Use this to make it easy to download the latest translations using77 </div>
81 Bazaar, or to make sure the latest Launchpad translations are always78 </div>
82 included with the files you distribute.79 <div class="yui-u">
83 </p>80 <div class="portlet">
84 <p>81
85 <strong>Warning:</strong> This may replace translation files that are82 <h2>Export translations to branch</h2>
86 already in the branch you choose. You should consider creating a83 <p>
87 separate branch where Launchpad can commit translations.84 Launchpad can commit daily snapshots of the translations for this
88 </p>85 release series to a code branch.
8986 </p>
90 <p id="translations-branch">87 <p>
91 <tal:no-translations-branch condition="not: context/translations_branch">88 Use this to make it easy to download the latest translations using
92 Currently not exporting translations to a branch.89 Bazaar, or to make sure the latest Launchpad translations are always
93 <a href="+link-translations-branch">90 included with the files you distribute.
94 Choose a target branch.91 </p>
95 <img src="/@@/edit" class="inline-icon" alt="edit" />92 <p>
96 </a>93 <strong>Warning:</strong> This may replace translation files that are
97 </tal:no-translations-branch>94 already in the branch you choose. You should consider creating a
98 <tal:translations-branch condition="context/translations_branch">95 separate branch where Launchpad can commit translations.
99 Exporting translations to branch:96 </p>
100 <img src="/@@/branch" class="inline-icon" />97
101 <a98 <p id="translations-branch">
102 id="translations-branch-link"99 <tal:no-translations-branch condition="not: context/translations_branch">
103 tal:attributes="href context/translations_branch/fmt:url;100 Currently not exporting translations to a branch.
104 title string:Change translations export branch"101 <a href="+link-translations-branch">
105 tal:content="context/translations_branch/displayname"102 Choose a target branch.
106 >branch name</a>103 <img src="/@@/edit" class="inline-icon" alt="edit" />
107 <a104 </a>
108 id="translations-branch-edit-link"105 </tal:no-translations-branch>
109 tal:attributes="href string:+link-translations-branch;106 <tal:translations-branch condition="context/translations_branch">
110 title string:Set translations export branch"107 Exporting translations to branch:
111 ><img src="/@@/edit" class="inline-icon" alt="edit" /></a>108 <img src="/@@/branch" class="inline-icon" />
112 109 <a
113 </tal:translations-branch>110 id="translations-branch-link"
114 </p>111 tal:attributes="href context/translations_branch/fmt:url;
115112 title string:Change translations export branch"
116 </tal:rosetta>113 tal:content="context/translations_branch/displayname"
114 >branch name</a>
115 <a
116 id="translations-branch-edit-link"
117 tal:attributes="href string:+link-translations-branch;
118 title string:Set translations export branch"
119 ><img src="/@@/edit" class="inline-icon" alt="edit" /></a>
120
121 </tal:translations-branch>
122 </p>
123
124 </div>
125 </div>
126 </div>
127
117</div>128</div>
118129
119</body>130</body>
120131
=== modified file 'lib/lp/translations/templates/translationimportqueueentry-index.pt'
--- lib/lp/translations/templates/translationimportqueueentry-index.pt 2009-08-31 22:18:05 +0000
+++ lib/lp/translations/templates/translationimportqueueentry-index.pt 2009-09-01 12:09:27 +0000
@@ -3,10 +3,7 @@
3 xmlns:tal="http://xml.zope.org/namespaces/tal"3 xmlns:tal="http://xml.zope.org/namespaces/tal"
4 xmlns:metal="http://xml.zope.org/namespaces/metal"4 xmlns:metal="http://xml.zope.org/namespaces/metal"
5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
6 xml:lang="en"6 metal:use-macro="view/macro:page/main_only"
7 lang="en"
8 dir="ltr"
9 metal:use-macro="context/@@main_template/master"
10 i18n:domain="launchpad"7 i18n:domain="launchpad"
11>8>
12 <body>9 <body>
@@ -24,7 +21,7 @@
24 'PO':21 'PO':
25 ['field.potemplate', 'field.potemplate_name',22 ['field.potemplate', 'field.potemplate_name',
26 'field.language', 'field.variant'],23 'field.language', 'field.variant'],
27 'UNSPEC': []24 'UNSPEC': []
28 };25 };
29 var nodes = {};26 var nodes = {};
30 var last_file_type = 'UNSPEC';27 var last_file_type = 'UNSPEC';
@@ -58,11 +55,11 @@
58 }55 }
5956
60 function updateCurrentFileType(file_type) {57 function updateCurrentFileType(file_type) {
61 for (ftype in nodes) {58 for (ftype in nodes) {
62 // Logic has been inverted in the next line to avoid59 // Logic has been inverted in the next line to avoid
63 // breaking XHTML compliance of the template due to60 // breaking XHTML compliance of the template due to
64 // ampersand usage.61 // ampersand usage.
65 if (!(ftype != file_type || nodes[ftype] != null)) {62 if (!(ftype == file_type || nodes[ftype] == null)) {
66 nodes[ftype].addClass('dont_show_fields');63 nodes[ftype].addClass('dont_show_fields');
67 }64 }
68 }65 }
@@ -103,7 +100,12 @@
103 </metal:script>100 </metal:script>
104101
105 <div metal:fill-slot="main">102 <div metal:fill-slot="main">
106 <div metal:use-macro="context/@@launchpad_form/form" />103 <div metal:use-macro="context/@@launchpad_form/form">
104 <div metal:fill-slot="extra_info">
105 <input type="hidden" name="next_url"
106 tal:attributes="value view/referrer_url" />
107 </div>
108 </div>
107 </div>109 </div>
108110
109 </body>111 </body>
110112