Merge lp:~danilo/launchpad/bug-430455 into lp:launchpad

Proposed by Данило Шеган
Status: Merged
Approved by: Henning Eggers
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~danilo/launchpad/bug-430455
Merge into: lp:launchpad
Diff against target: None lines
To merge this branch: bzr merge lp:~danilo/launchpad/bug-430455
Reviewer Review Type Date Requested Status
Henning Eggers (community) Approve
Review via email: mp+11851@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) wrote :

= Bug 430455 =

Convert potemplate-index.pt page to 3.0 and provide breadcrumbs for
IPOTemplate.

Also limit the number of related templates shown to 4 each (related by
name, and from the same source).

= Tests =

bin/test -vvt translations.*potemplate -t translations.*breadcrumbs

= Demo & QA =

https://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2
https://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2

= 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/configure.zcml
  lib/lp/translations/browser/potemplate.py
  lib/lp/translations/browser/tests/test_breadcrumbs.py
  lib/lp/translations/doc/canonical_url_examples.txt
  lib/lp/translations/stories/navigation-links/potemplate.txt
  lib/lp/translations/stories/standalone/xx-person-activity.txt
  lib/lp/translations/stories/standalone/xx-pofile-index.txt
  lib/lp/translations/stories/standalone/xx-potemplate-edit.txt
  lib/lp/translations/stories/standalone/xx-rosetta-pofile-export.txt

lib/lp/translations/stories/standalone/xx-rosetta-potemplate-export.txt
  lib/lp/translations/stories/standalone/xx-rosetta-potemplate-index.txt
  lib/lp/translations/templates/potemplate-index.pt

Revision history for this message
Henning Eggers (henninge) wrote :
Download full text (7.6 KiB)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 16.09.2009 10:05, Данило Шеган schrieb:
> === modified file 'lib/lp/translations/browser/potemplate.py'
All good
[...]

> === modified file 'lib/lp/translations/browser/tests/test_breadcrumbs.py'
> --- lib/lp/translations/browser/tests/test_breadcrumbs.py 2009-09-11 10:38:49 +0000
> +++ lib/lp/translations/browser/tests/test_breadcrumbs.py 2009-09-16 06:17:21 +0000
> @@ -7,6 +7,8 @@
>
> from zope.component import getUtility
>
> +from canonical.lazr.utils import smartquote
> +
> from canonical.launchpad.webapp.publisher import canonical_url
> from canonical.launchpad.webapp.tests.breadcrumbs import (
> BaseBreadcrumbTestCase)
> @@ -158,5 +160,20 @@
> ["Crumb Tester", "Series test", "Translations", "Serbian (sr)"])
>
>
> -def test_suite():
> - return unittest.TestLoader().loadTestsFromName(__name__)

Huh? Is test_suite obsolete now? Or is this a mistake?

> +class TestPOTemplateBreadcrumbs(BaseTranslationsBreadcrumbTestCase):
> + def test_potemplate(self):
> + product = self.factory.makeProduct(
> + name='crumb-tester', displayname="Crumb Tester")
> + series = self.factory.makeProductSeries(
> + name="test", product=product)
> + potemplate = self.factory.makePOTemplate(name="template",
> + productseries=series)
> + self._testContextBreadcrumbs(
> + [product, series, potemplate],
> + ["http://launchpad.dev/crumb-tester",
> + "http://launchpad.dev/crumb-tester/test",
> + "http://translations.launchpad.dev/crumb-tester/test",
> + "http://translations.launchpad.dev/crumb-tester/test"
> + "/+pots/template"],
> + ["Crumb Tester", "Series test", "Translations",
> + smartquote('Template "template"')])
>
> === modified file 'lib/lp/translations/configure.zcml'
Good.
[...]

> === modified file 'lib/lp/translations/doc/canonical_url_examples.txt'
Good, too.
[...]

> === modified file 'lib/lp/translations/stories/navigation-links/potemplate.txt'
Good, three. ;)
[...]

> === modified file 'lib/lp/translations/stories/standalone/xx-person-activity.txt'
Good 4 u.
[...]

> === modified file 'lib/lp/translations/stories/standalone/xx-pofile-index.txt'
Good. High 5!
[...]

> === modified file 'lib/lp/translations/stories/standalone/xx-potemplate-edit.txt'
Got a 'Good' six pack.
[...]

