Merge lp://staging/~julian-edwards/launchpad/dsp-changelog-bug-419147 into lp://staging/launchpad

Proposed by Julian Edwards
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~julian-edwards/launchpad/dsp-changelog-bug-419147
Merge into: lp://staging/launchpad
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~julian-edwards/launchpad/dsp-changelog-bug-419147
Reviewer Review Type Date Requested Status
Gavin Panella (community) code Approve
Review via email: mp+10730@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote :

= Summary =
Add DistributionSourcePackage:+changelog

== Proposed fix ==
The current DSP page has a change log section at the bottom. As part of the
3.0 redesign, this is being moved to a separate page. This branch adds that
page ahead of the redesign.

== Implementation details ==
Note that the new page is not linked to yet, that will only happen in the
final redesign. When I land that branch, I will amend the XXX in the changed
test in this branch so it follows the link.

Otherwise, this is a pretty trivial change.

== Tests ==
bin/test -vvt xx-distribution-packages.txt

== Demo and Q/A ==
https://launchpad.dev/ubuntu/+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/registry/browser/configure.zcml
  lib/lp/registry/browser/distributionsourcepackage.py
  lib/lp/registry/stories/distribution/xx-distribution-packages.txt

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Because I am a numpty, I forgot to add the new template, its diff is here:

=== added file 'lib/lp/registry/templates/distributionsourcepackage-changelog.pt'
--- lib/lp/registry/templates/distributionsourcepackage-changelog.pt 1970-01-01 00:00:00 +0000
+++ lib/lp/registry/templates/distributionsourcepackage-changelog.pt 2009-08-26 11:08:27 +0000
@@ -0,0 +1,26 @@
+<html
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:tal="http://xml.zope.org/namespaces/tal"
+ xmlns:metal="http://xml.zope.org/namespaces/metal"
+ xmlns:i18n="http://xml.zope.org/namespaces/i18n"
+ metal:use-macro="view/macro:page/main_only"
+ i18n:domain="launchpad"
+>
+
+<body>
+<div metal:fill-slot="main">
+
+<div class="top-portlet">
+ <h1>
+ Version history
+ </h1>
+
+ <tal:block
+ repeat="dspr view/releases"
+ replace="structure dspr/@@+changes">
+ </tal:block>
+</div>
+
+</div>
+</body>
+</html>

Revision history for this message
Gavin Panella (allenap) wrote :

If you can, please add a bug= to the XXX. Other than that, it's perfect :)

