Merge lp://staging/~julian-edwards/launchpad/dsspr-30 into lp://staging/launchpad

Proposed by Julian Edwards
Status: Merged
Approved by: Eleanor Berger
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp://staging/~julian-edwards/launchpad/dsspr-30
Merge into: lp://staging/launchpad
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~julian-edwards/launchpad/dsspr-30
Reviewer Review Type Date Requested Status
Michael Nelson (community) ui Approve
Eleanor Berger (community) Approve
Review via email: mp+11305@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote :

= Summary =
Convert the distroseriessourcepackagerelease page to 3.0

== Implementation details ==
I moved 2 of the side portlets into the main page, and threw away the
"details" portlet as it's pretty useless, and make far more sense on the
distro sourcepackage page instead.

I fixed some sprite icons (which broke tests, so I fixed those too by using a
getLink instead of printing raw html in the test).

I remove some unnecessary page loads in the test, which were just checking the
target's url, and renamed the test so it reflects our current nomenclature.

Please note that the template is filling in the heading slot. This should not
be necessary but Barry has not landed his "headings" branch yet. We have
other converted pages that should not be doing this, so I will fix them en-
masse after he lands his branch.

== Tests ==
bin/test -vvct xx-distroseries-sources.txt

== Demo and Q/A ==
Our sample data is rubbish, so I set this up on dogfood:
https://dogfood.launchpad.net/ubuntu/hardy/+source/amarok/2:1.4.9.1-0ubuntu3

See the old page here for comparison:
https://edge.launchpad.net/ubuntu/hardy/+source/amarok/2:1.4.9.1-0ubuntu3

= 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/soyuz/stories/soyuz/xx-distroseries-sources.txt
  lib/lp/soyuz/templates/distroseriessourcepackagerelease-index.pt
  lib/lp/soyuz/templates/sourcepackagerelease-files.pt
  lib/lp/soyuz/templates/sourcepackagerelease-portlet-distroseries.pt

Revision history for this message
Eleanor Berger (intellectronica) wrote :

r=me
ui=me

review: Approve
Revision history for this message
Michael Nelson (michael.nelson) wrote :

