← Back to team overview

launchpad-reviewers team mailing list archive

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

 

William Grant has proposed merging lp:~wgrant/launchpad/dsp-bugs-series-links into lp:launchpad.

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

Requested reviews:
  William Grant (wgrant): code
Related bugs:
  Bug #250767 in Launchpad itself: "the published versions on the right side of the bugs list should be clickable"
  https://bugs.launchpad.net/launchpad/+bug/250767

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/dsp-bugs-series-links/+merge/242737

Linkify the series and version information on DistributionSourcePackage:+bugs.
-- 
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== modified file 'lib/lp/registry/browser/distributionsourcepackage.py'
--- lib/lp/registry/browser/distributionsourcepackage.py	2014-11-25 05:54:32 +0000
+++ lib/lp/registry/browser/distributionsourcepackage.py	2014-11-25 06:38:20 +0000
@@ -56,7 +56,6 @@
     IDistributionSourcePackage,
     )
 from lp.registry.interfaces.person import IPersonSet
-from lp.registry.interfaces.pocket import pocketsuffix
 from lp.registry.interfaces.series import SeriesStatus
 from lp.services.database.decoratedresultset import DecoratedResultSet
 from lp.services.helpers import shortlist
@@ -323,27 +322,6 @@
         return canonical_url(self.context)
 
     @property
-    def all_published_in_active_distroseries(self):
-        """Return a list of publishings in each active distroseries.
-
-        The list contains dictionaries each with a key of "suite" and
-        "description" where suite is "distroseries-pocket" and
-        description is "(version): component/section".
-        """
-        results = []
-        for pub in self.context.current_publishing_records:
-            if pub.distroseries.active:
-                entry = {
-                    "suite": (pub.distroseries.name.capitalize() +
-                               pocketsuffix[pub.pocket]),
-                    "description": "(%s): %s/%s" % (
-                        pub.sourcepackagerelease.version,
-                        pub.component.name, pub.section.name),
-                    }
-                results.append(entry)
-        return results
-
-    @property
     def related_ppa_versions(self):
         """Return a list of the latest 3 ppas with related publishings.
 

=== modified file 'lib/lp/registry/browser/tests/distributionsourcepackage-views.txt'
--- lib/lp/registry/browser/tests/distributionsourcepackage-views.txt	2011-12-22 05:09:10 +0000
+++ lib/lp/registry/browser/tests/distributionsourcepackage-views.txt	2014-11-25 06:38:20 +0000
@@ -22,19 +22,6 @@
     ...     date_uploaded=datetime(2010, 12, 30, tzinfo=pytz.UTC),
     ...     status=PackagePublishingStatus.PUBLISHED)
 
-The DistributionSourcePackageView includes a helper property
-'all_published_in_active_distroseries' that returns a list of
-all the published versions of the source package within the distribution's
-series.
-
-    >>> ubuntu_gedit = ubuntutest.getSourcePackage('gedit')
-    >>> ubuntu_gedit_view = create_initialized_view(
-    ...     ubuntu_gedit, name='+index')
-    >>> for result in ubuntu_gedit_view.all_published_in_active_distroseries:
-    ...     print "%s - %s" % (
-    ...         result['suite'], result['description'])
-    Breezy-autotest - (666): main/base
-
 The view has an active_series property that provides a sorted list of active
 series.
 

=== modified file 'lib/lp/soyuz/stories/soyuz/xx-portlet-publishing-details.txt'
--- lib/lp/soyuz/stories/soyuz/xx-portlet-publishing-details.txt	2008-01-28 11:21:17 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-portlet-publishing-details.txt	2014-11-25 06:38:20 +0000
@@ -18,6 +18,13 @@
     Hoary (1.0.9a-4ubuntu1): main/base
     Warty (1.0.8-1ubuntu1): main/base
 
+Series and versions are linkified.
+
+    >>> print browser.getLink('Hoary').url
+    http://bugs.launchpad.dev/ubuntu/hoary/+source/alsa-utils
+    >>> print browser.getLink('1.0.9a-4').url
+    http://launchpad.dev/ubuntu/+source/alsa-utils/1.0.9a-4
+
 When a source package has never been published, the portlet will say so.
 
     >>> browser.open(

=== modified file 'lib/lp/soyuz/templates/distributionsourcepackage-portlet-pub-details.pt'
--- lib/lp/soyuz/templates/distributionsourcepackage-portlet-pub-details.pt	2012-11-21 07:19:09 +0000
+++ lib/lp/soyuz/templates/distributionsourcepackage-portlet-pub-details.pt	2014-11-25 06:38:20 +0000
@@ -7,24 +7,32 @@
   <h2>
     "<tal:name replace="context/name">apache2</tal:name>"
     versions published in
-    <tal:distribution replace="context/distribution/name/capitalize">
+    <tal:distribution replace="context/distribution/displayname">
       ubuntu
     </tal:distribution>
   </h2>
 
-  <div tal:define="cr context/currentrelease">
+  <div>
 
     <div tal:condition="not: context/current_publishing_records/is_empty">
-      <tal:block repeat="item view/all_published_in_active_distroseries">
-        <b><tal:suite replace="item/suite"/></b>
-        <tal:description replace="item/description"/>
-        <br/>
+      <tal:block repeat="pub context/current_publishing_records">
+        <tal:active condition="pub/distroseries/active">
+          <b>
+            <a tal:content="python:pub.distroseries.getSuite(pub.pocket).capitalize()"
+              tal:attributes="href pub/meta_sourcepackage/fmt:url:bugs">Warty</a>
+          </b>
+          (<a tal:content="pub/sourcepackagerelease/version"
+              tal:attributes="href pub/meta_distributionsourcepackagerelease/fmt:url"
+              >1.0</a>):
+          <tal:comp replace="pub/component/name">main</tal:comp>/<tal:sec replace="pub/section/name">admin</tal:sec>
+          <br/>
+        </tal:active>
       </tal:block>
     </div>
 
     <div tal:condition="context/current_publishing_records/is_empty">
       This source is not published in
-      <tal:name replace="context/distribution/name/capitalize"/>
+      <tal:name replace="context/distribution/displayname"/>
     </div>
 
   </div>


References