review: Approve (code)

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-08-23 01:55:48 +0000
3+++ lib/lp/registry/browser/configure.zcml 2009-08-26 11:31:57 +0000
4@@ -488,13 +488,18 @@
5 module="lp.registry.browser.distributionsourcepackage"
6 classes="
7 DistributionSourcePackageNavigation"/>
8- <browser:page
9+ <browser:pages
10 for="lp.registry.interfaces.distributionsourcepackage.IDistributionSourcePackage"
11 class="lp.registry.browser.distributionsourcepackage.DistributionSourcePackageView"
12- permission="zope.Public"
13- name="+index"
14 facet="overview"
15- template="../templates/distributionsourcepackage-index.pt"/>
16+ permission="zope.Public">
17+ <browser:page
18+ name="+index"
19+ template="../templates/distributionsourcepackage-index.pt"/>
20+ <browser:page
21+ name="+changelog"
22+ template="../templates/distributionsourcepackage-changelog.pt"/>
23+ </browser:pages>
24 <browser:page
25 for="lp.registry.interfaces.distributionsourcepackage.IDistributionSourcePackage"
26 permission="launchpad.Edit"
27
28=== modified file 'lib/lp/registry/browser/distributionsourcepackage.py'
29--- lib/lp/registry/browser/distributionsourcepackage.py 2009-08-24 20:28:33 +0000
30+++ lib/lp/registry/browser/distributionsourcepackage.py 2009-08-26 12:06:40 +0000
31@@ -126,6 +126,10 @@
32
33 class DistributionSourcePackageView(LaunchpadFormView):
34
35+ @property
36+ def page_title(self):
37+ return self.context.title
38+
39 def setUpFields(self):
40 """See `LaunchpadFormView`."""
41 # No schema is set in this form, because all fields are created with
42
43=== modified file 'lib/lp/registry/stories/distribution/xx-distribution-packages.txt'
44--- lib/lp/registry/stories/distribution/xx-distribution-packages.txt 2009-07-10 12:45:54 +0000
45+++ lib/lp/registry/stories/distribution/xx-distribution-packages.txt 2009-08-26 12:05:05 +0000
46@@ -208,9 +208,14 @@
47 >>> link.text
48 "...more untrusted versions of..."
49
50-/$DISTRO/+source/$PACKAGE pages contain a version history that lists
51-each published version of a package with its changelog entry for that
52-version.
53+/$DISTRO/+source/$PACKAGE/+changelog pages contain a version history that lists
54+each published version of a package with its changelog entry for that version.
55+
56+XXX julian 2009-08-26
57+The +changelog page is currently NOT linked from +index. The index page is
58+currently undergoing a redesign and the link to it will be added therein.
59+Until then, +changelog is a hidden page, but needs to land ahead of that
60+redesign.
61
62 Each version history entry has a header with the version as the title
63 and details of the publishing status in each distroseries it's published
64@@ -218,16 +223,17 @@
65
66 Package "foobar" is deleted:
67
68- >>> browser.open("http://launchpad.dev/ubuntu/+source/foobar/")
69+ >>> browser.open("http://launchpad.dev/ubuntu/+source/foobar/+changelog")
70 >>> first_header = find_tag_by_id(browser.contents,
71 ... "detail_foobar_1.0")
72 >>> print extract_text(first_header)
73- 1.0
74+ 1.0
75 Deleted in warty-release on 2006-12-02 (Reason: I do not like it.)
76
77 Package "alsa-utils" is pending in Warty and published in Hoary:
78
79- >>> browser.open("http://launchpad.dev/ubuntu/+source/alsa-utils/")
80+ >>> browser.open(
81+ ... "http://launchpad.dev/ubuntu/+source/alsa-utils/+changelog")
82 >>> first_header = find_tag_by_id(browser.contents,
83 ... 'detail_alsa-utils_1.0.9a-4ubuntu1')
84 >>> print extract_text(first_header)
85@@ -264,7 +270,8 @@
86 If we view the same page as a logged-in user, we can see the email
87 address:
88
89- >>> user_browser.open("http://launchpad.dev/ubuntu/+source/alsa-utils/")
90+ >>> user_browser.open(
91+ ... "http://launchpad.dev/ubuntu/+source/alsa-utils/+changelog")
92 >>> print extract_text(find_tag_by_id(user_browser.contents,
93 ... 'body_alsa-utils_1.0.9a-4ubuntu1'))
94 alsa-utils (1.0.9a-4ubuntu1) hoary; urgency=low
95@@ -295,7 +302,8 @@
96 If the package being viewed has no publishing history, a blank table is
97 displayed:
98
99- >>> user_browser.open("http://launchpad.dev/ubuntu/+source/a52dec")
100+ >>> user_browser.open(
101+ ... "http://launchpad.dev/ubuntu/+source/a52dec/")
102 >>> print extract_text(find_tag_by_id(user_browser.contents, 'packaging'))
103 Ubuntu version Upstream version
104
105@@ -313,7 +321,7 @@
106 ... print extract_text(section.div)
107
108 >>> anon_browser.open(
109- ... "http://launchpad.dev/ubuntu/+source/alsa-utils/")
110+ ... "http://launchpad.dev/ubuntu/+source/alsa-utils/+changelog")
111
112 >>> print_displayed_versions(anon_browser.contents)
113 1.0.9a-4ubuntu1