Thanks Julian! Nothing to add (we discussed the possible length of the builds not being an issue, as it's always one per arch :) ).

review: Approve (ui)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== renamed file 'lib/lp/soyuz/stories/soyuz/xx-distrorelease-sources.txt' => 'lib/lp/soyuz/stories/soyuz/xx-distroseries-sources.txt'
2--- lib/lp/soyuz/stories/soyuz/xx-distrorelease-sources.txt 2009-08-26 15:24:40 +0000
3+++ lib/lp/soyuz/stories/soyuz/xx-distroseries-sources.txt 2009-09-07 13:26:02 +0000
4@@ -99,15 +99,11 @@
5 The user can also download the files for the "currentrelease" (last
6 published version) if they are available:
7
8- >>> print find_tag_by_id(browser.contents, 'files')
9- <div id="files">
10- <ul class="download">
11- <li>
12- <a href="/ubuntu/warty/+source/mozilla-firefox/0.9/+files/firefox-0.9.2.orig.tar.gz">firefox-0.9.2.orig.tar.gz</a>
13- (9.5 MiB)
14- </li>
15- </ul>
16- </div>
17+ >>> print extract_text(find_tag_by_id(browser.contents, 'files'))
18+ firefox-0.9.2.orig.tar.gz (9.5 MiB)
19+
20+ >>> print browser.getLink("firefox-0.9.2.orig.tar.gz").url
21+ http://launchpad.dev/ubuntu/warty/+source/mozilla-firefox/0.9/+files/firefox-0.9.2.orig.tar.gz
22
23 This page also provides links to the binary packages generated by this
24 source in a specfic architecture:
25@@ -123,9 +119,8 @@
26 Let's check the link to the binary package built on i386 architecture,
27 a DistroArchSeriesBinaryPackage:
28
29- >>> browser.getLink("i386").click()
30- >>> browser.url
31- 'http://launchpad.dev/ubuntu/warty/i386/mozilla-firefox'
32+ >>> print browser.getLink("i386").url
33+ http://launchpad.dev/ubuntu/warty/i386/mozilla-firefox
34
35 More information about this page can be found at
36 17-distroarchseries-binpackages.txt.
37@@ -249,15 +244,11 @@
38 And also download the files contained in this source, like '.orig',
39 '.diff' and the DSC:
40
41- >>> print find_tag_by_id(browser.contents, 'files')
42- <div id="files">
43- <ul class="download">
44- <li>
45- <a href="/ubuntu/warty/+source/mozilla-firefox/0.9/+files/firefox-0.9.2.orig.tar.gz">firefox-0.9.2.orig.tar.gz</a>
46- (9.5 MiB)
47- </li>
48- </ul>
49- </div>
50+ >>> print extract_text(find_tag_by_id(browser.contents, 'files'))
51+ firefox-0.9.2.orig.tar.gz (9.5 MiB)
52+
53+ >>> print browser.getLink("firefox-0.9.2.orig.tar.gz").url
54+ http://launchpad.dev/ubuntu/warty/+source/mozilla-firefox/0.9/+files/firefox-0.9.2.orig.tar.gz
55
56 If we go to the same page for alsa-utils, the changelog has text that is
57 linkified.
58@@ -329,15 +320,17 @@
59 The user can also download the files for the "currentrelease" (last
60 published version) if they are available:
61
62- >>> print find_tag_by_id(browser.contents, 'files')
63- <div id="files">
64- ...
65- <a href="/ubuntu/breezy-autotest/+source/commercialpackage/1.0-1/+files/commercialpackage_1.0.orig.tar.gz">commercialpackage_1.0.orig.tar.gz</a>
66- ...
67- <a href="/ubuntu/breezy-autotest/+source/commercialpackage/1.0-1/+files/commercialpackage_1.0-1.diff.gz">commercialpackage_1.0-1.diff.gz</a>
68- ...
69- <a href="/ubuntu/breezy-autotest/+source/commercialpackage/1.0-1/+files/commercialpackage_1.0-1.dsc">commercialpackage_1.0-1.dsc</a>
70- ...
71+ >>> print extract_text(find_tag_by_id(browser.contents, 'files'))
72+ commercialpackage_1.0.orig.tar.gz (179 bytes)
73+ commercialpackage_1.0-1.diff.gz (610 bytes)
74+ commercialpackage_1.0-1.dsc (567 bytes)
75+
76+ >>> print browser.getLink("commercialpackage_1.0.orig.tar.gz").url
77+ http://launchpad.dev/ubuntu/breezy-autotest/+source/commercialpackage/1.0-1/+files/commercialpackage_1.0.orig.tar.gz
78+ >>> print browser.getLink("commercialpackage_1.0-1.diff.gz").url
79+ http://launchpad.dev/ubuntu/breezy-autotest/+source/commercialpackage/1.0-1/+files/commercialpackage_1.0-1.diff.gz
80+ >>> print browser.getLink("commercialpackage_1.0-1.dsc").url
81+ http://launchpad.dev/ubuntu/breezy-autotest/+source/commercialpackage/1.0-1/+files/commercialpackage_1.0-1.dsc
82
83 This page also provides links to the binary packages generated by this
84 source in a specfic architecture:
85@@ -348,20 +341,12 @@
86 Let's check the link to the binary package built on i386 architecture,
87 a DistroArchSeriesBinaryPackage:
88
89- >>> browser.getLink("i386").click()
90- >>> browser.url
91- 'http://launchpad.dev/ubuntu/breezy-autotest/i386/commercialpackage'
92+ >>> print browser.getLink("i386").url
93+ http://launchpad.dev/ubuntu/breezy-autotest/i386/commercialpackage
94
95 More information about this page can be found at
96 17-distroarchseries-binpackages.txt.
97
98-Move back to the SourcePackage page to continue the tests:
99-
100- >>> browser.open(
101- ... "http://launchpad.dev/ubuntu/breezy-autotest/+source/"
102- ... "commercialpackage")
103-
104-
105 The '+changelog' page provides an aggregation of the changelogs for
106 SourcePackageReleases published in this DistroSeries.
107
108@@ -416,15 +401,17 @@
109 And also download the files contained in this source, like '.orig',
110 '.diff' and the DSC:
111
112- >>> print find_tag_by_id(browser.contents, 'files')
113- <div id="files">
114- ...
115- <a href="/ubuntu/breezy-autotest/+source/commercialpackage/1.0-1/+files/commercialpackage_1.0.orig.tar.gz">commercialpackage_1.0.orig.tar.gz</a>
116- ...
117- <a href="/ubuntu/breezy-autotest/+source/commercialpackage/1.0-1/+files/commercialpackage_1.0-1.diff.gz">commercialpackage_1.0-1.diff.gz</a>
118- ...
119- <a href="/ubuntu/breezy-autotest/+source/commercialpackage/1.0-1/+files/commercialpackage_1.0-1.dsc">commercialpackage_1.0-1.dsc</a>
120- ...
121+ >>> print extract_text(find_tag_by_id(browser.contents, 'files'))
122+ commercialpackage_1.0.orig.tar.gz (179 bytes)
123+ commercialpackage_1.0-1.diff.gz (610 bytes)
124+ commercialpackage_1.0-1.dsc (567 bytes)
125+
126+ >>> print browser.getLink("commercialpackage_1.0.orig.tar.gz").url
127+ http://launchpad.dev/ubuntu/breezy-autotest/+source/commercialpackage/1.0-1/+files/commercialpackage_1.0.orig.tar.gz
128+ >>> print browser.getLink("commercialpackage_1.0-1.diff.gz").url
129+ http://launchpad.dev/ubuntu/breezy-autotest/+source/commercialpackage/1.0-1/+files/commercialpackage_1.0-1.diff.gz
130+ >>> print browser.getLink("commercialpackage_1.0-1.dsc").url
131+ http://launchpad.dev/ubuntu/breezy-autotest/+source/commercialpackage/1.0-1/+files/commercialpackage_1.0-1.dsc
132
133
134 == Tracing copied sources ==
135
136=== modified file 'lib/lp/soyuz/templates/distroseriessourcepackagerelease-index.pt'
137--- lib/lp/soyuz/templates/distroseriessourcepackagerelease-index.pt 2009-07-17 17:59:07 +0000
138+++ lib/lp/soyuz/templates/distroseriessourcepackagerelease-index.pt 2009-09-07 11:40:40 +0000
139@@ -3,24 +3,18 @@
140 xmlns:tal="http://xml.zope.org/namespaces/tal"
141 xmlns:metal="http://xml.zope.org/namespaces/metal"
142 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
143- xml:lang="en"
144- lang="en"
145- dir="ltr"
146- metal:use-macro="context/@@main_template/master"
147+ metal:use-macro="view/macro:page/main_only"
148 i18n:domain="launchpad"
149 >
150 <body>
151
152-<metal:portlets fill-slot="portlets">
153- <div tal:replace="structure context/sourcepackagerelease/@@+portlet-distroseries" />
154- <div tal:replace="structure context/@@+portlet-builds" />
155- <div tal:replace="structure context/@@+portlet-details" />
156-</metal:portlets>
157+<div metal:fill-slot="heading">
158+ <h1 tal:content="context/title"/>
159+</div>
160
161 <div metal:fill-slot="main">
162
163- <h1 tal:content="context/title" />
164-
165+ <div class="top-portlet">
166 <h2>Publishing history</h2>
167
168 <div id="publishing_history">
169@@ -28,15 +22,28 @@
170 replace="structure publishing/@@+listing-detailed">
171 </tal:block>
172 </div>
173-
174- <h2>Download</h2>
175-
176- <div id="files" tal:content="structure context/sourcepackagerelease/@@+files" />
177-
178- <h2>Changelog</h2>
179-
180- <tal:pre
181- replace="structure context/sourcepackagerelease/@@+changelog" />
182+ </div>
183+
184+ <div class="yui-g">
185+
186+ <div class="first yui-u">
187+ <div tal:replace="structure context/sourcepackagerelease/@@+portlet-distroseries" />
188+ <div class="portlet">
189+ <h2>Download</h2>
190+ <div id="files"
191+ tal:content="structure context/sourcepackagerelease/@@+files" />
192+ </div>
193+ </div>
194+
195+ <div class="yui-u" tal:content="structure context/@@+portlet-builds" />
196+
197+ </div>
198+
199+ <div class="portlet">
200+ <h2>Changelog</h2>
201+ <tal:pre
202+ replace="structure context/sourcepackagerelease/@@+changelog" />
203+ </div>
204
205 <div id="changesfile" tal:define="changesfile context/changesfile">
206 <p tal:condition="changesfile">
207
208=== modified file 'lib/lp/soyuz/templates/sourcepackagerelease-files.pt'
209--- lib/lp/soyuz/templates/sourcepackagerelease-files.pt 2009-07-17 17:59:07 +0000
210+++ lib/lp/soyuz/templates/sourcepackagerelease-files.pt 2009-09-07 11:40:40 +0000
211@@ -5,7 +5,8 @@
212 omit-tag="">
213 <ul class="download" tal:condition="context/files">
214 <li tal:repeat="file context/files">
215- <a tal:content="file/libraryfile/filename"
216+ <a class="sprite"
217+ tal:content="file/libraryfile/filename"
218 tal:attributes="href string:${context/fmt:url}/+files/${file/libraryfile/filename}" />
219 (<span tal:replace="file/libraryfile/content/filesize/fmt:bytes" />)
220 </li>
221
222=== modified file 'lib/lp/soyuz/templates/sourcepackagerelease-portlet-distroseries.pt'
223--- lib/lp/soyuz/templates/sourcepackagerelease-portlet-distroseries.pt 2009-07-17 17:59:07 +0000
224+++ lib/lp/soyuz/templates/sourcepackagerelease-portlet-distroseries.pt 2009-09-07 11:40:40 +0000
225@@ -13,7 +13,7 @@
226 <ul tal:condition="context/current_publishings">
227 <li class="package-source"
228 tal:repeat="drspr context/current_publishings">
229- <a tal:attributes="href drspr/fmt:url">
230+ <a class="sprite" tal:attributes="href drspr/fmt:url">
231 <span tal:replace="drspr/distribution/name">ubuntu</span>
232 <span tal:replace="drspr/distroseries/name">hoary</span>
233 </a>