Merge lp://staging/~julian-edwards/launchpad/sp-changelog-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/sp-changelog-30
Merge into: lp://staging/launchpad
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~julian-edwards/launchpad/sp-changelog-30
Reviewer Review Type Date Requested Status
Michael Nelson (community) ui Approve
Eleanor Berger (community) Approve
Review via email: mp+11311@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote :

= Summary =
Convert source package change logs page to 3.0

== Implementation details ==
Fairly mundane conversion. I had to split up the view into a separate class
for this page so that I could implement a "label" property specific to this
page. This isn't strictly necessary right now but when Barry's headings
branch lands it will be used, and I can remove the explicit <h1> in the
template. That will be done en-masse along with all the other pages that
currently do this.

While I was in the zcml, I changed the location of two templates
(productseries-packaging.pt and sourcepackage-packaging.pt) which should
belong to Registry, not Soyuz, as they deal with upstream packaging linkage.

== Tests ==
bin/test -vvct xx-sourcepackage-changelog.txt

== Demo and Q/A ==
See https://launchpad.dev/ubuntu/hoary/+source/alsa-utils/+changelog

= 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-sourcepackage-changelog.txt
  lib/lp/registry/browser/configure.zcml
  lib/lp/soyuz/browser/sourcepackage.py
  lib/lp/soyuz/browser/configure.zcml
  lib/lp/soyuz/templates/sourcepackage-changelog.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 :

