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
1=== modified file 'lib/canonical/launchpad/pagetitles.py'
2--- lib/canonical/launchpad/pagetitles.py 2009-09-16 08:27:02 +0000
3+++ lib/canonical/launchpad/pagetitles.py 2009-09-16 12:02:51 +0000
4@@ -707,8 +707,6 @@
5
6 person_teamhierarchy = ContextDisplayName('Team hierarchy for %s')
7
8-pofile_index = ContextTitle(smartquote('Translation overview for "%s"'))
9-
10 # portlet_* are portlets
11
12 poll_edit = ContextTitle(smartquote('Edit poll "%s"'))
13
14=== modified file 'lib/lp/translations/browser/configure.zcml'
15--- lib/lp/translations/browser/configure.zcml 2009-09-15 16:52:45 +0000
16+++ lib/lp/translations/browser/configure.zcml 2009-09-16 12:02:51 +0000
17@@ -203,14 +203,18 @@
18 for="lp.translations.interfaces.pofile.IPOFile"
19 name="+translate"
20 layer="canonical.launchpad.layers.TranslationsLayer"/>
21+ <browser:page
22+ for="lp.translations.interfaces.pofile.IPOFile"
23+ name="+details"
24+ permission="zope.Public"
25+ class="lp.translations.browser.pofile.POFileDetailsView"
26+ layer="canonical.launchpad.layers.TranslationsLayer"
27+ template="../templates/pofile-details.pt"/>
28 <browser:pages
29 for="lp.translations.interfaces.pofile.IPOFile"
30 permission="zope.Public"
31 class="lp.translations.browser.pofile.POFileView"
32 layer="canonical.launchpad.layers.TranslationsLayer">
33- <browser:page
34- name="+details"
35- template="../templates/pofile-index.pt"/>
36 <!-- POFile Portlets -->
37 <browser:page
38 name="+contributors"
39
40=== modified file 'lib/lp/translations/browser/pofile.py'
41--- lib/lp/translations/browser/pofile.py 2009-09-15 18:53:26 +0000
42+++ lib/lp/translations/browser/pofile.py 2009-09-16 12:02:51 +0000
43@@ -117,7 +117,7 @@
44
45 def translate(self):
46 text = 'Translate'
47- return Link('+translate', text, icon='languages')
48+ return Link('+translate', text, icon='language')
49
50 @enabled_with_permission('launchpad.Edit')
51 def upload(self):
52@@ -443,6 +443,15 @@
53 return managers
54
55
56+class POFileDetailsView(POFileView):
57+ """View for the detail page of a POFile"""
58+
59+ @property
60+ def label(self):
61+ return _("Details for %s translation") % (
62+ self.context.language.englishname)
63+
64+
65 class TranslationMessageContainer:
66 def __init__(self, translation, pofile):
67 self.data = translation
68
69=== modified file 'lib/lp/translations/stories/standalone/xx-pofile-details.txt'
70--- lib/lp/translations/stories/standalone/xx-pofile-details.txt 2009-09-15 18:53:26 +0000
71+++ lib/lp/translations/stories/standalone/xx-pofile-details.txt 2009-09-16 12:02:51 +0000
72@@ -6,34 +6,16 @@
73 ... 'evolution-2.2/es/+details')
74 >>> print extract_text(find_main_content(anon_browser.contents)).encode(
75 ... 'ascii', 'backslashreplace')
76- Translation details / Translate / Download translation
77- Template "evolution-2.2" in Evolution trunk
78- Overview for Spanish translation
79+ Details for Spanish translation
80+ ...
81+ Latest contributor:
82+ Carlos...
83 Contributors to this translation
84 The following people have made some contribution to this specific
85 translation:
86 Carlos... (filter)
87 Mark Shuttleworth (filter)
88 No Privileges Person (filter)
89- ...
90-
91-This page has a navigation menu for translating, importing translations
92-into, or exporting translations from the template. (The import option
93-is not available to users without edit rights on the translation).
94-
95- >>> navigation_tabs = find_tag_by_id(
96- ... anon_browser.contents, 'context-navigation-tabs')
97- >>> for link in navigation_tabs.findAll('a'):
98- ... print "%s:\n%s" % (extract_text(link), link['href'])
99- Translate:
100- http://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2/es/+translate
101- Download translation:
102- http://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2/es/+export
103-
104-And has no actions menu:
105-
106- >>> print find_tag_by_id(anon_browser.contents, 'actions')
107- None
108
109 User can filter any contributions done by Carlos (the first person
110 appearing among contributors), by choosing the 'filter' link:
111
112=== renamed file 'lib/lp/translations/templates/pofile-index.pt' => 'lib/lp/translations/templates/pofile-details.pt'
113--- lib/lp/translations/templates/pofile-index.pt 2009-07-17 17:59:07 +0000
114+++ lib/lp/translations/templates/pofile-details.pt 2009-09-16 12:02:51 +0000
115@@ -3,50 +3,59 @@
116 xmlns:tal="http://xml.zope.org/namespaces/tal"
117 xmlns:metal="http://xml.zope.org/namespaces/metal"
118 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
119- xml:lang="en"
120- lang="en"
121- dir="ltr"
122- metal:use-macro="view/macro:page/onecolumn"
123+ metal:use-macro="view/macro:page/searchless"
124+ i18n:domain="launchpad"
125 >
126 <body>
127 <div metal:fill-slot="main">
128
129- <div>
130- <a tal:attributes="href context/potemplate/fmt:url"
131- tal:content="context/potemplate/title">
132- evolution 2.10 template
133- </a>
134- </div>
135- <h1>
136- Overview for
137- <tal:language replace="context/language/englishname">
138- Spanish
139- </tal:language>
140- translation
141- </h1>
142-
143- <h2>Contributors to this translation</h2>
144-
145- <p tal:condition="view/contributors">
146- The following people have made some contribution to this specific
147- translation:
148- </p>
149-
150- <ul tal:condition="view/contributors">
151- <li tal:repeat="contributor view/contributors">
152- <a tal:replace="structure contributor/fmt:link" />
153- (<a tal:attributes="
154- href string:${context/fmt:url}/+filter?person=${contributor/name}"
155- >filter</a>)
156- </li>
157- </ul>
158-
159- <p
160- tal:condition="not: view/contributors"
161- class="informational message"
162- >No contributors recorded for this PO file.</p>
163- <div tal:replace="structure context/@@+portlet-details" />
164- <div tal:replace="structure context/@@+portlet-stats" />
165+ <div class="yui-g">
166+ <div class="yui-u first">
167+ <div tal:replace="structure context/@@+portlet-details" />
168+ <div class="portlet">
169+ <h2>Related pages</h2>
170+ <ul tal:define="navigation_menu context/menu:navigation">
171+ <li
172+ tal:define="link navigation_menu/translate"
173+ tal:condition="link/enabled"
174+ tal:content="structure link/render">Translate</li>
175+ <li
176+ tal:define="link navigation_menu/download"
177+ tal:condition="link/enabled"
178+ tal:content="structure link/render">Download translation</li>
179+ <li
180+ tal:define="link navigation_menu/upload"
181+ tal:condition="link/enabled"
182+ tal:content="structure link/render">Upload translation</li>
183+ </ul>
184+ </div>
185+ </div>
186+ <div class="yui-u">
187+ <div tal:replace="structure context/@@+portlet-stats" />
188+ <div class="portlet">
189+ <h2>Contributors to this translation</h2>
190+
191+ <p tal:condition="view/contributors">
192+ The following people have made some contribution to this specific
193+ translation:
194+ </p>
195+
196+ <ul tal:condition="view/contributors">
197+ <li tal:repeat="contributor view/contributors">
198+ <a tal:replace="structure contributor/fmt:link" />
199+ (<a tal:attributes="
200+ href string:${context/fmt:url}/+filter?person=${contributor/name}"
201+ >filter</a>)
202+ </li>
203+ </ul>
204+
205+ <p
206+ tal:condition="not: view/contributors"
207+ class="informational message"
208+ >No contributors recorded for this PO file.</p>
209+ </div>
210+ </div>
211+ </div>
212 </div>
213 </body>
214 </html>