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

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

 reviewer jtv

= Bug #417082 =

Migrate translation group overview pages and all the related forms to 3.0.

I have not provided any more tests. I'd like to provide some for
Breadcrumb adapters, and at least basic tests for views but branch will
go very quickly (and I'd be happy to get a merge-conditional on that).

== Tests ==

bin/test -vvt translationgroup

== Demo and Q/A ==

https://translations.launchpad.dev/+groups/launchpad-translators
https://translations.launchpad.dev/+groups/ubuntu-translators

= 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/translationgroups/05-add-translation-group.txt
  lib/lp/translations/stories/translationgroups/45-test-distro-restricted-permissions.txt
  lib/lp/translations/browser/configure.zcml
  lib/lp/translations/templates/translationgroup-reassignment.pt
  lib/lp/translations/templates/translationgroup-portlet-projects.pt
  lib/lp/translations/templates/translationgroup-index.pt
  lib/lp/translations/stories/translationgroups/30-show-group-translation-targets.txt
  lib/lp/translations/stories/translationgroups/36-change-translator.txt
  lib/lp/translations/configure.zcml
  lib/lp/translations/browser/translationgroup.py
  lib/lp/translations/stories/translationgroups/06-edit-translation-group.txt
  lib/lp/translations/stories/translationgroups/xx-link-to-documentation.txt
  lib/lp/translations/stories/translationgroups/35-appoint-translators.txt

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

The code looks good to me, although it's a shame there are still several
"style" attributes in the TAL. The UI looks much nicer than it is now.

One thing I don't care for in the translation group page is how, under
"Projects using this group," the references to the group itself are
linkified. It does make it clear that the text refers to a named
object, but the name's capitalization generally does that anyway. It's
a bit restless to have two consecutive paragraphs each link back to the
same page they're on. Especially since there's also a link to the
Translation Teams section on the same page.

Speaking of that link: when you have that paragraph in view, unless
you're working on a telephone screen, it's just about impossible not to
have the Translation Teams section visible at the same time. I'd just
leave these links out.

I also noticed that the Guidelines URLs in the table can get a bit ugly,
but I don't see any better way of showing them.

None of this is fatal, but please make an effort to improve these points
if you can.

On the other hand, I'm deliberately not asking for breadcrumb tests. If
the breadcrumb breaks, the pagetests will show it. Or if we're going to
test that every breadcrumb in the UI appears when we expect it to, we'd
better have a generic, lightweight way of doing it everywhere. The real
problem with breadcrumbs is usually them not being designed in in the
first place, and that's not something that a test will change in this
case.

Jeroen

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/translations/browser/configure.zcml'
2--- lib/lp/translations/browser/configure.zcml 2009-08-25 14:35:03 +0000
3+++ lib/lp/translations/browser/configure.zcml 2009-08-25 16:52:31 +0000
4@@ -448,6 +448,7 @@
5 <browser:url
6 for="lp.translations.interfaces.translationgroup.ITranslationGroup"
7 path_expression="name"
8+ rootsite="translations"
9 parent_utility="lp.translations.interfaces.translationgroup.ITranslationGroupSet"/>
10 <browser:pages
11 for="lp.translations.interfaces.translationgroup.ITranslationGroup"
12@@ -457,29 +458,26 @@
13 <browser:page
14 template="../templates/translationgroup-index.pt"
15 name="+index"/>
16-
17+
18 <!-- TranslationGroup portlets -->
19-
20- <browser:page
21- name="+portlet-relateds"
22- template="../templates/translationgroup-portlet-relateds.pt"/>
23- <browser:page
24- name="+portlet-details"
25- template="../templates/translationgroup-portlet-details.pt"/>
26+
27+ <browser:page
28+ name="+portlet-projects"
29+ template="../templates/translationgroup-portlet-projects.pt"/>
30 </browser:pages>
31 <browser:page
32 name="+edit"
33 for="lp.translations.interfaces.translationgroup.ITranslationGroup"
34 permission="launchpad.Edit"
35 class="lp.translations.browser.translationgroup.TranslationGroupEditView"
36- template="../templates/translationgroup-edit.pt"
37+ template="../../app/templates/generic-edit.pt"
38 layer="canonical.launchpad.layers.TranslationsLayer"/>
39 <browser:page
40 name="+appoint"
41 for="lp.translations.interfaces.translationgroup.ITranslationGroup"
42 permission="launchpad.Edit"
43 class="lp.translations.browser.translationgroup.TranslationGroupAddTranslatorView"
44- template="../templates/translationgroup-appoint.pt"
45+ template="../../app/templates/generic-edit.pt"
46 layer="canonical.launchpad.layers.TranslationsLayer"/>
47 <browser:page
48 name="+reassign"
49
50=== modified file 'lib/lp/translations/browser/translationgroup.py'
51--- lib/lp/translations/browser/translationgroup.py 2009-08-25 14:32:37 +0000
52+++ lib/lp/translations/browser/translationgroup.py 2009-08-25 16:44:22 +0000
53@@ -7,6 +7,7 @@
54 __all__ = [
55 'TranslationGroupAddTranslatorView',
56 'TranslationGroupAddView',
57+ 'TranslationGroupBreadcrumb',
58 'TranslationGroupEditView',
59 'TranslationGroupNavigation',
60 'TranslationGroupReassignmentView',
61@@ -49,6 +50,13 @@
62 text = u"Translation groups"
63
64
65+class TranslationGroupBreadcrumb(Breadcrumb):
66+ """Builds a breadcrumb for an `ITranslationGroup`."""
67+
68+ @property
69+ def text(self):
70+ return self.context.title
71+
72 class TranslationGroupView:
73
74 def __init__(self, context, request):
75@@ -63,8 +71,10 @@
76 result.append({'lang': item.language.englishname,
77 'person': item.translator,
78 'code': item.language.code,
79+ 'language' : item.language,
80 'datecreated': item.datecreated,
81 'style_guide_url': item.style_guide_url,
82+ 'context' : item,
83 })
84 result.sort(key=operator.itemgetter('lang'))
85 return result
86@@ -76,8 +86,8 @@
87 schema = ITranslator
88 field_names = ['language', 'translator', 'style_guide_url']
89
90- @action("Add", name="add")
91- def add_action(self, action, data):
92+ @action("Appoint", name="appoint")
93+ def appoint_action(self, action, data):
94 """Appoint a translator to do translations for given language.
95
96 Create a translator who, within this group, will be responsible for
97@@ -99,8 +109,18 @@
98 "There is already a translator for this language")
99
100 @property
101+ def cancel_url(self):
102+ return canonical_url(self.context)
103+
104+ @property
105 def next_url(self):
106- return canonical_url(self.context)
107+ return self.cancel_url
108+
109+ label = "Appoint a translation team"
110+
111+ @property
112+ def page_title(self):
113+ return 'Apoint a translation team in "%s"' % (self.context.title)
114
115
116 class TranslationGroupEditView(LaunchpadEditFormView):
117@@ -130,8 +150,20 @@
118 "There is already a translation group with this name")
119
120 @property
121+ def cancel_url(self):
122+ return canonical_url(self.context)
123+
124+ @property
125 def next_url(self):
126- return canonical_url(self.context)
127+ return self.cancel_url
128+
129+ @property
130+ def label(self):
131+ return "Change %s details" % (self.context.title)
132+
133+ @property
134+ def page_title(self):
135+ return 'Change "%s" translation group details' % (self.context.title)
136
137
138 class TranslationGroupAddView(LaunchpadFormView):
139
140=== modified file 'lib/lp/translations/configure.zcml'
141--- lib/lp/translations/configure.zcml 2009-08-25 14:32:37 +0000
142+++ lib/lp/translations/configure.zcml 2009-08-25 16:44:22 +0000
143@@ -394,6 +394,11 @@
144 permission="launchpad.Edit"
145 set_schema="lp.translations.interfaces.translationgroup.ITranslationGroup"/>
146 </class>
147+ <adapter
148+ provides="canonical.launchpad.webapp.interfaces.IBreadcrumb"
149+ for="lp.translations.interfaces.translationgroup.ITranslationGroup"
150+ factory="lp.translations.browser.translationgroup.TranslationGroupBreadcrumb"
151+ permission="zope.Public"/>
152
153 <!-- TranslationGroupSet -->
154
155
156=== modified file 'lib/lp/translations/stories/translationgroups/05-add-translation-group.txt'
157--- lib/lp/translations/stories/translationgroups/05-add-translation-group.txt 2009-08-25 10:26:43 +0000
158+++ lib/lp/translations/stories/translationgroups/05-add-translation-group.txt 2009-08-25 16:42:56 +0000
159@@ -82,7 +82,7 @@
160
161 >>> docs = find_tag_by_id(admin_browser.contents, 'documentation')
162 >>> print extract_text(docs)
163- Please read translation instructions...
164+ Please read the translation instructions...
165 >>> docs_url = docs.find('a')
166 >>> extract_link_from_tag(docs_url)
167 u'https://help.launchpad.net/Translations/PolyglotPolicies'
168@@ -113,7 +113,7 @@
169 The Rosetta administrator assigns ownership of the group to Sample
170 Person.
171
172- >>> browser.getLink('Reassign').click()
173+ >>> browser.getLink(id='link-reassign').click()
174 >>> browser.url
175 'http://translations.launchpad.dev/+groups/monolingua/+reassign'
176
177@@ -124,7 +124,7 @@
178
179 The Rosetta administrator is still able to administer this group:
180
181- >>> browser.getLink('Appoint')
182+ >>> browser.getLink('Appoint a new translation team')
183 <...+appoint'>
184
185 But Sample Person is now listed as its owner:
186@@ -139,7 +139,7 @@
187 >>> browser.open(
188 ... 'http://translations.launchpad.dev/'
189 ... 'translations/groups/monolingua/')
190- >>> browser.getLink('Appoint')
191+ >>> browser.getLink('Appoint a new translation team')
192 <...+appoint'>
193
194 The new groups should show up on the "Translation groups" page.
195
196=== modified file 'lib/lp/translations/stories/translationgroups/06-edit-translation-group.txt'
197--- lib/lp/translations/stories/translationgroups/06-edit-translation-group.txt 2009-01-22 18:53:43 +0000
198+++ lib/lp/translations/stories/translationgroups/06-edit-translation-group.txt 2009-08-25 16:42:56 +0000
199@@ -20,7 +20,7 @@
200
201 And select to edit its details.
202
203- >>> admin_browser.getLink('Edit translation group details').click()
204+ >>> admin_browser.getLink('Change details').click()
205 >>> print admin_browser.url
206 http://translations.launchpad.dev/+groups/testing-translation-team/+edit
207
208@@ -52,7 +52,7 @@
209
210 You can also edit the generic translation instructions for the team
211
212- >>> admin_browser.getLink('Edit translation group details').click()
213+ >>> admin_browser.getLink('Change details').click()
214 >>> admin_browser.getControl('Translation instructions').value = (
215 ... u'https://help.launchpad.net/Translations/RenamedGroup')
216 >>> admin_browser.getControl('Change').click()
217
218=== modified file 'lib/lp/translations/stories/translationgroups/30-show-group-translation-targets.txt'
219--- lib/lp/translations/stories/translationgroups/30-show-group-translation-targets.txt 2009-08-13 21:32:59 +0000
220+++ lib/lp/translations/stories/translationgroups/30-show-group-translation-targets.txt 2009-08-25 16:42:56 +0000
221@@ -9,15 +9,14 @@
222 >>> def find_projects_portlet(browser):
223 ... """Find the portlet with projects/distros this group works with.
224 ... """
225- ... return find_portlet(
226- ... browser.contents, "This group supervises translations for")
227+ ... return find_tag_by_id(browser.contents, "related-projects")
228
229 >>> portlet = find_projects_portlet(browser)
230 >>> for link in portlet.findAll('a'):
231 ... print '%s: %s' % (link.find(text=True), link['href'])
232- Ubuntu: /ubuntu
233- NetApplet: /netapplet
234- GNOME: /gnome
235+ Ubuntu: http://launchpad.dev/ubuntu
236+ GNOME: http://launchpad.dev/gnome
237+ NetApplet: http://launchpad.dev/netapplet
238
239 If we disable some of these projects...
240
241@@ -43,7 +42,7 @@
242 >>> portlet = find_projects_portlet(browser)
243 >>> for link in portlet.findAll('a'):
244 ... print '%s: %s' % (link.string, link['href'])
245- Ubuntu: /ubuntu
246+ Ubuntu: http://launchpad.dev/ubuntu
247
248 Let's undo this so we don't get in trouble with other tests in this
249 story!
250
251=== modified file 'lib/lp/translations/stories/translationgroups/35-appoint-translators.txt'
252--- lib/lp/translations/stories/translationgroups/35-appoint-translators.txt 2008-07-24 12:16:08 +0000
253+++ lib/lp/translations/stories/translationgroups/35-appoint-translators.txt 2009-08-25 16:42:56 +0000
254@@ -13,16 +13,16 @@
255 >>> browser.addHeader('Authorization', 'Basic jordi@ubuntu.com:test')
256 >>> browser.open(
257 ... 'http://translations.launchpad.dev/+groups/polyglot/')
258- >>> print find_portlet(browser.contents, 'Translation Teams')
259+ >>> print find_tag_by_id(browser.contents, "translation-teams-listing")
260 <...
261- No translation teams or supervisors have been appointed yet in this
262- group.
263+ No translation teams or supervisors have been appointed in this
264+ group yet.
265 ...
266
267 Verify that the appointments form displays, and offers the option to
268 appoint a translator.
269
270- >>> browser.getLink('Appoint').click()
271+ >>> browser.getLink('Appoint a new translation team').click()
272 >>> browser.url
273 'http://translations.launchpad.dev/+groups/polyglot/+appoint'
274
275@@ -30,14 +30,14 @@
276
277 >>> browser.getControl('Language').value=['ab']
278 >>> browser.getControl('Translator').value='name21'
279- >>> browser.getControl('Add').click()
280+ >>> browser.getControl('Appoint').click()
281
282 We should get redirected back to the group page.
283
284 >>> browser.url
285 'http://translations.launchpad.dev/+groups/polyglot'
286
287- >>> browser.getLink('Appoint').click()
288+ >>> browser.getLink('Appoint a new translation team').click()
289 >>> browser.url
290 'http://translations.launchpad.dev/+groups/polyglot/+appoint'
291
292@@ -45,7 +45,7 @@
293
294 >>> browser.getControl('Language').value=['af']
295 >>> browser.getControl('Translator').value='no-priv'
296- >>> browser.getControl('Add').click()
297+ >>> browser.getControl('Appoint').click()
298
299 Now we should see both of those appointments on the polyglot page:
300
301@@ -59,10 +59,10 @@
302 Appointing a new Abkhazian translator must fail gracefully, not crash as
303 it used to do (Bug #52991).
304
305- >>> browser.getLink('Appoint').click()
306+ >>> browser.getLink('Appoint a new translation team').click()
307 >>> browser.getControl('Language').value=['ab']
308 >>> browser.getControl('Translator').value='name12'
309- >>> browser.getControl('Add').click()
310+ >>> browser.getControl('Appoint').click()
311
312 The error means we stay on the appoint page:
313
314@@ -79,7 +79,7 @@
315
316 >>> admin_browser.open(
317 ... 'http://translations.launchpad.dev/+groups/polyglot/')
318- >>> admin_browser.getLink('Appoint').click()
319+ >>> admin_browser.getLink('Appoint a new translation team').click()
320 >>> admin_browser.url
321 'http://translations.launchpad.dev/+groups/polyglot/+appoint'
322
323@@ -87,7 +87,7 @@
324
325 >>> admin_browser.open(
326 ... 'http://translations.launchpad.dev/+groups/polyglot/')
327- >>> admin_browser.getLink('Edit translation group details').click()
328+ >>> admin_browser.getLink('Change details').click()
329 >>> admin_browser.url
330 'http://translations.launchpad.dev/+groups/polyglot/+edit'
331
332@@ -98,18 +98,18 @@
333 >>> user_browser.url
334 'http://translations.launchpad.dev/+groups/polyglot/'
335
336- >>> user_browser.getLink('Appoint').click()
337+ >>> user_browser.getLink('Appoint a new translation team')
338 Traceback (most recent call last):
339 ...
340- Unauthorized:...
341+ LinkNotFoundError
342
343 >>> user_browser.open(
344 ... 'http://translations.launchpad.dev/+groups/polyglot/')
345 >>> user_browser.url
346 'http://translations.launchpad.dev/+groups/polyglot/'
347
348- >>> user_browser.getLink('Edit translation group details').click()
349+ >>> user_browser.getLink('Change details').click()
350 Traceback (most recent call last):
351 ...
352- Unauthorized:...
353+ LinkNotFoundError
354
355
356=== modified file 'lib/lp/translations/stories/translationgroups/36-change-translator.txt'
357--- lib/lp/translations/stories/translationgroups/36-change-translator.txt 2009-01-08 23:19:08 +0000
358+++ lib/lp/translations/stories/translationgroups/36-change-translator.txt 2009-08-25 16:42:56 +0000
359@@ -9,14 +9,16 @@
360 >>> print anon_browser.url
361 http://translations.launchpad.dev/+groups/polyglot
362
363- >>> portlet = find_portlet(anon_browser.contents, 'Translation Teams')
364+ >>> portlet = find_tag_by_id(
365+ ... anon_browser.contents, "translation-teams-listing")
366 >>> language_rows = portlet.find('tbody').findAll('tr')
367 >>> for language_row in language_rows:
368- ... lang_name = language_row.findNext('td')
369- ... lang_team = lang_name.findNext('td')
370- ... print '%s: %s' % (lang_name.renderContents(), lang_team.a.string)
371- Abkhazian: Hoary Gnome Team
372- Afrikaans: No Privileges Person
373+ ... cell = language_row.findNext('td')
374+ ... lang_name = extract_text(cell)
375+ ... lang_team = extract_text(cell.findNext('td').findNext('a'))
376+ ... print '%s: %s' % (lang_name, lang_team)
377+ Abkhazian (ab): Hoary Gnome Team
378+ Afrikaans (af): No Privileges Person
379
380 >>> browser.addHeader('Authorization', 'Basic jordi@ubuntu.com:test')
381 >>> browser.open(
382@@ -26,7 +28,7 @@
383
384 # We are going to change the Afrikaans (af) translator.
385
386- >>> browser.getLink(url='af').click()
387+ >>> browser.getLink(id='edit-af-translator').click()
388 >>> print browser.url
389 http://translations.launchpad.dev/+groups/polyglot/af
390
391@@ -78,12 +80,14 @@
392
393 # And the 'Translation Teams' portlet shows the new information.
394
395- >>> portlet = find_portlet(browser.contents, 'Translation Teams')
396+ >>> portlet = find_tag_by_id(
397+ ... browser.contents, "translation-teams-listing")
398 >>> language_rows = portlet.find('tbody').findAll('tr')
399 >>> for language_row in language_rows:
400- ... lang_name = language_row.findNext('td')
401- ... lang_team = lang_name.findNext('td')
402- ... print '%s: %s' % (lang_name.renderContents(), lang_team.a.string)
403- Abkhazian: Hoary Gnome Team
404- Welsh: No Privileges Person
405+ ... cell = language_row.findNext('td')
406+ ... lang_name = extract_text(cell)
407+ ... lang_team = extract_text(cell.findNext('td').findNext('a'))
408+ ... print '%s: %s' % (lang_name, lang_team)
409+ Abkhazian (ab): Hoary Gnome Team
410+ Welsh (cy): No Privileges Person
411
412
413=== modified file 'lib/lp/translations/stories/translationgroups/45-test-distro-restricted-permissions.txt'
414--- lib/lp/translations/stories/translationgroups/45-test-distro-restricted-permissions.txt 2009-07-02 10:27:50 +0000
415+++ lib/lp/translations/stories/translationgroups/45-test-distro-restricted-permissions.txt 2009-08-25 16:42:56 +0000
416@@ -88,7 +88,7 @@
417 ... 'http://translations.launchpad.dev/+groups/polyglot/+appoint')
418 >>> admin_browser.getControl('Language').value=['st']
419 >>> admin_browser.getControl('Translator').value='name21'
420- >>> admin_browser.getControl('Add').click()
421+ >>> admin_browser.getControl('Appoint').click()
422
423 No Privileges Person can now enter text, but the page does warn that it
424 will only accept suggestions.
425
426=== modified file 'lib/lp/translations/stories/translationgroups/xx-link-to-documentation.txt'
427--- lib/lp/translations/stories/translationgroups/xx-link-to-documentation.txt 2009-08-21 18:47:31 +0000
428+++ lib/lp/translations/stories/translationgroups/xx-link-to-documentation.txt 2009-08-25 16:42:56 +0000
429@@ -30,11 +30,12 @@
430
431 The link now appears in the table next to the name of the team.
432
433- >>> info = first_tag_by_class(carlos_browser.contents, 'translator_info')
434- >>> info_a = info.findAll('a')
435- >>> print extract_text(info_a[0])
436+ >>> team = first_tag_by_class(carlos_browser.contents, 'translator-team')
437+ >>> print extract_text(team.findAll('a')[0])
438 testing Spanish team
439- >>> print info_a[1]['href']
440+
441+ >>> link = first_tag_by_class(carlos_browser.contents, 'translator-link')
442+ >>> print link.findAll('a')[0]['href']
443 http://www.ubuntu.com/
444
445 Back on the translations page, the link is now present, too.
446@@ -56,7 +57,7 @@
447 ... '+groups/testing-translation-team/+appoint')
448 >>> carlos_browser.getControl('Language').value = ['eo']
449 >>> carlos_browser.getControl('Translator').value = 'name12'
450- >>> carlos_browser.getControl('Add').click()
451+ >>> carlos_browser.getControl('Appoint').click()
452 >>> print carlos_browser.url
453 http://translations.launchpad.dev/+groups/testing-translation-team
454
455
456=== removed file 'lib/lp/translations/templates/translationgroup-appoint.pt'
457--- lib/lp/translations/templates/translationgroup-appoint.pt 2009-07-17 17:59:07 +0000
458+++ lib/lp/translations/templates/translationgroup-appoint.pt 1970-01-01 00:00:00 +0000
459@@ -1,48 +0,0 @@
460-<html
461- xmlns="http://www.w3.org/1999/xhtml"
462- xmlns:tal="http://xml.zope.org/namespaces/tal"
463- xmlns:metal="http://xml.zope.org/namespaces/metal"
464- xmlns:i18n="http://xml.zope.org/namespaces/i18n"
465- xml:lang="en"
466- lang="en"
467- dir="ltr"
468- metal:use-macro="context/@@main_template/master"
469- i18n:domain="launchpad">
470- <body>
471- <div metal:fill-slot="main">
472- <div>
473- <a href="/+groups">Translation groups:</a>
474- <a tal:attributes="href context/fmt:url"
475- tal:content="string:${context/title} translation group">
476- Foo bar translation group
477- </a>
478- </div>
479- <h1>Appoint a translation team or supervisor</h1>
480-
481- <div metal:use-macro="context/@@launchpad_form/form" />
482- </div>
483-
484- <div metal:fill-slot="help">
485- <p>
486- Here you can appoint a translation team (or an individual supervisor)
487- to be responsible for a particular language within this translation
488- group. One translation team can take care of any number of languages,
489- but the group can only appoint one team for any single language. To
490- avoid mistakes, this form will not allow you to appoint a new team for
491- a language that already has one assigned in this group.
492- </p>
493- <p>
494- A supervisor does not have to be a single person. If you want to have
495- several people taking care of a single language in this translation
496- group, make them a team and appoint that whole team as the translation
497- team.
498- </p>
499- <ul class="info">
500- <li>
501- <a href="https://help.launchpad.net/RosettaFAQ"
502- >Frequently asked questions</a>
503- </li>
504- </ul>
505- </div>
506- </body>
507-</html>
508
509=== removed file 'lib/lp/translations/templates/translationgroup-edit.pt'
510--- lib/lp/translations/templates/translationgroup-edit.pt 2009-07-17 17:59:07 +0000
511+++ lib/lp/translations/templates/translationgroup-edit.pt 1970-01-01 00:00:00 +0000
512@@ -1,31 +0,0 @@
513-<html
514- xmlns="http://www.w3.org/1999/xhtml"
515- xmlns:tal="http://xml.zope.org/namespaces/tal"
516- xmlns:metal="http://xml.zope.org/namespaces/metal"
517- xmlns:i18n="http://xml.zope.org/namespaces/i18n"
518- xml:lang="en"
519- lang="en"
520- dir="ltr"
521- metal:use-macro="context/@@main_template/master"
522- i18n:domain="launchpad">
523- <body>
524- <div metal:fill-slot="main">
525- <div>
526- <a href="/+groups">Translation groups:</a>
527- <a tal:attributes="href context/fmt:url">
528- <tal:translation-group replace="context/title">
529- Foo bar
530- </tal:translation-group> translation group
531- </a>
532- </div>
533- <h1>
534- Edit
535- <tal:translation-group replace="context/title">
536- Foo bar
537- </tal:translation-group> translation group details
538- </h1>
539-
540- <div metal:use-macro="context/@@launchpad_form/form" />
541- </div>
542- </body>
543-</html>
544
545=== modified file 'lib/lp/translations/templates/translationgroup-index.pt'
546--- lib/lp/translations/templates/translationgroup-index.pt 2009-07-17 17:59:07 +0000
547+++ lib/lp/translations/templates/translationgroup-index.pt 2009-08-25 16:42:56 +0000
548@@ -3,150 +3,137 @@
549 xmlns:tal="http://xml.zope.org/namespaces/tal"
550 xmlns:metal="http://xml.zope.org/namespaces/metal"
551 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
552- xml:lang="en"
553- lang="en"
554- dir="ltr"
555- metal:use-macro="context/@@main_template/master"
556+ metal:use-macro="view/macro:page/main_only"
557 i18n:domain="launchpad">
558 <body>
559- <div metal:fill-slot="main">
560- <div>
561- <a href="/+groups">Translation groups</a>
562- </div>
563+ <div metal:fill-slot="heading">
564 <h1>
565 <tal:translation-group replace="context/title">
566 Foo bar
567 </tal:translation-group> translation group
568 </h1>
569-
570- <p class="documentDescription" tal:content="context/summary">
571+ </div>
572+
573+ <div metal:fill-slot="main"
574+ style="max-width:800px;">
575+ <p>
576+ Administered by
577+ <a tal:content="context/owner/fmt:displayname"
578+ tal:attributes="href context/owner/fmt:url"
579+ class="link" />
580+ <a tal:condition="context/required:launchpad.Edit"
581+ href="+reassign" title="Change administrator"
582+ class="edit sprite" id="link-reassign"></a>
583+ </p>
584+
585+ <div tal:content="structure context/summary/fmt:text-to-html"
586+ class="summary">
587 $TranslationGroup.summary goes here. This should be quite short,
588 just a single paragraph of text really, giving a summary of
589 this TranslationGroup.
590- </p>
591+ </div>
592+
593 <p id="documentation" tal:condition="context/translation_guide_url">
594- <em>Please read <a tal:attributes="
595+ <em>Please read the <a tal:attributes="
596 href context/translation_guide_url">translation instructions</a>
597 to learn about policies, recommendations and caveats for doing
598 translations in this translation group.</em>
599 </p>
600- <p>
601- Group owner:
602- <a tal:content="context/owner/fmt:displayname"
603- tal:attributes="href context/owner/fmt:url"
604- class="link" />
605- <a tal:condition="context/required:launchpad.Edit" href="+reassign">
606- <img src="/@@/edit" alt="Reassign" title="Change Owner" />
607- </a>
608- </p>
609-
610- <div class="left">
611- <div class="section">
612- <div class="portlet">
613- <h2>Translation Teams</h2>
614- <tal:translators condition="context/translators">
615- <table class="sortable listing" id="group-members">
616- <thead>
617- <tr>
618- <th>Language</th>
619- <th>Team/Supervisor</th>
620- <th></th>
621- <th>Appointed</th>
622- <th tal:condition="context/required:launchpad.Edit"></th>
623- </tr>
624- </thead>
625- <tbody>
626- <tr tal:repeat="translator view/translator_list">
627- <td tal:content="translator/lang" />
628- <td class="translator_info">
629- <a tal:content="translator/person/displayname"
630- tal:attributes="href translator/person/fmt:url" />
631- <a tal:condition="translator/style_guide_url"
632- tal:attributes="href translator/style_guide_url"
633- ><img src="/@@/link" alt="Doc"
634+
635+ <div tal:condition="context/required:launchpad.Edit">
636+ <a href="+edit" class="edit sprite">Change details</a>
637+ </div>
638+
639+ <div style="height:2em;"></div><!-- separator -->
640+
641+ <div id="translation-teams-listing">
642+ <h2><a name="teams"></a>Translation teams</h2>
643+ <tal:translators condition="context/translators">
644+ <table class="sortable listing" id="group-members">
645+ <thead>
646+ <tr>
647+ <th style="text-align:left">Language</th>
648+ <th>Team/Supervisor</th>
649+ <th>Guidelines</th>
650+ <th>Appointed</th>
651+ <th tal:condition="context/required:launchpad.Edit"></th>
652+ </tr>
653+ </thead>
654+ <tbody>
655+ <tr tal:repeat="translator view/translator_list">
656+ <td class="translator-language">
657+ <a tal:attributes="href translator/language/fmt:url"
658+ tal:content="translator/language/displayname">
659+ Serbian</a>
660+ </td>
661+ <td class="translator-team">
662+ <a tal:replace="structure translator/person/fmt:link">
663+ Translator</a>
664+ <tal:team condition="translator/person/is_team">
665+ with
666+ <tal:count replace="
667+ translator/person/active_member_count">6</tal:count>
668+ members
669+ </tal:team>
670+ </td>
671+ <td class="translator-link">
672+ <a tal:condition="translator/style_guide_url"
673+ tal:attributes="href translator/style_guide_url"
674+ ><img src="/@@/link" alt="Doc"
675 tal:attributes="title translator/style_guide_url"
676- /></a>
677- </td>
678- <td><a tal:attributes="href translator/code"><img
679- src="/@@/edit" alt="Change"
680- title="Change Translator" /></a>
681- </td>
682- <td>
683- <span class="sortkey"
684- tal:content="translator/datecreated/fmt:datetime" />
685- <span
686- tal:attributes="title translator/datecreated/fmt:datetime"
687- tal:content="translator/datecreated/fmt:approximatedate">
688- 2007-09-17
689- </span>
690- </td>
691- <td>
692- <a
693- tal:attributes="href string:${translator/code}/+remove">
694- <input type="image" style="border: 0;"
695- src="/@@/remove" alt="Remove Translator"
696- title="Remove Translator" name="rmform" />
697- </a>
698- </td>
699- </tr>
700- </tbody>
701- </table>
702- </tal:translators>
703- <tal:no-translators condition="not: context/translators">
704- No translation teams or supervisors have been appointed yet in
705- this group.
706- </tal:no-translators>
707- <ul class="menu">
708- <tal:can-edit condition="context/required:launchpad.Edit">
709- <li class="add">
710- <a href="+appoint">Appoint translation team or supervisor</a>
711- </li>
712- <li class="edit">
713- <a href="+edit">Edit translation group details</a>
714- </li>
715- </tal:can-edit>
716- <tal:cannot-edit
717- condition="not:context/required:launchpad.Edit">
718- <li class="locked">
719- <a href="+appoint">Appoint translation team or supervisor</a>
720- </li>
721- <li class="locked">
722- <a href="+edit">Edit translation group details</a>
723- </li>
724- </tal:cannot-edit>
725- </ul>
726- </div>
727+ />
728+ <tal:link
729+ replace="translator/style_guide_url/fmt:shorten/30"
730+ ></tal:link></a>
731+ <span tal:condition="not:translator/style_guide_url">
732+ none
733+ </span>
734+ <tal:notadmin
735+ condition="not:context/required:launchpad.Edit">
736+ &nbsp;<a tal:condition="
737+ translator/context/required:launchpad.Edit"
738+ tal:attributes="href string:${translator/code}/+edit"
739+ class="edit sprite"></a>
740+ </tal:notadmin>
741+ </td>
742+ <td>
743+ <span
744+ tal:attributes="title translator/datecreated/fmt:datetime"
745+ tal:content="translator/datecreated/fmt:approximatedate">
746+ 2007-09-17
747+ </span>
748+ </td>
749+ <td tal:condition="context/required:launchpad.Edit">
750+ <a tal:attributes="
751+ href translator/code;
752+ id string:edit-${translator/code}-translator"
753+ title="Change translator and documentation link"
754+ alt="Change" class="edit sprite"></a>
755+ <a tal:attributes="href string:${translator/code}/+remove"
756+ alt="Remove" title="Remove translator"
757+ class="remove sprite"></a>
758+ </td>
759+ </tr>
760+ </tbody>
761+ </table>
762+ </tal:translators>
763+ <tal:no-translators condition="not: context/translators">
764+ No translation teams or supervisors have been appointed in
765+ this group yet.
766+ </tal:no-translators>
767+ <div style="margin-top:1em; margin-bottom: 2em;">
768+ <a tal:condition="context/required:launchpad.Edit"
769+ href="+appoint" class="add sprite">Appoint a new translation
770+ team</a>
771 </div>
772- </div>
773- <div class="right">
774+ </div><!-- id="translations-team-listing" -->
775+
776 <div class="section">
777- <div tal:replace="structure context/@@+portlet-relateds" />
778+ <a name="projects"></a>
779+ <div tal:replace="structure context/@@+portlet-projects" />
780 </div>
781- </div>
782- </div>
783-
784- <div metal:fill-slot="help">
785- <p>
786- This is an overview of the
787- "<span tal:replace="context/name">transgroup</span>" translation
788- group. A translation group is a collection of teams and/or
789- people who supervise the translations for a piece of software.
790- A translation group can manage translations for any number of
791- projects into any number of languages. Translation groups make it
792- easier to coordinate and oversee large translation efforts.
793- </p>
794- <p>
795- Within the group, a translation team or individual supervisor is
796- appointed for every language that the group supports. One
797- person or team may work on multiple languages if desired, and
798- even participate in multiple translation groups.
799- </p>
800- <ul class="info">
801- <li>
802- <a href="https://help.launchpad.net/RosettaFAQ"
803- >Frequently asked questions</a>
804- </li>
805- </ul>
806- </div>
807+
808+ </div><!-- main -->
809+
810 </body>
811 </html>
812
813=== removed file 'lib/lp/translations/templates/translationgroup-portlet-details.pt'
814--- lib/lp/translations/templates/translationgroup-portlet-details.pt 2009-07-17 17:59:07 +0000
815+++ lib/lp/translations/templates/translationgroup-portlet-details.pt 1970-01-01 00:00:00 +0000
816@@ -1,14 +0,0 @@
817-<tal:root
818- xmlns:tal="http://xml.zope.org/namespaces/tal"
819- xmlns:metal="http://xml.zope.org/namespaces/metal"
820- xmlns:i18n="http://xml.zope.org/namespaces/i18n"
821- omit-tag="">
822-
823-<div class="portlet" id="portlet-details">
824- <h2>Current details</h2>
825- <div class="portletBody portletContent">
826- Owner:
827- <a tal:replace="structure context/owner/fmt:link" />
828- </div>
829-</div>
830-</tal:root>
831
832=== renamed file 'lib/lp/translations/templates/translationgroup-portlet-relateds.pt' => 'lib/lp/translations/templates/translationgroup-portlet-projects.pt'
833--- lib/lp/translations/templates/translationgroup-portlet-relateds.pt 2009-08-13 21:32:59 +0000
834+++ lib/lp/translations/templates/translationgroup-portlet-projects.pt 2009-08-25 16:42:56 +0000
835@@ -4,45 +4,52 @@
836 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
837 omit-tag="">
838
839-<div class="portlet" id="portlet-related">
840- <h2>This group supervises translations for</h2>
841-
842- <div class="portletBody">
843- <div class="portletContent">
844-
845- <tal:distributions condition="context/distributions">
846- <h3>Distributions:</h3>
847- <ul>
848- <li tal:repeat="distribution context/distributions">
849- <a href="#"
850- tal:content="distribution/displayname"
851- tal:attributes="href distribution/fmt:url">Ubuntu</a>
852- </li>
853- </ul>
854- </tal:distributions>
855-
856- <tal:products condition="context/products">
857- <h3>Projects:</h3>
858- <ul>
859- <li tal:repeat="product context/products">
860- <tal:link replace="structure product/fmt:link:translations" />
861- <tal:link replace="structure product/fmt:url:translations" />
862- </li>
863- </ul>
864- </tal:products>
865-
866- <tal:projects condition="context/projects">
867- <h3>Project Groups:</h3>
868- <ul>
869- <li tal:repeat="project context/projects">
870- <a href="#"
871- tal:content="project/displayname"
872- tal:attributes="href project/fmt:url">Gnome</a>
873- </li>
874- </ul>
875- </tal:projects>
876-
877- </div>
878+ <h2>Projects using this group</h2>
879+
880+ <p>
881+ Projects listed here are using
882+ <a tal:attributes="href context/fmt:url"
883+ tal:content="context/title"
884+ >this group</a> to manage their translations.
885+ This means that members of the group (as displayed above in
886+ the <a href="#teams">Translation teams</a> section) are in charge
887+ of managing translations for their particular language.
888+ </p>
889+
890+ <p>
891+ Want to set your project as using
892+ <a tal:attributes="href context/fmt:url"
893+ tal:content="context/title"
894+ >this group</a>? Set it on Translations Settings page.
895+ </p>
896+
897+ <div id="related-projects">
898+ <div tal:condition="context/distributions" style="margin-top:1em;">
899+ <h3 style="display: inline;">Distributions:</h3>
900+ <tal:distribution
901+ repeat="distribution context/distributions">
902+ <a href="#" tal:replace="structure distribution/fmt:link">Ubuntu
903+ </a><tal:comma condition="not:repeat/distribution/end">, </tal:comma>
904+ </tal:distribution>
905+ </div>
906+
907+ <div tal:condition="context/projects" style="margin-top:1em;">
908+ <h3 style="display: inline;">Project groups:</h3>
909+ <tal:project
910+ repeat="project context/projects">
911+ <a href="#" tal:replace="structure project/fmt:link">GNOME
912+ </a><tal:comma condition="not:repeat/project/end">, </tal:comma>
913+ </tal:project>
914+ </div>
915+
916+ <div tal:condition="context/products" style="margin-top:1em;">
917+ <h3 style="display: inline;">Projects:</h3>
918+ <tal:product
919+ repeat="product context/products">
920+ <a href="#" tal:replace="structure product/fmt:link">Firefox
921+ </a><tal:comma condition="not:repeat/product/end">, </tal:comma>
922+ </tal:product>
923+ </div>
924+
925 </div>
926-</div>
927 </tal:root>
928
929=== modified file 'lib/lp/translations/templates/translationgroup-reassignment.pt'
930--- lib/lp/translations/templates/translationgroup-reassignment.pt 2009-08-13 20:28:35 +0000
931+++ lib/lp/translations/templates/translationgroup-reassignment.pt 2009-08-25 13:32:26 +0000
932@@ -3,27 +3,13 @@
933 xmlns:tal="http://xml.zope.org/namespaces/tal"
934 xmlns:metal="http://xml.zope.org/namespaces/metal"
935 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
936- xml:lang="en"
937- lang="en"
938- dir="ltr"
939- metal:use-macro="context/@@main_template/master"
940+ metal:use-macro="view/macro:page/main_only"
941 i18n:domain="launchpad">
942 <body>
943 <div metal:fill-slot="main">
944- <div>
945- <a tal:attributes="href context/fmt:url">
946- <tal:translation-group replace="context/title">
947- Foo bar
948- </tal:translation-group> translation group
949- </a>
950- </div>
951- <h1>
952- Change the
953- <tal:role replace="view/ownerOrMaintainerAttr" /> of
954- <tal:thing replace="view/contextName" />
955- </h1>
956
957- <div metal:use-macro="context/@@+object-reassignment/object-reassignment" />
958+ <div metal:use-macro="
959+ context/@@+object-reassignment/object-reassignment" />
960 </div>
961 </body>
962 </html>
963