> === modified file 'lib/lp/translations/stories/standalone/xx-rosetta-pofile-export.txt'
7th Good heavens!
[...]

> === modified file 'lib/lp/translations/stories/standalone/xx-rosetta-potemplate-export.txt'
I 8 the Good.
[...]

> === modified file 'lib/lp/translations/stories/standalone/xx-rosetta-potemplate-index.txt'
> --- lib/lp/translations/stories/standalone/xx-rosetta-potemplate-index.txt 2009-07-01 20:45:39 +0000
> +++ lib/lp/translations/stories/standalone/xx-rosetta-potemplate-index.txt 2009-09-16 06:17:21 +0000
> @@ -7,16 +7,14 @@
> >>> anon_browser.open("http://translations.launchpad.dev/"
> ... "ubuntu/hoary/+source/evolution/+pots/evolution-2.2/")
> >>> anon_browser.title
...

Read more...

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

Hi Henning,

Thanks a lot for the review.

У сре, 16. 09 2009. у 13:48 +0000, Henning Eggers пише:

> > === modified file 'lib/lp/translations/browser/tests/test_breadcrumbs.py'
> > --- lib/lp/translations/browser/tests/test_breadcrumbs.py 2009-09-11 10:38:49 +0000
> > +++ lib/lp/translations/browser/tests/test_breadcrumbs.py 2009-09-16 06:17:21 +0000
> > @@ -7,6 +7,8 @@
> >
> > from zope.component import getUtility
> >
> > +from canonical.lazr.utils import smartquote
> > +
> > from canonical.launchpad.webapp.publisher import canonical_url
> > from canonical.launchpad.webapp.tests.breadcrumbs import (
> > BaseBreadcrumbTestCase)
> > @@ -158,5 +160,20 @@
> > ["Crumb Tester", "Series test", "Translations", "Serbian (sr)"])
> >
> >
> > -def test_suite():
> > - return unittest.TestLoader().loadTestsFromName(__name__)
>
> Huh? Is test_suite obsolete now? Or is this a mistake?

A mistake. However, it does run for me without it, so even if I don't
remember changing it, I guess it's a change by someone else which made
it into my branch diff (perhaps something that was reverted on devel?).

I am waiting to hear from you about this before deciding to go one way
or the other.

> > === modified file 'lib/lp/translations/stories/standalone/xx-rosetta-pofile-export.txt'
> 7th Good heavens!
> [...]

> > === modified file 'lib/lp/translations/stories/standalone/xx-rosetta-potemplate-export.txt'
> I 8 the Good.
> [...]

:)

> > === modified file 'lib/lp/translations/stories/standalone/xx-rosetta-potemplate-index.txt'
...
> > The notice links to the alternate template.
> >
> > >>> print alternate_notice
>
> Why doesn't this have an extract_text?

It confirms it also contains the link. I know, I know, should have
cleaned it up, but the "minimal changes" rule stops me :)

> <p...>
> > - Other templates from the same source:
> > + <span>Other templates here:</span>
> > <a href="/evolution/trunk/+pots/evolution-2.2">evolution-2.2</a>...
> > </p>
> > + <h1>Translation status</h1>
>
> This should go into the 'label' property on the view to be displayed
> *above* the breadcrumbs. Or has that changed?

Nope, I am just not up-to-date.

As discussed on IRC, I am leaving this for after this branch, when we go
and fix up labels and page titles for all the existing views and
templates to match the new rules.

