Merge lp:~julian-edwards/launchpad/trivial-ui into lp:launchpad

Proposed by Julian Edwards
Status: Merged
Merged at revision: not available
Proposed branch: lp:~julian-edwards/launchpad/trivial-ui
Merge into: lp:launchpad
Diff against target: None lines
To merge this branch: bzr merge lp:~julian-edwards/launchpad/trivial-ui
Reviewer Review Type Date Requested Status
Barry Warsaw (community) ui* Approve
Guilherme Salgado (community) Approve
Review via email: mp+12063@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote :

= Summary =
Fix a bunch of trivial ui issues

== Proposed fix ==
 * https://bugs.edge.launchpad.net/bugs/328402 - show the ppa's signing key
fingerprint
 * https://bugs.edge.launchpad.net/soyuz/+bug/57559 - everything's already
fixed apart from the last item which is to change a heading
 * https://bugs.edge.launchpad.net/bugs/131515 - Fix inconsistent titles on
some package-related pages
 * https://bugs.edge.launchpad.net/bugs/237263 - add (pending) at the end of a
diff title's text if it's not ready to download yet

== Implementation details ==
Pretty trivial changes, I even removed some template code that was filling
heading slots!

== Tests ==
Loads involved. I already tested with -t stories -t pagetests -t doc and
everything passes.

== Demo and Q/A ==
Run this in "psql launchpad_dev" so cprov's PPA gets a signing key:
update archive set signing_key=1 where id=9;

https://launchpad.dev/ubuntu/warty/+source/mozilla-firefox/0.9
https://launchpad.dev/ubuntu/+source/mozilla-firefox/0.9
https://dogfood.launchpad.net/~cprov/+archive/ppa
https://dogfood.launchpad.net/~cprov/+archive/ppa/+packages

= 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/model/distributionsourcepackagerelease.py
  lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt
  lib/lp/soyuz/browser/distroseriessourcepackagerelease.py
  lib/lp/registry/browser/sourcepackage.py
  lib/lp/soyuz/templates/sourcepackagerelease-diffs.pt
  lib/lp/soyuz/stories/soyuz/xx-package-diff.txt
  lib/lp/soyuz/templates/distroseriessourcepackagerelease-index.pt
  lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt
  lib/lp/soyuz/templates/sourcepackagepublishinghistory-listing-archive-
extra.pt
  lib/lp/soyuz/templates/archive-index.pt
  lib/lp/soyuz/browser/distributionsourcepackagerelease.py
  lib/lp/soyuz/model/distroseriessourcepackagerelease.py
  lib/lp/soyuz/doc/package-meta-classes.txt
  lib/lp/soyuz/templates/distributionsourcepackagerelease-index.pt

== Pylint notices ==

lib/lp/soyuz/model/distributionsourcepackagerelease.py
    39: [F0401] Unable to import 'lazr.delegates' (No module named delegates)

lib/lp/soyuz/model/distroseriessourcepackagerelease.py
    27: [F0401] Unable to import 'lazr.delegates' (No module named delegates)

Revision history for this message
Guilherme Salgado (salgado) wrote :

The code looks good

review: Approve
Revision history for this message
Barry Warsaw (barry) wrote :

This page has incorrect headers:

https://launchpad.dev/~cprov/+archive/ppa/+packages

all the others look fine. It should be easy to fix that one, so conditional on that I'll approve the ui.

