Merge lp:~wgrant/launchpad/dsp-bugs-series-links into lp:launchpad

Proposed by William Grant
Status: Merged
Approved by: William Grant
Approved revision: no longer in the source branch.
Merged at revision: 17258
Proposed branch: lp:~wgrant/launchpad/dsp-bugs-series-links
Merge into: lp:launchpad
Diff against target: 125 lines (+22/-42)
4 files modified
lib/lp/registry/browser/distributionsourcepackage.py (+0/-22)
lib/lp/registry/browser/tests/distributionsourcepackage-views.txt (+0/-13)
lib/lp/soyuz/stories/soyuz/xx-portlet-publishing-details.txt (+7/-0)
lib/lp/soyuz/templates/distributionsourcepackage-portlet-pub-details.pt (+15/-7)
To merge this branch: bzr merge lp:~wgrant/launchpad/dsp-bugs-series-links
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+242737@code.launchpad.net

Commit message

Linkify the series and version information on DistributionSourcePackage:+bugs.

Description of the change

Linkify the series and version information on DistributionSourcePackage:+bugs.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
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/distributionsourcepackage.py'
2--- lib/lp/registry/browser/distributionsourcepackage.py 2014-11-25 05:54:32 +0000
3+++ lib/lp/registry/browser/distributionsourcepackage.py 2014-11-25 06:38:20 +0000
4@@ -56,7 +56,6 @@
5 IDistributionSourcePackage,
6 )
7 from lp.registry.interfaces.person import IPersonSet
8-from lp.registry.interfaces.pocket import pocketsuffix
9 from lp.registry.interfaces.series import SeriesStatus
10 from lp.services.database.decoratedresultset import DecoratedResultSet
11 from lp.services.helpers import shortlist
12@@ -323,27 +322,6 @@
13 return canonical_url(self.context)
14
15 @property
16- def all_published_in_active_distroseries(self):
17- """Return a list of publishings in each active distroseries.
18-
19- The list contains dictionaries each with a key of "suite" and
20- "description" where suite is "distroseries-pocket" and
21- description is "(version): component/section".
22- """
23- results = []
24- for pub in self.context.current_publishing_records:
25- if pub.distroseries.active:
26- entry = {
27- "suite": (pub.distroseries.name.capitalize() +
28- pocketsuffix[pub.pocket]),
29- "description": "(%s): %s/%s" % (
30- pub.sourcepackagerelease.version,
31- pub.component.name, pub.section.name),
32- }
33- results.append(entry)
34- return results
35-
36- @property
37 def related_ppa_versions(self):
38 """Return a list of the latest 3 ppas with related publishings.
39
40
41=== modified file 'lib/lp/registry/browser/tests/distributionsourcepackage-views.txt'
42--- lib/lp/registry/browser/tests/distributionsourcepackage-views.txt 2011-12-22 05:09:10 +0000
43+++ lib/lp/registry/browser/tests/distributionsourcepackage-views.txt 2014-11-25 06:38:20 +0000
44@@ -22,19 +22,6 @@
45 ... date_uploaded=datetime(2010, 12, 30, tzinfo=pytz.UTC),
46 ... status=PackagePublishingStatus.PUBLISHED)
47
48-The DistributionSourcePackageView includes a helper property
49-'all_published_in_active_distroseries' that returns a list of
50-all the published versions of the source package within the distribution's
51-series.
52-
53- >>> ubuntu_gedit = ubuntutest.getSourcePackage('gedit')
54- >>> ubuntu_gedit_view = create_initialized_view(
55- ... ubuntu_gedit, name='+index')
56- >>> for result in ubuntu_gedit_view.all_published_in_active_distroseries:
57- ... print "%s - %s" % (
58- ... result['suite'], result['description'])
59- Breezy-autotest - (666): main/base
60-
61 The view has an active_series property that provides a sorted list of active
62 series.
63
64
65=== modified file 'lib/lp/soyuz/stories/soyuz/xx-portlet-publishing-details.txt'
66--- lib/lp/soyuz/stories/soyuz/xx-portlet-publishing-details.txt 2008-01-28 11:21:17 +0000
67+++ lib/lp/soyuz/stories/soyuz/xx-portlet-publishing-details.txt 2014-11-25 06:38:20 +0000
68@@ -18,6 +18,13 @@
69 Hoary (1.0.9a-4ubuntu1): main/base
70 Warty (1.0.8-1ubuntu1): main/base
71
72+Series and versions are linkified.
73+
74+ >>> print browser.getLink('Hoary').url
75+ http://bugs.launchpad.dev/ubuntu/hoary/+source/alsa-utils
76+ >>> print browser.getLink('1.0.9a-4').url
77+ http://launchpad.dev/ubuntu/+source/alsa-utils/1.0.9a-4
78+
79 When a source package has never been published, the portlet will say so.
80
81 >>> browser.open(
82
83=== modified file 'lib/lp/soyuz/templates/distributionsourcepackage-portlet-pub-details.pt'
84--- lib/lp/soyuz/templates/distributionsourcepackage-portlet-pub-details.pt 2012-11-21 07:19:09 +0000
85+++ lib/lp/soyuz/templates/distributionsourcepackage-portlet-pub-details.pt 2014-11-25 06:38:20 +0000
86@@ -7,24 +7,32 @@
87 <h2>
88 "<tal:name replace="context/name">apache2</tal:name>"
89 versions published in
90- <tal:distribution replace="context/distribution/name/capitalize">
91+ <tal:distribution replace="context/distribution/displayname">
92 ubuntu
93 </tal:distribution>
94 </h2>
95
96- <div tal:define="cr context/currentrelease">
97+ <div>
98
99 <div tal:condition="not: context/current_publishing_records/is_empty">
100- <tal:block repeat="item view/all_published_in_active_distroseries">
101- <b><tal:suite replace="item/suite"/></b>
102- <tal:description replace="item/description"/>
103- <br/>
104+ <tal:block repeat="pub context/current_publishing_records">
105+ <tal:active condition="pub/distroseries/active">
106+ <b>
107+ <a tal:content="python:pub.distroseries.getSuite(pub.pocket).capitalize()"
108+ tal:attributes="href pub/meta_sourcepackage/fmt:url:bugs">Warty</a>
109+ </b>
110+ (<a tal:content="pub/sourcepackagerelease/version"
111+ tal:attributes="href pub/meta_distributionsourcepackagerelease/fmt:url"
112+ >1.0</a>):
113+ <tal:comp replace="pub/component/name">main</tal:comp>/<tal:sec replace="pub/section/name">admin</tal:sec>
114+ <br/>
115+ </tal:active>
116 </tal:block>
117 </div>
118
119 <div tal:condition="context/current_publishing_records/is_empty">
120 This source is not published in
121- <tal:name replace="context/distribution/name/capitalize"/>
122+ <tal:name replace="context/distribution/displayname"/>
123 </div>
124
125 </div>