Cheers,
Danilo

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/translations/browser/potemplate.py'
2--- lib/lp/translations/browser/potemplate.py 2009-08-31 14:29:30 +0000
3+++ lib/lp/translations/browser/potemplate.py 2009-09-16 06:17:21 +0000
4@@ -7,6 +7,7 @@
5
6 __all__ = [
7 'POTemplateAdminView',
8+ 'POTemplateBreadcrumb',
9 'POTemplateEditView',
10 'POTemplateFacets',
11 'POTemplateExportView',
12@@ -31,12 +32,15 @@
13 from zope.interface import implements
14 from zope.publisher.browser import FileUpload
15
16+from canonical.lazr.utils import smartquote
17+
18 from canonical.launchpad import helpers, _
19+from canonical.launchpad.webapp.breadcrumb import Breadcrumb
20+from canonical.launchpad.webapp.interfaces import ILaunchBag, NotFoundError
21 from lp.translations.browser.poexportrequest import BaseExportView
22 from lp.registry.browser.productseries import ProductSeriesFacets
23 from lp.translations.browser.translations import TranslationsMixin
24 from lp.registry.browser.sourcepackage import SourcePackageFacets
25-from canonical.launchpad.webapp.interfaces import ILaunchBag, NotFoundError
26 from lp.registry.interfaces.productseries import IProductSeries
27 from lp.registry.interfaces.sourcepackage import ISourcePackage
28 from lp.translations.interfaces.pofile import IPOFileSet
29@@ -198,6 +202,8 @@
30
31 class POTemplateView(LaunchpadView, TranslationsMixin):
32
33+ SHOW_RELATED_TEMPLATES = 4
34+
35 def initialize(self):
36 """Get the requested languages and submit the form."""
37 self.description = self.context.description
38@@ -246,6 +252,49 @@
39 yield pofileview
40
41 @property
42+ def group_parent(self):
43+ """Return a parent object implementing `IHasTranslationGroups`."""
44+ if self.context.productseries is not None:
45+ return self.context.productseries.product
46+ else:
47+ return self.context.distroseries.distribution
48+
49+ @property
50+ def has_translation_documentation(self):
51+ """Are there translation instructions for this project."""
52+ translation_group = self.group_parent.translationgroup
53+ return (translation_group is not None and
54+ translation_group.translation_guide_url is not None)
55+
56+ @property
57+ def has_related_templates(self):
58+ by_source = self.context.relatives_by_source
59+ by_name = self.context.relatives_by_name
60+ return bool(by_source) or bool(by_name)
61+
62+ @property
63+ def related_templates_by_source(self):
64+ by_source = list(
65+ self.context.relatives_by_source[:self.SHOW_RELATED_TEMPLATES])
66+ return by_source
67+
68+ @property
69+ def has_more_templates_by_source(self):
70+ by_source_count = self.context.relatives_by_source.count()
71+ return by_source_count > self.SHOW_RELATED_TEMPLATES
72+
73+ @property
74+ def related_templates_by_name(self):
75+ by_name = list(
76+ self.context.relatives_by_name[:self.SHOW_RELATED_TEMPLATES])
77+ return by_name
78+
79+ @property
80+ def has_more_templates_by_name(self):
81+ by_name_count = self.context.relatives_by_name.count()
82+ return by_name_count > self.SHOW_RELATED_TEMPLATES
83+
84+ @property
85 def has_pofiles(self):
86 languages = set(
87 self.context.languages()).union(self.translatable_languages)
88@@ -583,7 +632,7 @@
89 class POTemplateURL:
90 implements(ICanonicalUrlData)
91
92- rootsite = None
93+ rootsite = 'translations'
94
95 def __init__(self, context):
96 self.context = context
97@@ -647,3 +696,10 @@
98 return potemplate
99 else:
100 raise NotFoundError(name)
101+
102+
103+class POTemplateBreadcrumb(Breadcrumb):
104+ """Breadcrumb for `IPOTemplate`."""
105+ @property
106+ def text(self):
107+ return smartquote('Template "%s"' % self.context.name)
108
109=== modified file 'lib/lp/translations/browser/tests/test_breadcrumbs.py'
110--- lib/lp/translations/browser/tests/test_breadcrumbs.py 2009-09-11 10:38:49 +0000
111+++ lib/lp/translations/browser/tests/test_breadcrumbs.py 2009-09-16 06:17:21 +0000
112@@ -7,6 +7,8 @@
113
114 from zope.component import getUtility
115
116+from canonical.lazr.utils import smartquote
117+
118 from canonical.launchpad.webapp.publisher import canonical_url
119 from canonical.launchpad.webapp.tests.breadcrumbs import (
120 BaseBreadcrumbTestCase)
121@@ -158,5 +160,20 @@
122 ["Crumb Tester", "Series test", "Translations", "Serbian (sr)"])
123
124
125-def test_suite():
126- return unittest.TestLoader().loadTestsFromName(__name__)
127+class TestPOTemplateBreadcrumbs(BaseTranslationsBreadcrumbTestCase):
128+ def test_potemplate(self):
129+ product = self.factory.makeProduct(
130+ name='crumb-tester', displayname="Crumb Tester")
131+ series = self.factory.makeProductSeries(
132+ name="test", product=product)
133+ potemplate = self.factory.makePOTemplate(name="template",
134+ productseries=series)
135+ self._testContextBreadcrumbs(
136+ [product, series, potemplate],
137+ ["http://launchpad.dev/crumb-tester",
138+ "http://launchpad.dev/crumb-tester/test",
139+ "http://translations.launchpad.dev/crumb-tester/test",
140+ "http://translations.launchpad.dev/crumb-tester/test"
141+ "/+pots/template"],
142+ ["Crumb Tester", "Series test", "Translations",
143+ smartquote('Template "template"')])
144
145=== modified file 'lib/lp/translations/configure.zcml'
146--- lib/lp/translations/configure.zcml 2009-09-10 10:50:55 +0000
147+++ lib/lp/translations/configure.zcml 2009-09-16 06:17:21 +0000
148@@ -407,6 +407,11 @@
149 set_attributes="name translation_domain productseries distroseries sourcepackagename sourcepackageversion binarypackagename languagepack path header iscurrent from_sourcepackagename date_last_updated source_file source_file_format"/>
150 </class>
151 <adapter
152+ provides="canonical.launchpad.webapp.interfaces.IBreadcrumb"
153+ for="lp.translations.interfaces.potemplate.IPOTemplate"
154+ factory="lp.translations.browser.potemplate.POTemplateBreadcrumb"
155+ permission="zope.Public"/>
156+ <adapter
157 name="all_messages"
158 for="lp.translations.interfaces.potemplate.IPOTemplate"
159 provides="lp.translations.interfaces.translationcommonformat.ITranslationFileData"
160
161=== modified file 'lib/lp/translations/doc/canonical_url_examples.txt'
162--- lib/lp/translations/doc/canonical_url_examples.txt 2009-09-10 10:50:55 +0000
163+++ lib/lp/translations/doc/canonical_url_examples.txt 2009-09-16 06:17:21 +0000
164@@ -50,7 +50,7 @@
165
166 >>> potemplate = potemplatesubset['evolution-2.2']
167 >>> canonical_url(potemplate)
168- u'http://launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2'
169+ u'http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2'
170
171 And we can get a particular PO file for this PO template by its language code.
172
173@@ -90,7 +90,7 @@
174 ... productseries=evolution_trunk_series)
175 >>> potemplate = potemplatesubset['evolution-2.2']
176 >>> canonical_url(potemplate)
177- u'http://launchpad.dev/evolution/trunk/+pots/evolution-2.2'
178+ u'http://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2'
179
180 >>> pofile = potemplate.getPOFileByLang('es')
181 >>> canonical_url(pofile)
182
183=== modified file 'lib/lp/translations/stories/navigation-links/potemplate.txt'
184--- lib/lp/translations/stories/navigation-links/potemplate.txt 2009-07-01 20:45:39 +0000
185+++ lib/lp/translations/stories/navigation-links/potemplate.txt 2009-09-16 06:17:21 +0000
186@@ -19,16 +19,6 @@
187 * Translations (selected) - http://translations.launchpad.dev/evolution/trunk
188 * Answers - not linked
189
190-But the navigation menu items should point to IPOTemplate urls.
191-
192- >>> print_navigation_links(admin_browser.contents)
193- Overview
194- Settings: http://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2/+edit
195- Administer: http://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2/+admin
196- Upload: http://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2/+upload
197- Download: http://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2/+export
198-
199-
200 Taking an IPOTemplate for ISourcePackage context:
201
202 >>> admin_browser.open(
203@@ -46,12 +36,3 @@
204 * Blueprints - not linked
205 * Translations (selected) - http://translations.launchpad.dev/ubuntu/hoary/+source/evolution
206 * Answers - http://answers.launchpad.dev/ubuntu/hoary/+source/evolution
207-
208-But the navigation menu items should point to IPOTemplate urls.
209-
210- >>> print_navigation_links(admin_browser.contents)
211- Overview
212- Settings: http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+edit
213- Administer: http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+admin
214- Upload: http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+upload
215- Download: http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+export
216
217=== modified file 'lib/lp/translations/stories/standalone/xx-person-activity.txt'
218--- lib/lp/translations/stories/standalone/xx-person-activity.txt 2009-09-12 02:09:47 +0000
219+++ lib/lp/translations/stories/standalone/xx-person-activity.txt 2009-09-16 06:17:21 +0000
220@@ -45,7 +45,7 @@
221 >>> alsa_utils_link = 'Spanish (es) translation of alsa-utils in alsa-utils trunk'
222 >>> anon_browser.getLink(alsa_utils_link).click()
223 >>> print anon_browser.title
224- +filter : Translations : Series trunk : alsa-utils
225+ +filter : Template ...alsa-utils... : Translations : Series trunk : alsa-utils
226
227
228 URL-escaped user names
229@@ -76,4 +76,4 @@
230
231 >>> user_browser.open(url.encode('ascii'))
232 >>> print user_browser.title
233- +filter : Translations : Series generic-string13 : Product-name6
234+ +filter : Template ... : Translations : Series generic-string13 : Product-name6
235
236=== modified file 'lib/lp/translations/stories/standalone/xx-pofile-index.txt'
237--- lib/lp/translations/stories/standalone/xx-pofile-index.txt 2009-09-12 07:25:21 +0000
238+++ lib/lp/translations/stories/standalone/xx-pofile-index.txt 2009-09-16 06:17:21 +0000
239@@ -40,7 +40,8 @@
240
241 >>> anon_browser.getLink('filter').click()
242 >>> print anon_browser.title
243- +filter : Translations : Series trunk : Evolution
244+ +filter : Template ...evolution-2.2... : Translations : Series
245+ trunk : Evolution
246
247 To display all the translations submitted by Carlos, and allow easier
248 debugging and problem catching when changes are introduced, we define
249
250=== modified file 'lib/lp/translations/stories/standalone/xx-potemplate-edit.txt'
251--- lib/lp/translations/stories/standalone/xx-potemplate-edit.txt 2009-07-01 20:45:39 +0000
252+++ lib/lp/translations/stories/standalone/xx-potemplate-edit.txt 2009-09-16 06:17:21 +0000
253@@ -11,12 +11,12 @@
254 ...
255 Unauthorized:...
256
257-In fact, the "Settings" option won't even appear for them.
258+In fact, the "Change details" option won't even appear for them.
259
260 >>> browser.open(
261 ... 'http://translations.launchpad.dev/evolution/trunk/+pots/'
262 ... 'evolution-2.2/')
263- >>> browser.getLink('Settings').click()
264+ >>> browser.getLink('Change details').click()
265 Traceback (most recent call last):
266 ...
267 LinkNotFoundError
268@@ -29,7 +29,7 @@
269 >>> browser.open(
270 ... 'http://translations.launchpad.dev/evolution/trunk/+pots/'
271 ... 'evolution-2.2/')
272- >>> browser.getLink('Settings').click()
273+ >>> browser.getLink('Change details').click()
274 >>> print browser.url
275 http://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2/+edit
276
277
278=== modified file 'lib/lp/translations/stories/standalone/xx-rosetta-pofile-export.txt'
279--- lib/lp/translations/stories/standalone/xx-rosetta-pofile-export.txt 2009-09-12 07:25:21 +0000
280+++ lib/lp/translations/stories/standalone/xx-rosetta-pofile-export.txt 2009-09-16 06:17:21 +0000
281@@ -18,8 +18,8 @@
282 >>> user_browser.getLink('Download').click()
283
284 >>> user_browser.title
285- '+export : \xe2\x80\x9cevolution\xe2\x80\x9d package : Translations
286- : 5.04 : Ubuntu'
287+ '+export : Template ...evolution-2.2... : ...evolution... package :
288+ Translations : 5.04 : Ubuntu'
289
290 >>> print find_main_content(user_browser.contents)
291 <...
292
293=== modified file 'lib/lp/translations/stories/standalone/xx-rosetta-potemplate-export.txt'
294--- lib/lp/translations/stories/standalone/xx-rosetta-potemplate-export.txt 2009-09-12 07:25:21 +0000
295+++ lib/lp/translations/stories/standalone/xx-rosetta-potemplate-export.txt 2009-09-16 06:17:21 +0000
296@@ -6,10 +6,10 @@
297 >>> anon_browser.open(
298 ... 'http://translations.launchpad.dev/ubuntu/hoary'
299 ... '/+source/evolution/+pots/evolution-2.2/')
300- >>> anon_browser.getLink('Download').click()
301+ >>> anon_browser.getLink('download').click()
302 Traceback (most recent call last):
303 ...
304- Unauthorized:...
305+ LinkNotFoundError
306
307 Logged in as a regular user, the +export page is accessible.
308
309@@ -17,10 +17,10 @@
310 >>> browser.open(
311 ... 'http://translations.launchpad.dev/ubuntu/hoary'
312 ... '/+source/evolution/+pots/evolution-2.2')
313- >>> browser.getLink('Download').click()
314+ >>> browser.getLink('download').click()
315 >>> browser.title
316- '+export : \xe2\x80\x9cevolution\xe2\x80\x9d package : Translations : 5.04
317- : Ubuntu'
318+ '+export : Template ...evolution-2.2... : ...evolution... package :
319+ Translations : 5.04 : Ubuntu'
320
321 If we POST without the appropriate format included, we tell the user off:
322
323@@ -61,7 +61,7 @@
324 a duplicate request for the PO template to the export queue.
325 This is a no-op: (See bug https://launchpad.net/rosetta/+bug/1558)
326
327- >>> browser.getLink('Download').click()
328+ >>> browser.getLink('download').click()
329 >>> browser.getControl('Selected files:').selected = True
330 >>> browser.getControl('The PO template').selected = True
331 >>> browser.getControl('Format:').value = ['PO']
332
333=== modified file 'lib/lp/translations/stories/standalone/xx-rosetta-potemplate-index.txt'
334--- lib/lp/translations/stories/standalone/xx-rosetta-potemplate-index.txt 2009-07-01 20:45:39 +0000
335+++ lib/lp/translations/stories/standalone/xx-rosetta-potemplate-index.txt 2009-09-16 06:17:21 +0000
336@@ -7,16 +7,14 @@
337 >>> anon_browser.open("http://translations.launchpad.dev/"
338 ... "ubuntu/hoary/+source/evolution/+pots/evolution-2.2/")
339 >>> anon_browser.title
340- 'Translation status for...
341- ...Template "evolution-2.2" in Ubuntu Hoary package "evolution"...'
342+ 'Template ...evolution-2.2... : ...evolution... package : Translations : 5.04 : Ubuntu'
343
344 The owner of the template is diplayed.
345
346 >>> owner_display = find_tag_by_id(anon_browser.contents,
347 ... 'potemplate-owner')
348 >>> print extract_text(owner_display)
349- This template is owned by
350- Rosetta Administrators
351+ Owner: Rosetta Administrators
352
353 The page lists the status of all the translations. It merges the
354 No Privileges Person's languages (which are South African) with
355@@ -27,7 +25,7 @@
356
357 >>> content = find_main_content(anon_browser.contents)
358 >>> print extract_text(content.findAll('h1')[0])
359- Translation status for evolution-2.2
360+ Translation status
361
362 >>> table = content.findAll('table')[0]
363 >>> for row in table.findAll('tr'):
364@@ -48,13 +46,13 @@
365 >>> alternate_notice = find_tag_by_id(anon_browser.contents,
366 ... 'potemplate-relatives')
367 >>> print extract_text(alternate_notice)
368- Other templates from the same source: evolution-2.2.
369+ Other templates here: evolution-2.2
370
371 The notice links to the alternate template.
372
373 >>> print alternate_notice
374 <p...>
375- Other templates from the same source:
376+ <span>Other templates here:</span>
377 <a href="/evolution/trunk/+pots/evolution-2.2">evolution-2.2</a>...
378 </p>
379
380@@ -82,7 +80,7 @@
381 >>> alternate_notice = find_tag_by_id(anon_browser.contents,
382 ... 'potemplate-rel-by-name')
383 >>> print extract_text(alternate_notice)
384- See the same template in: Ubuntu Hoary.
385+ Templates with the same name elsewhere: Ubuntu Hoary
386 >>> print alternate_notice
387 <p...<a href="/ubuntu/hoary/+source/evolution/+pots/evolution-2.2"...
388
389@@ -92,7 +90,7 @@
390 >>> alternate_notice = find_tag_by_id(anon_browser.contents,
391 ... 'potemplate-rel-by-name')
392 >>> print extract_text(alternate_notice)
393- See the same template in: Evolution trunk.
394+ Templates with the same name elsewhere: Evolution trunk
395 >>> print alternate_notice
396 <p...<a href="/evolution/trunk/+pots/evolution-2.2"...
397
398
399=== modified file 'lib/lp/translations/templates/potemplate-index.pt'
400--- lib/lp/translations/templates/potemplate-index.pt 2009-07-17 17:59:07 +0000
401+++ lib/lp/translations/templates/potemplate-index.pt 2009-09-16 06:17:21 +0000
402@@ -2,94 +2,141 @@
403 xmlns="http://www.w3.org/1999/xhtml"
404 xmlns:tal="http://xml.zope.org/namespaces/tal"
405 xmlns:metal="http://xml.zope.org/namespaces/metal"
406- xmlns:i18n="http://xml.zope.org/namespaces/i18n"
407- xml:lang="en"
408- lang="en"
409- dir="ltr"
410- metal:use-macro="view/macro:page/onecolumn"
411- i18n:domain="rosetta"
412+ metal:use-macro="view/macro:page/main_only"
413 >
414
415 <body>
416-<div metal:fill-slot="head_epilogue">
417- <style type="text/css">
418- .inline-icon {
419- position: relative;
420- bottom: -3px;
421- }
422- </style>
423-</div>
424
425 <div metal:fill-slot="main">
426- <h1>
427- Translation status for
428- <tal:title replace="context/name">
429- foo-dev
430- </tal:title>
431- </h1>
432-
433- <ul class="helplinks">
434- <li>
435- <a href="https://help.launchpad.net/Translations/StartingToTranslate"
436- id="link-to-translations-help"
437- >Help for translations
438- </a>
439- </li>
440- </ul>
441-
442+ <ul class="helplinks">
443+ <li>
444+ <a href="https://help.launchpad.net/Translations/StartingToTranslate"
445+ id="link-to-translations-help"
446+ >Help for translations
447+ </a>
448+ </li>
449+ </ul>
450+
451+ <h1>Translation status</h1>
452+
453+ <div class="yui-b top-portlet">
454 <p tal:condition="context/description">
455 <tal:description
456 content="structure context/description/fmt:text-to-html">
457- A brief paragraph describing the potemplate would go here.
458+ A brief paragraph describing this potemplate goes here.
459 </tal:description>
460- <a href="+edit" tal:condition="context/required:launchpad.Edit"
461- ><img src="/@@/edit" title="Update this description"
462- class="inline-icon" /></a>
463- </p>
464- <p tal:condition="not: context/description">
465- This template has no description. <a href="+edit">Create it now!</a>
466- </p>
467- <p tal:condition="context/owner" id="potemplate-owner">
468- This template is owned by
469+ </p>
470+ <p tal:condition="context/owner" id="potemplate-owner"
471+ class="discreet">
472+ <strong>Owner:</strong>
473 <a tal:replace="structure context/owner/fmt:link">owner name</a>
474 </p>
475- <p tal:condition="context/relatives_by_source" id="potemplate-relatives">
476- Other templates from the same source:
477- <tal:relatives_by_source repeat="pot context/relatives_by_source">
478- <a href=""
479- tal:attributes="href pot/fmt:url"
480- tal:content="pot/name">A POTemplate
481- </a>.
482- </tal:relatives_by_source>
483- </p>
484- <p tal:condition="context/relatives_by_name" id="potemplate-rel-by-name">
485- See the same template in:
486- <tal:relatives_by_name repeat="pot context/relatives_by_name">
487- <tal:product condition="pot/productseries">
488+ <div>
489+ <a href="+edit" class="edit sprite"
490+ tal:condition="context/required:launchpad.Edit">Change details</a>
491+ </div>
492+ </div>
493+
494+ <div class="yui-g">
495+ <div class="yui-b portlet">
496+ <h3>Related templates</h3>
497+ </div>
498+ <div class="yui-u first">
499+ <p tal:condition="context/relatives_by_source" id="potemplate-relatives">
500+ <span>Other templates here:</span>
501+ <tal:relatives_by_source repeat="pot view/related_templates_by_source">
502 <a href=""
503- tal:attributes="href pot/fmt:url"
504- tal:content="string:${pot/productseries/product/displayname}
505+ tal:attributes="href pot/fmt:url"
506+ tal:content="pot/name">A POTemplate
507+ </a><tal:comma condition="not: repeat/pot/end">,
508+ </tal:comma></tal:relatives_by_source><!--
509+ --><tal:more condition="view/has_more_templates_by_source"
510+ >...</tal:more>
511+ </p>
512+ </div>
513+
514+ <div class="yui-u">
515+ <p tal:condition="context/relatives_by_name"
516+ id="potemplate-rel-by-name">
517+ <span>Templates with the same name elsewhere:</span>
518+ <tal:relatives_by_name repeat="pot view/related_templates_by_name">
519+ <tal:product condition="pot/productseries">
520+ <a href=""
521+ tal:attributes="href pot/fmt:url"
522+ tal:content="string:${pot/productseries/product/displayname}
523 ${pot/productseries/displayname}">
524 A Product and ProductSeries
525- </a>.
526- </tal:product>
527- <tal:distro condition="pot/distroseries">
528- <a href=""
529- tal:attributes="href pot/fmt:url">
530- <tal:distro_name content="pot/distroseries/distribution/displayname">
531- A Distribution
532- </tal:distro_name>
533- <tal:distroseries_name content="pot/distroseries/displayname">
534- and DistroSeries</tal:distroseries_name></a>.
535- </tal:distro>
536- </tal:relatives_by_name>
537- </p>
538-
539+ </a>
540+ </tal:product><!--
541+ --><tal:distro condition="pot/distroseries">
542+ <a href=""
543+ tal:attributes="href pot/fmt:url">
544+ <tal:distro_name content="pot/distroseries/distribution/displayname">
545+ A Distribution
546+ </tal:distro_name>
547+ <tal:distroseries_name content="pot/distroseries/displayname">
548+ and DistroSeries</tal:distroseries_name></a><!--
549+ --></tal:distro><tal:comma condition="not: repeat/pot/end">,
550+ </tal:comma></tal:relatives_by_name><!--
551+ --><tal:more condition="view/has_more_templates_by_name"
552+ >...</tal:more>
553+ </p>
554+ </div>
555+ </div>
556+
557+ <div class="yui-g">
558+ <div class="yui-u first">
559+ <div class="portlet">
560+ <h3>Permissions</h3>
561+ <p>
562+ <tal:permissions replace="
563+ structure
564+ view/group_parent/@@+portlet-translation-groups-and-permission"/>
565+ </p>
566+ <p tal:condition="view/has_translation_documentation">
567+ Before translating, please look at
568+ <a tal:attributes="
569+ href
570+ view/group_parent/translationgroup/translation_guide_url
571+ ">translation instructions</a>.
572+ </p>
573+ </div>
574+ </div>
575+
576+ <div class="yui-u"
577+ tal:condition="context/required:launchpad.AnyPerson">
578+ <div class="portlet">
579+ <h3>Administration</h3>
580+ <p>If you want to synchronize these translations manually, you
581+ can
582+ <tal:both condition="context/required:launchpad.Edit">
583+ <a tal:attributes="href context/menu:navigation/upload/url"
584+ class="add sprite">upload</a>
585+ or
586+ </tal:both>
587+ <a tal:attributes="href context/menu:navigation/download/url"
588+ class="download sprite">download</a>
589+ translation tarballs.
590+ </p>
591+ <div tal:condition="context/required:launchpad.Admin">
592+ <a tal:attributes="href
593+ context/menu:navigation/administer/url"
594+ class="edit sprite">
595+ Administer this template
596+ </a>
597+ </div>
598+ </div>
599+ </div>
600+ </div>
601+
602+ <div class="yui-b">
603 <div tal:replace="structure context/@@+chart" />
604
605- <div tal:condition="view/has_pofiles"
606- tal:replace="structure context/@@+rosetta-status-legend" />
607-
608+ <div class="translations-legend">
609+ <div tal:condition="view/has_pofiles"
610+ tal:replace="structure context/@@+rosetta-status-legend" />
611+ </div>
612+ </div>
613 </div>
614
615 </body>
616