review: Approve (ui*)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/browser/sourcepackage.py'
2--- lib/lp/registry/browser/sourcepackage.py 2009-09-15 05:26:07 +0000
3+++ lib/lp/registry/browser/sourcepackage.py 2009-09-18 12:18:51 +0000
4@@ -72,7 +72,7 @@
5 """Builds a breadcrumb for an `ISourcePackage`."""
6 @property
7 def text(self):
8- return smartquote('"%s" package') % (self.context.name)
9+ return smartquote('"%s" source package') % (self.context.name)
10
11
12 class SourcePackageFacets(QuestionTargetFacetMixin, StandardLaunchpadFacets):
13@@ -161,7 +161,8 @@
14 @property
15 def page_title(self):
16 """The HTML page title."""
17- return '%s package' % self.context.name
18+ return smartquote('"%s" source package in %s') % (
19+ self.context.name, self.context.distroseries.title)
20
21 @property
22 def cancel_url(self):
23
24=== modified file 'lib/lp/soyuz/browser/distributionsourcepackagerelease.py'
25--- lib/lp/soyuz/browser/distributionsourcepackagerelease.py 2009-09-09 14:35:04 +0000
26+++ lib/lp/soyuz/browser/distributionsourcepackagerelease.py 2009-09-18 12:18:51 +0000
27@@ -23,6 +23,8 @@
28 IDistributionSourcePackageRelease)
29 from lp.soyuz.interfaces.publishing import PackagePublishingStatus
30
31+from canonical.lazr.utils import smartquote
32+
33
34 class DistributionSourcePackageReleaseNavigation(Navigation):
35 usedfor = IDistributionSourcePackageRelease
36@@ -45,8 +47,8 @@
37 usedfor = IDistributionSourcePackageRelease
38
39 @property
40- def page_title(self):
41- return self.context.title
42+ def label(self):
43+ return smartquote(self.context.title)
44
45 @cachedproperty
46 def _cached_publishing_history(self):
47
48=== modified file 'lib/lp/soyuz/browser/distroseriessourcepackagerelease.py'
49--- lib/lp/soyuz/browser/distroseriessourcepackagerelease.py 2009-06-25 04:06:00 +0000
50+++ lib/lp/soyuz/browser/distroseriessourcepackagerelease.py 2009-09-18 12:18:51 +0000
51@@ -12,6 +12,7 @@
52 IDistroSeriesSourcePackageRelease)
53 from canonical.launchpad.webapp import (
54 ApplicationMenu, Navigation, stepthrough)
55+from canonical.lazr.utils import smartquote
56
57
58 class DistroSeriesSourcePackageReleaseOverviewMenu(ApplicationMenu):
59@@ -50,3 +51,6 @@
60 self.context = context
61 self.request = request
62
63+ @property
64+ def label(self):
65+ return smartquote(self.context.title)
66
67=== modified file 'lib/lp/soyuz/doc/package-meta-classes.txt'
68--- lib/lp/soyuz/doc/package-meta-classes.txt 2009-07-23 17:49:31 +0000
69+++ lib/lp/soyuz/doc/package-meta-classes.txt 2009-09-18 12:18:51 +0000
70@@ -52,9 +52,11 @@
71 >>> verifyObject(IDistroSeriesSourcePackageRelease, drspr)
72 True
73
74- >>> drspr.displayname
75- u'pmount 0.1-1'
76+ >>> print drspr.displayname
77+ pmount 0.1-1
78
79+ >>> print drspr.title
80+ "pmount" 0.1-1 source package in The Hoary Hedgehog Release
81
82 == Querying builds for DistributionSPR and DistroSeriesSPR ==
83
84
85=== modified file 'lib/lp/soyuz/model/distributionsourcepackagerelease.py'
86--- lib/lp/soyuz/model/distributionsourcepackagerelease.py 2009-09-03 11:56:54 +0000
87+++ lib/lp/soyuz/model/distributionsourcepackagerelease.py 2009-09-18 12:18:51 +0000
88@@ -67,7 +67,7 @@
89 @property
90 def title(self):
91 """See IDistributionSourcePackageRelease."""
92- return '%s %s (source) in %s' % (
93+ return '"%s" %s source package in %s' % (
94 self.name, self.version, self.distribution.displayname)
95
96 @property
97
98=== modified file 'lib/lp/soyuz/model/distroseriessourcepackagerelease.py'
99--- lib/lp/soyuz/model/distroseriessourcepackagerelease.py 2009-06-25 04:06:00 +0000
100+++ lib/lp/soyuz/model/distroseriessourcepackagerelease.py 2009-09-18 12:18:51 +0000
101@@ -58,9 +58,8 @@
102 @property
103 def title(self):
104 """See `IDistroSeriesSourcePackageRelease`."""
105- return '%s %s (source) in %s %s' % (
106- self.name, self.version, self.distribution.name,
107- self.distroseries.name)
108+ return '"%s" %s source package in %s' % (
109+ self.name, self.version, self.distroseries.title)
110
111 @property
112 def version(self):
113
114=== modified file 'lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt'
115--- lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt 2009-09-15 08:06:17 +0000
116+++ lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt 2009-09-18 15:06:26 +0000
117@@ -540,6 +540,7 @@
118
119 >>> print extract_text(signing_key_section)
120 Signing key: 1024D/12345678 (What is this?)
121+ Fingerprint: ABCDEF0123456789ABCDDCBA0000111112345678
122
123 The key fingerprint links to the actual key available in the ubuntu
124 keyserver.
125
126=== modified file 'lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt'
127--- lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt 2009-09-10 22:08:36 +0000
128+++ lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt 2009-09-18 10:18:17 +0000
129@@ -231,8 +231,9 @@
130 `DistroSeriesBinaryPackage` page.
131
132 >>> print extract_text(
133- ... find_portlet(anon_browser.contents, 'Binary packages'))
134- Binary packages
135+ ... find_portlet(anon_browser.contents,
136+ ... 'Binary packages built by this source'))
137+ Binary packages built by this source
138 foo-bin:
139 No summary available for foo-bin in ubuntutest breezy-autotest.
140 No description available for foo-bin in ubuntutest breezy-autotest.
141@@ -263,7 +264,8 @@
142
143 >>> anon_browser.reload()
144 >>> print extract_text(
145- ... find_portlet(anon_browser.contents, 'Binary packages'))
146- Binary packages
147+ ... find_portlet(anon_browser.contents,
148+ ... 'Binary packages built by this source'))
149+ Binary packages built by this source
150 foo-bin: Foo app is great
151 Well ... it does nothing, though
152
153=== modified file 'lib/lp/soyuz/stories/soyuz/xx-package-diff.txt'
154--- lib/lp/soyuz/stories/soyuz/xx-package-diff.txt 2009-09-10 08:07:46 +0000
155+++ lib/lp/soyuz/stories/soyuz/xx-package-diff.txt 2009-09-18 11:12:22 +0000
156@@ -139,7 +139,7 @@
157 Pending in hoary-release
158 ...
159 Available diffs
160- 1.0-2 to 1.0-3
161+ 1.0-2 to 1.0-3 (pending)
162 ==============================
163 1.0-2
164 Pending in hoary-release
165@@ -156,7 +156,9 @@
166 >>> print anon_browser.getLink('1.0-1 to 1.0-2').url
167 http://.../biscuit_1.0-1_1.0-2.diff.gz
168
169-On the other hand, diffs not yet performed are rendered as plain text.
170+On the other hand, diffs not yet performed are rendered as plain text,
171+and "(pending)" is appended to the text as a further hint that it's not
172+ready yet.
173
174 >>> anon_browser.getLink('1.0-2 to 1.0-3')
175 Traceback (most recent call last):
176@@ -203,8 +205,12 @@
177 >>> login('foo.bar@canonical.com')
178 >>> biscuit_ppa = name16.archive.getPublishedSources()[0]
179 >>> biscuit_ppa_id = biscuit_ppa.id
180+ >>> diff_three.date_fulfilled = None
181+ >>> diff_three.status = PackageDiffStatus.PENDING
182 >>> logout()
183
184+The diff starts out as pending:
185+
186 >>> expander_url = anon_browser.getLink(
187 ... id='pub%s-expander' % biscuit_ppa_id).url
188 >>> anon_browser.open(expander_url)
189@@ -212,10 +218,25 @@
190 Publishing details
191 ...
192 Available diffs
193+ 1.0-3 (in Ubuntu) to 1.0-4 (pending)
194+ ...
195+
196+If we complete the diff, the text changes.
197+
198+ >>> login('foo.bar@canonical.com')
199+ >>> perform_fake_diff(diff_three, 'biscuit_1.0-3_1.0-4.diff.gz')
200+ >>> transaction.commit()
201+ >>> logout()
202+
203+ >>> anon_browser.open(expander_url)
204+ >>> print extract_text(anon_browser.contents)
205+ Publishing details
206+ ...
207+ Available diffs
208 1.0-3 (in Ubuntu) to 1.0-4 (3 bytes)
209 ...
210
211-The text also link to the librarian file containing the diff.
212+The text also links to the librarian file containing the diff.
213
214 >>> print anon_browser.getLink(
215 ... '1.0-3 (in Ubuntu) to 1.0-4').url
216
217=== modified file 'lib/lp/soyuz/templates/archive-index.pt'
218--- lib/lp/soyuz/templates/archive-index.pt 2009-09-17 11:35:39 +0000
219+++ lib/lp/soyuz/templates/archive-index.pt 2009-09-18 15:06:26 +0000
220@@ -113,6 +113,8 @@
221 (<a href="/+help/soyuz/ppa-sources-list.html"
222 target="help">What is this?</a>)
223 </dd>
224+ <dt>Fingerprint:</dt>
225+ <dd tal:content="signing_key/fingerprint"/>
226 </dl>
227 <div id="archive-dependencies"
228 tal:condition="context/dependencies">
229
230=== modified file 'lib/lp/soyuz/templates/distributionsourcepackagerelease-index.pt'
231--- lib/lp/soyuz/templates/distributionsourcepackagerelease-index.pt 2009-09-09 21:17:10 +0000
232+++ lib/lp/soyuz/templates/distributionsourcepackagerelease-index.pt 2009-09-18 12:18:51 +0000
233@@ -9,10 +9,6 @@
234
235 <body>
236
237-<div metal:fill-slot="heading">
238- <h1 tal:content="view/page_title">foo-bar 1.0 (source) in ubuntu</h1>
239-</div>
240-
241 <div metal:fill-slot="main">
242
243 <div id="source-changelog" class="top-portlet">
244@@ -170,7 +166,7 @@
245 </div> <!-- source-files -->
246
247 <div id="source-binaries" class="portlet">
248- <h2>Binary packages</h2>
249+ <h2>Binary packages built by this source</h2>
250 <div class="two-column-list">
251 <dl tal:repeat="binary context/sample_binary_packages">
252 <dt>
253
254=== modified file 'lib/lp/soyuz/templates/distroseriessourcepackagerelease-index.pt'
255--- lib/lp/soyuz/templates/distroseriessourcepackagerelease-index.pt 2009-09-07 11:40:40 +0000
256+++ lib/lp/soyuz/templates/distroseriessourcepackagerelease-index.pt 2009-09-18 12:18:51 +0000
257@@ -8,10 +8,6 @@
258 >
259 <body>
260
261-<div metal:fill-slot="heading">
262- <h1 tal:content="context/title"/>
263-</div>
264-
265 <div metal:fill-slot="main">
266
267 <div class="top-portlet">
268
269=== modified file 'lib/lp/soyuz/templates/sourcepackagepublishinghistory-listing-archive-extra.pt'
270--- lib/lp/soyuz/templates/sourcepackagepublishinghistory-listing-archive-extra.pt 2009-07-17 17:59:07 +0000
271+++ lib/lp/soyuz/templates/sourcepackagepublishinghistory-listing-archive-extra.pt 2009-09-18 11:12:22 +0000
272@@ -26,7 +26,7 @@
273 <tal:pending condition="not: diff/date_fulfilled">
274 <tal:pending-diff replace="diff/title">
275 1.0 (in Ubuntu) to 1.1
276- </tal:pending-diff>
277+ </tal:pending-diff> (pending)
278 </tal:pending>
279 <tal:fulfilled condition="diff/date_fulfilled">
280 <a tal:attributes="href diff/diff_content/http_url"
281
282=== modified file 'lib/lp/soyuz/templates/sourcepackagerelease-diffs.pt'
283--- lib/lp/soyuz/templates/sourcepackagerelease-diffs.pt 2009-07-17 17:59:07 +0000
284+++ lib/lp/soyuz/templates/sourcepackagerelease-diffs.pt 2009-09-18 11:12:22 +0000
285@@ -15,7 +15,7 @@
286 <tal:pending condition="not: diff/date_fulfilled">
287 <tal:pending-diff replace="diff/title">
288 1.0 (in Ubuntu) to 1.1
289- </tal:pending-diff>
290+ </tal:pending-diff> (pending)
291 </tal:pending>
292 <tal:fulfilled condition="diff/date_fulfilled">
293 <a tal:attributes="href diff/diff_content/http_url"