Muuch improved h1 :), other than that, purely mechanical.

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/configure.zcml'
2--- lib/lp/registry/browser/configure.zcml 2009-09-05 02:36:10 +0000
3+++ lib/lp/registry/browser/configure.zcml 2009-09-07 09:20:57 +0000
4@@ -1606,6 +1606,13 @@
5 template="../templates/productseries-table-releases.pt"/>
6 </browser:pages>
7 <browser:page
8+ name="+addpackage"
9+ for="lp.registry.interfaces.productseries.IProductSeries"
10+ class="canonical.launchpad.browser.PackagingAddView"
11+ facet="overview"
12+ permission="launchpad.Edit"
13+ template="../templates/productseries-packaging.pt"/>
14+ <browser:page
15 name="+ubuntupkg"
16 facet="overview"
17 template="../templates/productseries-ubuntupkg.pt"
18@@ -1972,6 +1979,10 @@
19 name="+gethelp"
20 facet="answers"
21 template="../templates/sourcepackage-gethelp.pt"/>
22+ <browser:page
23+ name="+packaging"
24+ facet="overview"
25+ template="../templates/sourcepackage-packaging.pt"/>
26 <!-- SourcePackage Portlets -->
27 <browser:page
28 name="+portlet-details"
29
30=== renamed file 'lib/lp/soyuz/templates/productseries-packaging.pt' => 'lib/lp/registry/templates/productseries-packaging.pt'
31=== renamed file 'lib/lp/soyuz/templates/sourcepackage-packaging.pt' => 'lib/lp/registry/templates/sourcepackage-packaging.pt'
32=== modified file 'lib/lp/soyuz/browser/configure.zcml'
33--- lib/lp/soyuz/browser/configure.zcml 2009-09-04 12:06:54 +0000
34+++ lib/lp/soyuz/browser/configure.zcml 2009-09-07 09:20:57 +0000
35@@ -667,13 +667,6 @@
36 name="+queue"
37 template="../templates/distroseries-queue.pt"/>
38 <browser:page
39- name="+addpackage"
40- for="lp.registry.interfaces.productseries.IProductSeries"
41- class="canonical.launchpad.browser.PackagingAddView"
42- facet="overview"
43- permission="launchpad.Edit"
44- template="../templates/productseries-packaging.pt"/>
45- <browser:page
46 name="+activate-ppa"
47 for="lp.registry.interfaces.person.IPerson"
48 facet="overview"
49@@ -713,19 +706,14 @@
50 permission="zope.Public"
51 name="+portlet-ppa-architectures"
52 template="../templates/distribution-portlet-ppa-architectures.pt"/>
53- <browser:pages
54+ <browser:page
55 for="lp.registry.interfaces.sourcepackage.ISourcePackage"
56+ class=
57+ "lp.soyuz.browser.sourcepackage.SourcePackageChangelogView"
58 permission="zope.Public"
59- class="lp.registry.browser.sourcepackage.SourcePackageView">
60- <browser:page
61- name="+packaging"
62- facet="overview"
63- template="../templates/sourcepackage-packaging.pt"/>
64- <browser:page
65- name="+changelog"
66- facet="overview"
67- template="../templates/sourcepackage-changelog.pt"/>
68- </browser:pages>
69+ name="+changelog"
70+ facet="overview"
71+ template="../templates/sourcepackage-changelog.pt"/>
72 <browser:pages
73 for="lp.registry.interfaces.sourcepackage.ISourcePackage"
74 permission="zope.Public"
75
76=== added file 'lib/lp/soyuz/browser/sourcepackage.py'
77--- lib/lp/soyuz/browser/sourcepackage.py 1970-01-01 00:00:00 +0000
78+++ lib/lp/soyuz/browser/sourcepackage.py 2009-09-07 14:23:49 +0000
79@@ -0,0 +1,21 @@
80+# Copyright 2009 Canonical Ltd. This software is licensed under the
81+# GNU Affero General Public License version 3 (see the file LICENSE).
82+
83+"""Browser views for source package builds."""
84+
85+__metaclass__ = type
86+
87+__all__ = [
88+ 'SourcePackageChangelogView',
89+ ]
90+
91+from canonical.lazr.utils import smartquote
92+
93+
94+class SourcePackageChangelogView:
95+ """View class for source package change logs."""
96+
97+ @property
98+ def label(self):
99+ """<h1> for the change log page."""
100+ return smartquote("Change logs for " + self.context.title)
101
102=== modified file 'lib/lp/soyuz/stories/soyuz/xx-sourcepackage-changelog.txt'
103--- lib/lp/soyuz/stories/soyuz/xx-sourcepackage-changelog.txt 2009-06-16 16:15:38 +0000
104+++ lib/lp/soyuz/stories/soyuz/xx-sourcepackage-changelog.txt 2009-09-07 14:43:38 +0000
105@@ -5,8 +5,9 @@
106 >>> user_browser.open(
107 ... "http://launchpad.dev/ubuntu/hoary/+source/pmount/+changelog")
108 >>> print extract_text(find_main_content(user_browser.contents))
109- pmount in Ubuntu Hoary change logs
110- Change logs for this package:
111+ pmount in Ubuntu Hoary
112+ ...
113+ Change logs for pmount in Ubuntu Hoary
114 This is a placeholder changelog for pmount 0.1-2
115 pmount (0.1-1) hoary; urgency=low
116 * Fix description (Malone #1)
117@@ -19,8 +20,9 @@
118 >>> user_browser.open(
119 ... "http://launchpad.dev/ubuntu/hoary/+source/alsa-utils/+changelog")
120 >>> print extract_text(find_main_content(user_browser.contents))
121- alsa-utils in Ubuntu Hoary change logs
122- Change logs for this package:
123+ alsa-utils in Ubuntu Hoary
124+ ...
125+ Change logs for alsa-utils in Ubuntu Hoary
126 alsa-utils (1.0.9a-4ubuntu1) hoary; urgency=low
127 * Placeholder
128 LP: #10
129@@ -62,7 +64,7 @@
130 >>> anon_browser.open(
131 ... "http://launchpad.dev/ubuntu/hoary/+source/alsa-utils/+changelog")
132 >>> print extract_text(find_main_content(anon_browser.contents))
133- alsa-utils in Ubuntu Hoary change logs
134+ alsa-utils in Ubuntu Hoary
135 ...
136 -- Sample Person &lt;email address hidden&gt; Tue, 7 Feb 2006 12:10:08 +0300
137 alsa-utils (1.0.9a-4) warty; urgency=low
138
139=== modified file 'lib/lp/soyuz/templates/sourcepackage-changelog.pt'
140--- lib/lp/soyuz/templates/sourcepackage-changelog.pt 2009-07-17 17:59:07 +0000
141+++ lib/lp/soyuz/templates/sourcepackage-changelog.pt 2009-09-07 14:23:49 +0000
142@@ -3,21 +3,16 @@
143 xmlns:tal="http://xml.zope.org/namespaces/tal"
144 xmlns:metal="http://xml.zope.org/namespaces/metal"
145 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
146- xml:lang="en"
147- lang="en"
148- dir="ltr"
149- metal:use-macro="context/@@main_template/master"
150+ metal:use-macro="view/macro:page/main_only"
151 i18n:domain="launchpad"
152 >
153
154 <body>
155
156 <div metal:fill-slot="main">
157-
158- <h1><span tal:replace="context/title"/> change logs</h1>
159+ <h1 tal:content="view/label"/>
160
161 <tal:block condition="context/distinctreleases">
162- <p>Change logs for this package:</p>
163
164 <div id="changelogs">
165 <ul tal:condition="context/distinctreleases">
166@@ -25,7 +20,7 @@
167 <div tal:replace="structure spr/@@+changelog"/>
168 </li>
169 </ul>
170- <p tal:condition="not: context/distinctreleases"
171+ <p tal:condition="not: context/distinctreleases"
172 class="informational message">
173 There are no change logs associated with this source package.
174 </p>
175@@ -33,12 +28,6 @@
176
177 </tal:block>
178
179-
180 </div>
181- <p metal:fill-slot="help">
182- The change log is uploaded by the package maintainer when a new
183- package release is made. It should document all the latest information
184- we have for this release of the package.
185- </p>
186 </body>
187 </html>