Merge lp://staging/~henninge/launchpad/bug-427957-1 into lp://staging/launchpad

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

Mechanical conversion of pofile details (formerly pofile index) to 3.0. Also renamed the template itself, so pofile-index is gone completely.

Revision history for this message
Henning Eggers (henninge) wrote :
Revision history for this message
Данило Шеган (danilo) wrote :

All good.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/launchpad/pagetitles.py'
--- lib/canonical/launchpad/pagetitles.py 2009-09-16 08:27:02 +0000
+++ lib/canonical/launchpad/pagetitles.py 2009-09-16 12:02:51 +0000
@@ -707,8 +707,6 @@
707707
708person_teamhierarchy = ContextDisplayName('Team hierarchy for %s')708person_teamhierarchy = ContextDisplayName('Team hierarchy for %s')
709709
710pofile_index = ContextTitle(smartquote('Translation overview for "%s"'))
711
712# portlet_* are portlets710# portlet_* are portlets
713711
714poll_edit = ContextTitle(smartquote('Edit poll "%s"'))712poll_edit = ContextTitle(smartquote('Edit poll "%s"'))
715713
=== modified file 'lib/lp/translations/browser/configure.zcml'
--- lib/lp/translations/browser/configure.zcml 2009-09-15 16:52:45 +0000
+++ lib/lp/translations/browser/configure.zcml 2009-09-16 12:02:51 +0000
@@ -203,14 +203,18 @@
203 for="lp.translations.interfaces.pofile.IPOFile"203 for="lp.translations.interfaces.pofile.IPOFile"
204 name="+translate"204 name="+translate"
205 layer="canonical.launchpad.layers.TranslationsLayer"/>205 layer="canonical.launchpad.layers.TranslationsLayer"/>
206 <browser:page
207 for="lp.translations.interfaces.pofile.IPOFile"
208 name="+details"
209 permission="zope.Public"
210 class="lp.translations.browser.pofile.POFileDetailsView"
211 layer="canonical.launchpad.layers.TranslationsLayer"
212 template="../templates/pofile-details.pt"/>
206 <browser:pages213 <browser:pages
207 for="lp.translations.interfaces.pofile.IPOFile"214 for="lp.translations.interfaces.pofile.IPOFile"
208 permission="zope.Public"215 permission="zope.Public"
209 class="lp.translations.browser.pofile.POFileView"216 class="lp.translations.browser.pofile.POFileView"
210 layer="canonical.launchpad.layers.TranslationsLayer">217 layer="canonical.launchpad.layers.TranslationsLayer">
211 <browser:page
212 name="+details"
213 template="../templates/pofile-index.pt"/>
214 <!-- POFile Portlets -->218 <!-- POFile Portlets -->
215 <browser:page219 <browser:page
216 name="+contributors"220 name="+contributors"
217221
=== modified file 'lib/lp/translations/browser/pofile.py'
--- lib/lp/translations/browser/pofile.py 2009-09-15 18:53:26 +0000
+++ lib/lp/translations/browser/pofile.py 2009-09-16 12:02:51 +0000
@@ -117,7 +117,7 @@
117117
118 def translate(self):118 def translate(self):
119 text = 'Translate'119 text = 'Translate'
120 return Link('+translate', text, icon='languages')120 return Link('+translate', text, icon='language')
121121
122 @enabled_with_permission('launchpad.Edit')122 @enabled_with_permission('launchpad.Edit')
123 def upload(self):123 def upload(self):
@@ -443,6 +443,15 @@
443 return managers443 return managers
444444
445445
446class POFileDetailsView(POFileView):
447 """View for the detail page of a POFile"""
448
449 @property
450 def label(self):
451 return _("Details for %s translation") % (
452 self.context.language.englishname)
453
454
446class TranslationMessageContainer:455class TranslationMessageContainer:
447 def __init__(self, translation, pofile):456 def __init__(self, translation, pofile):
448 self.data = translation457 self.data = translation
449458
=== modified file 'lib/lp/translations/stories/standalone/xx-pofile-details.txt'
--- lib/lp/translations/stories/standalone/xx-pofile-details.txt 2009-09-15 18:53:26 +0000
+++ lib/lp/translations/stories/standalone/xx-pofile-details.txt 2009-09-16 12:02:51 +0000
@@ -6,34 +6,16 @@
6 ... 'evolution-2.2/es/+details')6 ... 'evolution-2.2/es/+details')
7 >>> print extract_text(find_main_content(anon_browser.contents)).encode(7 >>> print extract_text(find_main_content(anon_browser.contents)).encode(
8 ... 'ascii', 'backslashreplace')8 ... 'ascii', 'backslashreplace')
9 Translation details / Translate / Download translation9 Details for Spanish translation
10 Template "evolution-2.2" in Evolution trunk10 ...
11 Overview for Spanish translation11 Latest contributor:
12 Carlos...
12 Contributors to this translation13 Contributors to this translation
13 The following people have made some contribution to this specific14 The following people have made some contribution to this specific
14 translation:15 translation:
15 Carlos... (filter)16 Carlos... (filter)
16 Mark Shuttleworth (filter)17 Mark Shuttleworth (filter)
17 No Privileges Person (filter)18 No Privileges Person (filter)
18 ...
19
20This page has a navigation menu for translating, importing translations
21into, or exporting translations from the template. (The import option
22is not available to users without edit rights on the translation).
23
24 >>> navigation_tabs = find_tag_by_id(
25 ... anon_browser.contents, 'context-navigation-tabs')
26 >>> for link in navigation_tabs.findAll('a'):
27 ... print "%s:\n%s" % (extract_text(link), link['href'])
28 Translate:
29 http://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2/es/+translate
30 Download translation:
31 http://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2/es/+export
32
33And has no actions menu:
34
35 >>> print find_tag_by_id(anon_browser.contents, 'actions')
36 None
3719
38User can filter any contributions done by Carlos (the first person20User can filter any contributions done by Carlos (the first person
39appearing among contributors), by choosing the 'filter' link:21appearing among contributors), by choosing the 'filter' link:
4022
=== renamed file 'lib/lp/translations/templates/pofile-index.pt' => 'lib/lp/translations/templates/pofile-details.pt'
--- lib/lp/translations/templates/pofile-index.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/translations/templates/pofile-details.pt 2009-09-16 12:02:51 +0000
@@ -3,50 +3,59 @@
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/searchless"
7 lang="en"7 i18n:domain="launchpad"
8 dir="ltr"
9 metal:use-macro="view/macro:page/onecolumn"
10>8>
11 <body>9 <body>
12 <div metal:fill-slot="main">10 <div metal:fill-slot="main">
1311
14 <div>12 <div class="yui-g">
15 <a tal:attributes="href context/potemplate/fmt:url"13 <div class="yui-u first">
16 tal:content="context/potemplate/title">14 <div tal:replace="structure context/@@+portlet-details" />
17 evolution 2.10 template15 <div class="portlet">
18 </a>16 <h2>Related pages</h2>
19 </div>17 <ul tal:define="navigation_menu context/menu:navigation">
20 <h1>18 <li
21 Overview for19 tal:define="link navigation_menu/translate"
22 <tal:language replace="context/language/englishname">20 tal:condition="link/enabled"
23 Spanish21 tal:content="structure link/render">Translate</li>
24 </tal:language>22 <li
25 translation23 tal:define="link navigation_menu/download"
26 </h1>24 tal:condition="link/enabled"
2725 tal:content="structure link/render">Download translation</li>
28 <h2>Contributors to this translation</h2>26 <li
2927 tal:define="link navigation_menu/upload"
30 <p tal:condition="view/contributors">28 tal:condition="link/enabled"
31 The following people have made some contribution to this specific29 tal:content="structure link/render">Upload translation</li>
32 translation:30 </ul>
33 </p>31 </div>
3432 </div>
35 <ul tal:condition="view/contributors">33 <div class="yui-u">
36 <li tal:repeat="contributor view/contributors">34 <div tal:replace="structure context/@@+portlet-stats" />
37 <a tal:replace="structure contributor/fmt:link" />35 <div class="portlet">
38 (<a tal:attributes="36 <h2>Contributors to this translation</h2>
39 href string:${context/fmt:url}/+filter?person=${contributor/name}"37
40 >filter</a>)38 <p tal:condition="view/contributors">
41 </li>39 The following people have made some contribution to this specific
42 </ul>40 translation:
4341 </p>
44 <p42
45 tal:condition="not: view/contributors"43 <ul tal:condition="view/contributors">
46 class="informational message"44 <li tal:repeat="contributor view/contributors">
47 >No contributors recorded for this PO file.</p>45 <a tal:replace="structure contributor/fmt:link" />
48 <div tal:replace="structure context/@@+portlet-details" />46 (<a tal:attributes="
49 <div tal:replace="structure context/@@+portlet-stats" />47 href string:${context/fmt:url}/+filter?person=${contributor/name}"
48 >filter</a>)
49 </li>
50 </ul>
51
52 <p
53 tal:condition="not: view/contributors"
54 class="informational message"
55 >No contributors recorded for this PO file.</p>
56 </div>
57 </div>
58 </div>
50 </div>59 </div>
51 </body>60 </body>
52</html>61</html>