Comment 2 for bug 364712

Revision history for this message
Deryck Hodge (deryck) wrote :

We should get this in our 3.0 UI updates. It's fairly easy to fix.

The following quickly-hacked-out and not-quite-perfect patch gets much of the way there:

=== modified file 'lib/lp/bugs/browser/bugtarget.py'
--- lib/lp/bugs/browser/bugtarget.py 2009-07-27 14:14:53 +0000
+++ lib/lp/bugs/browser/bugtarget.py 2009-08-14 15:05:20 +0000
@@ -1139,11 +1139,13 @@

         series_buglistings = []
         for series in serieses:
- series_buglistings.append(
- dict(
- title=series.name,
- url=canonical_url(series) + "/+bugs",
- count=series.open_bugtasks.count()))
+ series_bug_count = series.open_bugtasks.count()
+ if series_bug_count:
+ series_buglistings.append(
+ dict(
+ title=series.name,
+ url=canonical_url(series) + "/+bugs",
+ count=series_bug_count))

         return series_buglistings

=== modified file 'lib/lp/bugs/templates/bugtask-portlet-seriesbugs.pt'
--- lib/lp/bugs/templates/bugtask-portlet-seriesbugs.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/bugs/templates/bugtask-portlet-seriesbugs.pt 2009-08-14 15:11:39 +0000
@@ -3,7 +3,8 @@
   xmlns:metal="http://xml.zope.org/namespaces/metal"
   xmlns:i18n="http://xml.zope.org/namespaces/i18n"
   class="portlet" id="portlet-release-critical-bugs"
- tal:define="series_buglistings view/series_buglistings">
+ tal:define="series_buglistings view/series_buglistings"
+ tal:condition="series_buglistings">

   <h2>Series-targeted bugs</h2>