← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/external-bugs into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/external-bugs into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #900603 in Launchpad itself: "+bugs doesn't guide users into configuring their bugtracker"
  https://bugs.launchpad.net/launchpad/+bug/900603

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/external-bugs/+merge/84561

This branch follows up <https://code.launchpad.net/~abentley/launchpad/remove-hot-bugs/+merge/84503>, fixing some usability regressions and removing dead code.

In that branch, +bugs replaced +bugs-index as the default Bugs facet view for products, distributions, and more. +bugs-index provided a link to enable LP bug tracking if it wasn't already enabled, but +bugs just tells the user that LP doesn't know where the bugs are tracked. This leaves them at a dead end unless they think to go back to the Overview and find the configuration link there.

I've moved the non-LP help stuff from +bugs-index to +bugs, updated all +bugs-index tests to test +bugs instead, removed the bits that tested the late "Hot bugs" list, and then deleted +bugs-index.
-- 
https://code.launchpad.net/~wgrant/launchpad/external-bugs/+merge/84561
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/external-bugs into lp:launchpad.
=== modified file 'lib/lp/bugs/browser/bugtarget.py'
--- lib/lp/bugs/browser/bugtarget.py	2011-12-04 03:43:29 +0000
+++ lib/lp/bugs/browser/bugtarget.py	2011-12-06 04:48:26 +0000
@@ -10,7 +10,6 @@
     "BugsPatchesView",
     "BugTargetBugListingView",
     "BugTargetBugTagsView",
-    "BugTargetBugsView",
     "FileBugAdvancedView",
     "FileBugGuidedView",
     "FileBugViewBase",
@@ -56,13 +55,7 @@
 
 from canonical.config import config
 from canonical.launchpad import _
-from canonical.launchpad.browser.feeds import (
-    BugFeedLink,
-    BugTargetLatestBugsFeedLink,
-    FeedsMixin,
-    )
 from canonical.launchpad.browser.librarian import ProxiedLibraryFileAlias
-from canonical.launchpad.searchbuilder import any
 from canonical.launchpad.webapp import (
     canonical_url,
     LaunchpadView,
@@ -81,7 +74,6 @@
     safe_action,
     )
 from lp.app.browser.stringformatter import FormattersAPI
-from lp.app.browser.tales import BugTrackerFormatterAPI
 from lp.app.enums import ServiceUsage
 from lp.app.errors import (
     NotFoundError,
@@ -90,7 +82,6 @@
 from lp.app.interfaces.launchpad import (
     ILaunchpadCelebrities,
     ILaunchpadUsage,
-    IServiceUsage,
     )
 from lp.app.validators.name import valid_name_pattern
 from lp.app.widgets.product import (
@@ -99,7 +90,6 @@
     ProductBugTrackerWidget,
     )
 from lp.bugs.browser.bugrole import BugRoleMixin
-from lp.bugs.browser.bugtask import BugTaskSearchListingView
 from lp.bugs.browser.structuralsubscription import (
     expose_structural_subscription_data_to_js,
     )
@@ -107,7 +97,6 @@
     BugTagsWidget,
     LargeBugTagsWidget,
     )
-from lp.bugs.browser.widgets.bugtask import NewLineToSpacesWidget
 from lp.bugs.interfaces.apportjob import IProcessApportBlobJobSource
 from lp.bugs.interfaces.bug import (
     CreateBugParams,
@@ -123,8 +112,6 @@
     IOfficialBugTagTargetRestricted,
     )
 from lp.bugs.interfaces.bugtask import (
-    BugTaskSearchParams,
-    BugTaskStatus,
     IBugTaskSet,
     UNRESOLVED_BUGTASK_STATUSES,
     )
@@ -1318,100 +1305,6 @@
             self.color = 'MochiKit.Color.Color["%sColor"]()' % color
 
 
-class BugTargetBugsView(BugTaskSearchListingView, FeedsMixin):
-    """View for the Bugs front page."""
-
-    # We have a custom searchtext widget here so that we can set the
-    # width of the search box properly.
-    custom_widget('searchtext', NewLineToSpacesWidget, displayWidth=36)
-
-    # Only include <link> tags for bug feeds when using this view.
-    feed_types = (
-        BugFeedLink,
-        BugTargetLatestBugsFeedLink,
-        )
-
-    # XXX: Bjorn Tillenius 2007-02-13:
-    #      These colors should be changed. It's the same colors that are used
-    #      to color statuses in buglistings using CSS, but there should be one
-    #      unique color for each status in the pie chart
-    status_color = {
-        BugTaskStatus.NEW: '#993300',
-        BugTaskStatus.INCOMPLETE: 'red',
-        BugTaskStatus.CONFIRMED: 'orange',
-        BugTaskStatus.TRIAGED: 'black',
-        BugTaskStatus.INPROGRESS: 'blue',
-        BugTaskStatus.FIXCOMMITTED: 'green',
-        BugTaskStatus.FIXRELEASED: 'magenta',
-        BugTaskStatus.INVALID: 'yellow',
-        BugTaskStatus.UNKNOWN: 'purple',
-    }
-
-    override_title_breadcrumbs = True
-
-    @property
-    def label(self):
-        """The display label for the view."""
-        return 'Bugs in %s' % self.context.title
-
-    def initialize(self):
-        super(BugTargetBugsView, self).initialize()
-        bug_statuses_to_show = list(UNRESOLVED_BUGTASK_STATUSES)
-        if IDistroSeries.providedBy(self.context):
-            bug_statuses_to_show.append(BugTaskStatus.FIXRELEASED)
-        expose_structural_subscription_data_to_js(
-            self.context, self.request, self.user)
-
-    @property
-    def can_have_external_bugtracker(self):
-        return (IProduct.providedBy(self.context)
-                or IProductSeries.providedBy(self.context))
-
-    @property
-    def bug_tracking_usage(self):
-        """Whether the context tracks bugs in launchpad.
-
-        :returns: ServiceUsage enum value
-        """
-        service_usage = IServiceUsage(self.context)
-        return service_usage.bug_tracking_usage
-
-    @property
-    def bugtracker(self):
-        """Description of the context's bugtracker.
-
-        :returns: str which may contain HTML.
-        """
-        if self.bug_tracking_usage == ServiceUsage.LAUNCHPAD:
-            return 'Launchpad'
-        elif self.external_bugtracker:
-            return BugTrackerFormatterAPI(self.external_bugtracker).link(None)
-        else:
-            return 'None specified'
-
-    @cachedproperty
-    def hot_bugs_info(self):
-        """Return a dict of the 10 hottest tasks and a has_more_bugs flag."""
-        has_more_bugs = False
-        params = BugTaskSearchParams(
-            orderby=['-heat', 'task'], omit_dupes=True,
-            user=self.user, status=any(*UNRESOLVED_BUGTASK_STATUSES))
-        # Use 4x as many tasks as bugs that are needed to improve performance.
-        bugtasks = self.context.searchTasks(params)[:40]
-        hot_bugtasks = []
-        hot_bugs = []
-        for task in bugtasks:
-            # Use hot_bugs list to ensure a bug is only listed once.
-            if task.bug not in hot_bugs:
-                if len(hot_bugtasks) < 10:
-                    hot_bugtasks.append(task)
-                    hot_bugs.append(task.bug)
-                else:
-                    has_more_bugs = True
-                    break
-        return {'has_more_bugs': has_more_bugs, 'bugtasks': hot_bugtasks}
-
-
 class BugTargetBugTagsView(LaunchpadView):
     """Helper methods for rendering the bug tags portlet."""
 

=== modified file 'lib/lp/bugs/browser/bugtask.py'
--- lib/lp/bugs/browser/bugtask.py	2011-12-05 18:38:42 +0000
+++ lib/lp/bugs/browser/bugtask.py	2011-12-06 04:48:26 +0000
@@ -175,6 +175,7 @@
     )
 from lp.app.browser.stringformatter import FormattersAPI
 from lp.app.browser.tales import (
+    BugTrackerFormatterAPI,
     DateTimeFormatterAPI,
     ObjectImageDisplayAPI,
     PersonFormatterAPI,
@@ -2554,6 +2555,24 @@
         return False
 
     @property
+    def can_have_external_bugtracker(self):
+        return (IProduct.providedBy(self.context)
+                or IProductSeries.providedBy(self.context))
+
+    @property
+    def bugtracker(self):
+        """Description of the context's bugtracker.
+
+        :returns: str which may contain HTML.
+        """
+        if self.bug_tracking_usage == ServiceUsage.LAUNCHPAD:
+            return 'Launchpad'
+        elif self.external_bugtracker:
+            return BugTrackerFormatterAPI(self.external_bugtracker).link(None)
+        else:
+            return 'None specified'
+
+    @property
     def upstream_launchpad_project(self):
         """The linked upstream `IProduct` for the package.
 

=== modified file 'lib/lp/bugs/browser/configure.zcml'
--- lib/lp/bugs/browser/configure.zcml	2011-12-05 18:38:42 +0000
+++ lib/lp/bugs/browser/configure.zcml	2011-12-06 04:48:26 +0000
@@ -329,12 +329,6 @@
         template="../templates/distribution-upstream-bug-report.pt"/>
     <browser:page
         for="lp.registry.interfaces.distribution.IDistribution"
-        name="+bugs-index"
-        class="lp.bugs.browser.bugtarget.BugTargetBugsView"
-        permission="zope.Public"
-        template="../templates/bugtarget-bugs.pt"/>
-    <browser:page
-        for="lp.registry.interfaces.distribution.IDistribution"
         class="lp.bugs.browser.cvereport.CVEReportView"
         permission="zope.Public"
         name="+cve"
@@ -364,12 +358,6 @@
         permission="zope.Public"
         template="../templates/series-bug-nominations.pt"/>
     <browser:page
-        for="lp.registry.interfaces.distroseries.IDistroSeries"
-        name="+bugs-index"
-        class="lp.bugs.browser.bugtarget.BugTargetBugsView"
-        permission="zope.Public"
-        template="../templates/bugtarget-bugs.pt"/>
-    <browser:page
         name="+securitycontact"
         for="lp.bugs.interfaces.securitycontact.IHasSecurityContact"
         class="lp.bugs.browser.securitycontact.SecurityContactEditView"
@@ -387,12 +375,6 @@
         class="lp.bugs.browser.bugtarget.ProductConfigureBugTrackerView"/>
     <browser:page
         for="lp.registry.interfaces.product.IProduct"
-        name="+bugs-index"
-        class="lp.bugs.browser.bugtarget.BugTargetBugsView"
-        permission="zope.Public"
-        template="../templates/bugtarget-bugs.pt"/>
-    <browser:page
-        for="lp.registry.interfaces.product.IProduct"
         class="lp.bugs.browser.bugtarget.BugTargetBugListingView"
         permission="zope.Public"
         name="+portlet-bugtasklist-seriesbugs"
@@ -432,12 +414,6 @@
         permission="zope.Public"/>
     <browser:page
         for="lp.registry.interfaces.productseries.IProductSeries"
-        name="+bugs-index"
-        class="lp.bugs.browser.bugtarget.BugTargetBugsView"
-        permission="zope.Public"
-        template="../templates/bugtarget-bugs.pt"/>
-    <browser:page
-        for="lp.registry.interfaces.productseries.IProductSeries"
         class="lp.bugs.browser.bugtarget.BugTargetBugListingView"
         permission="zope.Public"
         name="+portlet-bugtasklist-seriesbugs"

=== removed file 'lib/lp/bugs/stories/bugs/xx-bugtarget-bugs-page.txt'
--- lib/lp/bugs/stories/bugs/xx-bugtarget-bugs-page.txt	2011-12-05 16:44:41 +0000
+++ lib/lp/bugs/stories/bugs/xx-bugtarget-bugs-page.txt	1970-01-01 00:00:00 +0000
@@ -1,27 +0,0 @@
-= The bugs index page for bug targets =
-
-The bugs index page for bug targets is one of the first Launchpad
-page to embed all its action links in the main content area, rather
-than in an 'Actions' portlet.
-
-    >>> browser.open('http://bugs.launchpad.dev/ubuntu/+bugs-index')
-    >>> print find_portlet(browser.contents, 'Actions')
-    None
-
-The thing you are most likely to want to do from this page is search,
-so the search field is focused by default.
-
-    >>> from BeautifulSoup import BeautifulSoup
-    >>> print BeautifulSoup(browser.contents).body('script')[0]
-    <script...$('field.searchtext').focus();...
-
-But once you're on the search results page, you're quite likely to want
-to scroll through the results, so the search field should not be
-focused by default.
-
-    >>> browser.getControl(name='field.searchtext').value = 'test'
-    >>> browser.getControl('Search', index=0).click()
-    >>> print browser.url
-    http://bugs.launchpad.dev/ubuntu/+bugs?...
-    >>> '.focus()' in find_main_content(browser.contents)
-    False

=== modified file 'lib/lp/bugs/stories/bugs/xx-distribution-bugs-page.txt'
--- lib/lp/bugs/stories/bugs/xx-distribution-bugs-page.txt	2011-12-05 16:44:41 +0000
+++ lib/lp/bugs/stories/bugs/xx-distribution-bugs-page.txt	2011-12-06 04:48:26 +0000
@@ -2,12 +2,12 @@
 --------------------------
 
 The front page for a distribution on the bugs domain presents some basic
-information the bugs in it. It doesn't display the list of bugs.
+information the bugs in it. It also displays the list of bugs.
 
-    >>> anon_browser.open('http://bugs.launchpad.dev/ubuntu/+bugs-index')
+    >>> anon_browser.open('http://bugs.launchpad.dev/ubuntu/+bugs')
     >>> anon_browser.title
     'Bugs : Ubuntu'
-    >>> find_tag_by_id(anon_browser.contents, 'buglisting') is None
+    >>> find_tag_by_id(anon_browser.contents, 'buglisting') is not None
     True
 
 The page has a link to see all open bugs.
@@ -20,7 +20,7 @@
 
 It also has a link to subscribe to bug mail.
 
-    >>> user_browser.open('http://bugs.launchpad.dev/ubuntu/+bugs-index')
+    >>> user_browser.open('http://bugs.launchpad.dev/ubuntu/+bugs')
     >>> user_browser.getLink('Subscribe to bug mail').click()
     >>> print user_browser.url
     http://bugs.launchpad.dev/ubuntu/+subscribe
@@ -32,7 +32,7 @@
 The Bugs frontpage for a distribution includes the number of bugs that are
 fixed in some other context.
 
-    >>> anon_browser.open('http://bugs.launchpad.dev/ubuntu/+bugs-index')
+    >>> anon_browser.open('http://bugs.launchpad.dev/ubuntu/+bugs')
     >>> fixed_elsewhere_link = anon_browser.getLink('Bugs fixed elsewhere')
 
 The link takes you to the list of the bugs fixed elsewhere.
@@ -52,7 +52,7 @@
 
 It also displays the number of open bugs associated with a CVE.
 
-    >>> anon_browser.open('http://bugs.launchpad.dev/ubuntu/+bugs-index')
+    >>> anon_browser.open('http://bugs.launchpad.dev/ubuntu/+bugs')
     >>> cve_bugs_link = anon_browser.getLink('Open CVE bugs')
 
 The link takes you to the list of bugs with CVEs linked to them.
@@ -76,7 +76,7 @@
 The bugs page displays the number of Incomplete, unattended bugs that
 can expire when the project has enabled bug expiration.
 
-    >>> anon_browser.open('http://bugs.launchpad.dev/ubuntu/+bugs-index')
+    >>> anon_browser.open('http://bugs.launchpad.dev/ubuntu/+bugs')
     >>> expirable_bugs_link = anon_browser.getLink(
     ...     'Incomplete bugs')
 
@@ -90,7 +90,7 @@
 Debian does not use Launchpad to track bugs; the anonymous user cannot
 see any link reporting that bugs can expire.
 
-    >>> anon_browser.open('http://bugs.launchpad.dev/debian/+bugs-index')
+    >>> anon_browser.open('http://bugs.launchpad.dev/debian/+bugs')
     >>> expirable_bugs_link = anon_browser.getLink('Incomplete bugs')
     Traceback (most recent call last):
     ...

=== modified file 'lib/lp/bugs/stories/bugs/xx-distrorelease-bugs-page.txt'
--- lib/lp/bugs/stories/bugs/xx-distrorelease-bugs-page.txt	2011-12-05 16:44:41 +0000
+++ lib/lp/bugs/stories/bugs/xx-distrorelease-bugs-page.txt	2011-12-06 04:48:26 +0000
@@ -1,14 +1,13 @@
-== The Distribution Release Bugs Page ==
-
-The +bugs-index page for a distribution release on the bugs domain presents
-some basic information the bugs in it. It doesn't display the list of
-bugs.
-
-    >>> anon_browser.open('http://bugs.launchpad.dev/ubuntu/warty/+bugs-index')
+== The Distribution Series Bugs Page ==
+
+The +bugs page for a distribution series presents some basic information the
+bugs, as well as a listing.
+
+    >>> anon_browser.open('http://bugs.launchpad.dev/ubuntu/warty/+bugs')
     >>> anon_browser.title
-    'Bugs : Warty'
+    'Bugs : Warty (4.10) : Ubuntu'
 
-    >>> find_tag_by_id(anon_browser.contents, 'buglisting') is None
+    >>> find_tag_by_id(anon_browser.contents, 'buglisting') is not None
     True
 
 The page has a link to see all open bugs.

=== modified file 'lib/lp/bugs/stories/bugs/xx-front-page-info.txt'
--- lib/lp/bugs/stories/bugs/xx-front-page-info.txt	2011-12-05 16:44:41 +0000
+++ lib/lp/bugs/stories/bugs/xx-front-page-info.txt	2011-12-06 04:48:26 +0000
@@ -1,4 +1,4 @@
-A +bugs-index page for a project shows different information, depending
+A +bugs page for a project shows different information, depending
 on whether or not the project uses malone for bug tracking.
 
 By default, projects are created without using any bugtracker, malone
@@ -13,11 +13,11 @@
     ...     name='test-project', title='Simple Test Project', owner=foobar)
     >>> logout()
 
-The +bugs-index page for the project states that the project does
+The +bugs page for the project states that the project does
 not use Launchpad for bug tracking.
 
     >>> anon_browser.open(
-    ...     'http://bugs.launchpad.dev/test-project/+bugs-index')
+    ...     'http://bugs.launchpad.dev/test-project/+bugs')
     >>> uses_malone_p = find_tag_by_id(anon_browser.contents, 'no-malone')
     >>> print extract_text(uses_malone_p)
     Test-project must be configured in order for Launchpad to forward bugs to
@@ -30,13 +30,13 @@
     True
 
     >>> admin_browser.open(
-    ...   'http://bugs.launchpad.dev/test-project/+bugs-index')
+    ...   'http://bugs.launchpad.dev/test-project/+bugs')
     >>> enable_tracker = find_tag_by_id(
     ...     admin_browser.contents, 'no-malone-edit')
     >>> print extract_text(enable_tracker)
     Configure bug tracker
 
-The +bugs-index page for a project using Launchpad for bug tracking
+The +bugs page for a project using Launchpad for bug tracking
 shows controls for setting bug supervisor and states that no
 bugs have been filed.
 
@@ -46,7 +46,7 @@
     ...     official_malone=True)
     >>> logout()
 
-    >>> anon_browser.open('http://bugs.launchpad.dev/uses-malone/+bugs-index')
+    >>> anon_browser.open('http://bugs.launchpad.dev/uses-malone/+bugs')
     >>> bug_supervisor = find_tag_by_id(
     ...     anon_browser.contents, 'bug-supervisor')
     >>> print extract_text(bug_supervisor)
@@ -54,67 +54,12 @@
     None set
 
     >>> bug_list = find_tag_by_id(
-    ...     anon_browser.contents, 'no-bugs-filed')
-    >>> print extract_text(bug_list)
-    There are currently no bugs filed against Uses-malone.
-
-Since there are no bugs at all filed for the project, no search box is
-shown.
-
-    >>> print len(find_tags_by_class(anon_browser.contents, 'search-box'))
-    0
-
-If we add a bug, we see the search box and the list of hot bugs instead of
-the message "There are currently no bugs filed..."
-
-    >>> login('foo.bar@xxxxxxxxxxxxx')
-    >>> bug = factory.makeBug(product=uses_malone)
-    >>> logout()
-    >>> anon_browser.open('http://bugs.launchpad.dev/uses-malone/+bugs-index')
-    >>> content = find_main_content(anon_browser.contents)
-    >>> print extract_text(find_tag_by_id(content, 'simple-bug-search'))
-    by importance
-    by status
-    ...
-    Advanced search
-
-
-    >>> print find_tag_by_id(content, 'no-bugs-filed')
-    None
-
-    >>> hot_bugs = find_tag_by_id(content, 'hot-bugs')
-    >>> print extract_text(hot_bugs)
-    Summary   Status  Importance   Last changed
-    #16  ...  New     Undecided    ...
-
-When we mark our bug as "fix released", it is no longer a hot bug,
-and we see a message "no hot bugs" instead of the bug listing.
-
-    >>> from lp.bugs.interfaces.bugtask import BugTaskStatus
-    >>> login('foo.bar@xxxxxxxxxxxxx')
-    >>> bug.default_bugtask.transitionToStatus(
-    ...     BugTaskStatus.FIXRELEASED, user=bug.owner)
-    >>> logout()
-
-    >>> anon_browser.open('http://bugs.launchpad.dev/uses-malone/+bugs-index')
-    >>> content = find_main_content(anon_browser.contents)
-    >>> print find_tag_by_id(content, 'hot-bugs')
-    None
-
-    >>> bug_list = find_tag_by_id(content, 'no-bugs-filed')
-    >>> print extract_text(bug_list)
-    There are currently no open bugs filed against Uses-malone.
-
-But since the project has a bug, the search box is still visible.
-
-    >>> print extract_text(find_tag_by_id(content, 'simple-bug-search'))
-    by importance
-    by status
-    ...
-    Advanced search
+    ...     anon_browser.contents, 'bugs-table-listing')
+    >>> print extract_text(bug_list)
+    There are currently no open bugs.
 
 Projects that use an external bug tracker will list the tracker on a
-+bugs-index page.
++bugs page.
 
     >>> login('foo.bar@xxxxxxxxxxxxx')
     >>> some_tracker = factory.makeBugTracker(
@@ -122,7 +67,7 @@
     >>> test_project.bugtracker = some_tracker
     >>> logout()
     >>> anon_browser.open(
-    ...   'http://bugs.launchpad.dev/test-project/+bugs-index')
+    ...   'http://bugs.launchpad.dev/test-project/+bugs')
     >>> tracker_text = find_tag_by_id(anon_browser.contents, 'bugtracker')
     >>> print extract_text(tracker_text)
     Bugs are tracked in tracker.example.com/.
@@ -138,7 +83,7 @@
     ...     in_ubuntu=True)
     >>> logout()
     >>> anon_browser.open(
-    ...   'http://bugs.launchpad.dev/test-project/+bugs-index')
+    ...   'http://bugs.launchpad.dev/test-project/+bugs')
     >>> print extract_text(
     ...     find_tag_by_id(anon_browser.contents, 'also-in-ubuntu'))
     Ubuntu also tracks bugs for packages derived from this project:

=== modified file 'lib/lp/bugs/stories/bugs/xx-portlets-bug-series.txt'
--- lib/lp/bugs/stories/bugs/xx-portlets-bug-series.txt	2010-10-08 12:06:55 +0000
+++ lib/lp/bugs/stories/bugs/xx-portlets-bug-series.txt	2011-12-06 04:48:26 +0000
@@ -52,15 +52,3 @@
   >>> print extract_text(portlet)
   Series-targeted bugs
   1.0   1
-
-  >>> anon_browser.open("http://bugs.launchpad.dev/firefox/+bugs-index";)
-  >>> portlet = find_portlet(anon_browser.contents, "Series-targeted bugs")
-  >>> print extract_text(portlet)
-  Series-targeted bugs
-  1.0   1
-
-  >>> anon_browser.open("http://bugs.launchpad.dev/firefox/1.0/+bugs-index";)
-  >>> portlet = find_portlet(anon_browser.contents, "Series-targeted bugs")
-  >>> print extract_text(portlet)
-  Series-targeted bugs
-  1.0   1

=== modified file 'lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt'
--- lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt	2011-12-05 16:44:41 +0000
+++ lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt	2011-12-06 04:48:26 +0000
@@ -2,12 +2,12 @@
 ---------------------
 
 The +bugs-index page for a product on the bugs domain presents some basic
-information the bugs in it. It doesn't display the list of bugs.
+information the bugs in it. It also displays the list of bugs.
 
-    >>> anon_browser.open('http://bugs.launchpad.dev/firefox/+bugs-index')
+    >>> anon_browser.open('http://bugs.launchpad.dev/firefox/+bugs')
     >>> anon_browser.title
     'Bugs : Mozilla Firefox'
-    >>> find_tag_by_id(anon_browser.contents, 'buglisting') is None
+    >>> find_tag_by_id(anon_browser.contents, 'buglisting') is not None
     True
 
 The page has a link to see all open bugs.
@@ -21,7 +21,7 @@
 It also has a link to subscribe to bug mail (which is implemented in
 JavaScript so it doesn't actually go anywhere).
 
-    >>> user_browser.open('http://bugs.launchpad.dev/firefox/+bugs-index')
+    >>> user_browser.open('http://bugs.launchpad.dev/firefox/+bugs')
     >>> user_browser.getLink('Subscribe to bug mail').click()
     >>> user_browser.url
     'http://bugs.launchpad.dev/firefox/+subscribe'
@@ -31,10 +31,10 @@
 
 It also displays the number of open bugs associated with a CVE.
 
-    >>> anon_browser.open('http://bugs.launchpad.dev/evolution/+bugs-index')
+    >>> anon_browser.open('http://bugs.launchpad.dev/evolution/+bugs')
     >>> cve_bugs_link = anon_browser.getLink('Open CVE bugs')
 
-    >>> anon_browser.open('http://bugs.launchpad.dev/firefox/+bugs-index')
+    >>> anon_browser.open('http://bugs.launchpad.dev/firefox/+bugs')
     >>> cve_bugs_link = anon_browser.getLink('Open CVE bugs')
 
 The link takes you to the list of bugs with CVEs linked to them.
@@ -136,83 +136,3 @@
     >>> print_bugtasks(anon_browser.contents)
     5 Firefox install instructions should be complete
       Critical New
-
-
-Hot Bugs
---------
-
-A listing of the 10 'hottest' bugs is displayed to allow a quick
-overview of the project.
-
-To demonstrate this, we create 10 bugs and adjust their heat values manually.
-
-    >>> from zope.component import getUtility
-    >>> from canonical.launchpad.ftests import login, logout
-    >>> from lp.registry.interfaces.product import IProductSet
-    >>> import transaction
-    >>> login('foo.bar@xxxxxxxxxxxxx')
-    >>> firefox = getUtility(IProductSet).getByName("firefox")
-    >>> heat_values = [0, 400, 200, 600, 100, 50, 50, 50, 50, 50, 50, 50]
-    >>> for count in range(1, 11):
-    ...     summary = 'Summary for new bug %d' % count
-    ...     bug = factory.makeBug(title=summary, product=firefox)
-    ...     bug.setHeat(heat_values[count])
-    >>> transaction.commit()
-    >>> logout()
-
-For each bug we have the number, title, status, importance and the time
-since the last update.
-
-    >>> anon_browser.open('http://bugs.launchpad.dev/firefox/+bugs-index')
-    >>> print extract_text(
-    ...     find_tag_by_id(anon_browser.contents, 'hot-bugs'))
-        Summary                   Status   Importance    Last changed
-    #18 Summary for new bug 3    New      Undecided     ...
-    #16 Summary for new bug 1    New      Undecided     ...
-    #17 Summary for new bug 2    New      Undecided     ...
-    #19 Summary for new bug 4    New      Undecided     ...
-    #20 Summary for new bug 5    New      Undecided     ...
-    #21 Summary for new bug 6    New      Undecided     ...
-    #22 Summary for new bug 7    New      Undecided     ...
-    #23 Summary for new bug 8    New      Undecided     ...
-    #24 Summary for new bug 9    New      Undecided     ...
-    #25 Summary for new bug 10   New      Undecided     ...
-
-Fix Released bugs are not shown. We demonstrate this by setting the bugtask
-for bug 18 to be "Fix Released".
-
-    >>> from lp.bugs.interfaces.bug import BugTaskStatus, IBugSet
-    >>> from lp.registry.interfaces.person import IPersonSet
-    >>> login('foo.bar@xxxxxxxxxxxxx')
-    >>> bug_18 = getUtility(IBugSet).get(18)
-    >>> project_owner = getUtility(IPersonSet).getByName('name12')
-    >>> bug_18.bugtasks[0].transitionToStatus(
-    ...     BugTaskStatus.FIXRELEASED, project_owner)
-    >>> logout()
-
-    >>> anon_browser.reload()
-    >>> print extract_text(
-    ...     find_tag_by_id(anon_browser.contents, 'hot-bugs'))
-        Summary                   Status   Importance    Last changed
-    #16 Summary for new bug 1    New      Undecided     ...
-    #17 Summary for new bug 2    New      Undecided     ...
-    #19 Summary for new bug 4    New      Undecided     ...
-    #20 Summary for new bug 5    New      Undecided     ...
-    #21 Summary for new bug 6    New      Undecided     ...
-    #22 Summary for new bug 7    New      Undecided     ...
-    #23 Summary for new bug 8    New      Undecided     ...
-    #24 Summary for new bug 9    New      Undecided     ...
-    #25 Summary for new bug 10   New      Undecided     ...
-
-There is a link to see all bugs by heat if the project has more
-than 10 hot bugs.
-
-    >>> find_tag_by_id(anon_browser.contents, 'more-hot-bugs') is None
-    False
-
-Jokosher does not have more than 10 bugs and does not have a link
-to more hot bugs.
-
-    >>> anon_browser.open('http://bugs.launchpad.dev/jokosher/+bugs-index')
-    >>> find_tag_by_id(anon_browser.contents, 'more-hot-bugs') is None
-    True

=== modified file 'lib/lp/bugs/templates/buglisting-default.pt'
--- lib/lp/bugs/templates/buglisting-default.pt	2011-12-05 18:36:11 +0000
+++ lib/lp/bugs/templates/buglisting-default.pt	2011-12-06 04:48:26 +0000
@@ -31,6 +31,44 @@
 <body>
 
   <div metal:fill-slot="main">
+    <div
+      tal:condition="not: view/bug_tracking_usage/enumvalue:LAUNCHPAD"
+      class="top-portlet">
+      <p id="no-malone"
+        tal:condition="view/bug_tracking_usage/enumvalue:UNKNOWN">
+        <strong tal:condition="view/can_have_external_bugtracker">
+          <tal:displayname replace="context/displayname" />
+          must be configured in order for Launchpad to forward bugs to
+          the project's developers.
+        </strong>
+        <strong tal:condition="not: view/can_have_external_bugtracker">
+          <tal:displayname replace="context/displayname" />
+          does not use Launchpad for bug tracking.
+        </strong>
+      </p>
+
+      <p tal:condition="view/external_bugtracker"
+        id="bugtracker">
+        <strong>Bugs are tracked in
+          <tal:bugtracker replace="structure view/bugtracker" />.
+        </strong>
+      </p>
+
+      <a class="sprite maybe" href="https://help.launchpad.net/Bugs";>
+        Getting started with bug tracking in Launchpad</a>.
+
+      <p tal:condition="context/required:launchpad.Edit"
+         tal:define="configure_bugtracker context/menu:overview/configure_bugtracker | nothing"
+         id="no-malone-edit"
+         >
+        <a tal:condition="configure_bugtracker"
+          tal:replace="structure configure_bugtracker/fmt:link"/>
+        <a class="sprite edit"
+          tal:condition="not: configure_bugtracker"
+          tal:attributes="href string:${context/fmt:url/+edit}">
+          Enable bug tracking.</a>
+      </p>
+    </div>
     <div tal:condition="not: view/bug_tracking_usage/enumvalue:UNKNOWN"
          class="top-portlet">
       <tal:is_project_group condition="view/_projectContext">
@@ -82,20 +120,6 @@
       </div>
 
     </div>
-    <div tal:condition="view/bug_tracking_usage/enumvalue:UNKNOWN"
-          class="top-portlet">
-      <p>
-        <strong>
-          <tal:displayname replace="context/displayname" />
-          does not use Launchpad for bug tracking.
-        </strong>
-      </p>
-      <p id="getting-started-help">
-        <a class="sprite maybe"
-          href="https://help.launchpad.net/Bugs";>Getting started
-        with bug tracking in Launchpad</a>.
-      </p>
-    </div>
   </div>
 
   <tal:side metal:fill-slot="side">

=== removed file 'lib/lp/bugs/templates/bugtarget-bugs.pt'
--- lib/lp/bugs/templates/bugtarget-bugs.pt	2011-06-16 13:50:58 +0000
+++ lib/lp/bugs/templates/bugtarget-bugs.pt	1970-01-01 00:00:00 +0000
@@ -1,244 +0,0 @@
-<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";
-  xml:lang="en"
-  lang="en"
-  dir="ltr"
-  metal:use-macro="view/macro:page/main_side"
-  i18n:domain="malone"
->
-  <metal:block fill-slot="head_epilogue">
-    <meta tal:condition="not: view/bug_tracking_usage/enumvalue:LAUNCHPAD"
-          name="robots" content="noindex,nofollow" />
-    <tal:uses_launchpad_bugtracker
-       condition="view/bug_tracking_usage/enumvalue:LAUNCHPAD">
-      <script type="text/javascript">
-        LPS.use('lp.registry.structural_subscription', function(Y) {
-            var module = Y.lp.registry.structural_subscription;
-            Y.on('domready', function() {
-              module.setup({content_box: "#structural-subscription-content-box"});
-            });
-        });
-      </script>
-    </tal:uses_launchpad_bugtracker>
-    <style type="text/css">
-      p#more-hot-bugs {
-          float:right;
-          margin-top:7px;
-          }
-      .force-ellipsis:before {
-          width: 21em;
-          content: '\2026';
-          position: absolute;
-          margin-left: 19.5em;
-          width: 1em;
-          }
-    </style>
-</metal:block>
-  <body>
-
-    <tal:side metal:fill-slot="side"
-              condition="view/bug_tracking_usage/enumvalue:LAUNCHPAD">
-      <div id="involvement" class="portlet">
-        <ul class="involvement">
-          <li style="border: none">
-            <a href="+filebug" class="menu-link-filebug sprite bugs">
-              Report a bug
-            </a>
-          </li>
-          <li>
-            <a tal:define="addquestion_url view/addquestion_url"
-               tal:condition="addquestion_url"
-               tal:attributes="href view/addquestion_url"
-               class="menu-link-filebug sprite answers">
-              Ask a question
-            </a>
-          </li>
-        </ul>
-        <tal:bugtracker
-           define="link context/menu:bugs/configure_bugtracker|nothing"
-           condition="link">
-          <ul tal:condition="link/enabled"
-              style="padding-top: 1em">
-            <li>
-              <a tal:replace="structure link/fmt:link" />
-            </li>
-          </ul>
-        </tal:bugtracker>
-      </div>
-      <div class="portlet">
-        <dl tal:define="bug_supervisor context/bug_supervisor"
-            id="bug-supervisor">
-          <dt>Bug supervisor:</dt>
-          <dd>
-            <tal:none condition="not:bug_supervisor">None set</tal:none>
-            <a tal:condition="bug_supervisor"
-               tal:replace="structure bug_supervisor/fmt:link">Bob Johnson</a>
-            <tal:edit-bug-supervisor
-                condition="context/menu:bugs/bugsupervisor|nothing">
-              <a tal:define="link context/menu:bugs/bugsupervisor"
-                 tal:condition="link/enabled"
-                 tal:attributes="href link/url; title link/text">
-                <img tal:attributes="alt link/text" src="/@@/edit" />
-              </a>
-            </tal:edit-bug-supervisor>
-          </dd>
-        </dl>
-        <dl tal:define="securitycontact context/security_contact">
-          <dt id="bug-security">Security contact:</dt>
-          <dd>
-            <tal:none condition="not:securitycontact">None set</tal:none>
-            <a tal:condition="securitycontact"
-               tal:replace="structure securitycontact/fmt:link">
-              Billy Anderson
-            </a>
-            <tal:edit-securitycontact
-                condition="context/menu:bugs/securitycontact|nothing">
-              <a tal:define="link context/menu:bugs/securitycontact"
-                 tal:condition="link/enabled"
-                 tal:attributes="href link/url; title link/text">
-                <img tal:attributes="alt link/text" src="/@@/edit" />
-              </a>
-            </tal:edit-securitycontact>
-          </dd>
-        </dl>
-      </div>
-      <div tal:replace="structure context/@@+portlet-bugfilters" />
-      <div tal:replace="structure context/@@+portlet-bugtags" />
-      <tal:releasecriticalbugs
-          tal:condition="view/shouldShowReleaseCriticalPortlet"
-          tal:content="structure context/@@+portlet-bugtasklist-seriesbugs" />
-      <tal:milestonecriticalbugs
-          tal:condition="view/shouldShowReleaseCriticalPortlet"
-          tal:content="structure context/@@+portlet-bugtasklist-milestonebugs" />
-    </tal:side>
-    <div metal:fill-slot="main" class="tab-bugs"
-         tal:define="search_url string:+bugs;
-                     advanced_search_url string:+bugs?advanced=1">
-
-
-
-      <tal:uses_launchpad_bugtracker
-        condition="view/bug_tracking_usage/enumvalue:LAUNCHPAD">
-      <tal:has_bugtasks condition="context/has_bugtasks">
-        <div id="simple-bug-search" class="portlet-top" style="margin-bottom:2em">
-          <metal:search
-            use-macro="context/@@+bugtarget-macros-search/simple-search-form"
-          />
-        </div>
-        <script type="text/javascript"><!--
-             $('field.searchtext').focus();
-        --></script>
-      </tal:has_bugtasks>
-
-      <div class="portlet" tal:condition="view/hot_bugs_info/bugtasks">
-        <h2>Hot bugs</h2>
-
-        <table class="listing" id="hot-bugs"
-          tal:define="show_package python: 'packagename' in view.columns_to_show
-          ">
-          <thead>
-            <tr>
-              <th colspan="3">Summary</th>
-              <th
-                tal:condition="show_package">
-                Package
-              </th>
-              <th>Status</th>
-              <th>Importance</th>
-              <th>Last changed</th>
-            </tr>
-          </thead>
-          <tbody>
-            <tr tal:repeat="bugtask view/hot_bugs_info/bugtasks">
-              <td class="icon left">
-                <span tal:replace="structure bugtask/image:icon" />
-              </td>
-              <td style="text-align: right">
-                #<span tal:replace="bugtask/bug/id" />
-              </td>
-              <td>
-                <a tal:attributes="href bugtask/fmt:url"
-                   tal:content="bugtask/bug/title" />
-              </td>
-              <td tal:content="structure bugtask/sourcepackagename/name|default"
-                tal:condition="show_package"
-              >&mdash;</td>
-              <td tal:attributes="class string:status${bugtask/status/name}"
-                  tal:content="bugtask/status/title" />
-              <td tal:attributes="
-                    class string:importance${bugtask/importance/name}"
-                  tal:content="bugtask/importance/title" />
-              <td tal:content="bugtask/bug/date_last_updated/fmt:displaydate" />
-            </tr>
-          </tbody>
-        </table>
-        <p id="more-hot-bugs"
-           tal:condition="view/hot_bugs_info/has_more_bugs">
-          <a tal:attributes="href string:${context/fmt:url/+bugs}?orderby=-heat&amp;field.status%3Alist=NEW&amp;field.status%3Alist=INCOMPLETE_WITH_RESPONSE&amp;field.status%3Alist=INCOMPLETE_WITHOUT_RESPONSE&amp;field.status%3Alist=CONFIRMED&amp;field.status%3Alist=TRIAGED&amp;field.status%3Alist=INPROGRESS&amp;field.status%3Alist=FIXCOMMITTED&amp;field.omit_dupes=on">Show all bugs by heat</a>
-        </p>
-      </div>
-
-      <tal:no_hot_bugs condition="not: view/hot_bugs_info/bugtasks">
-        <p id="no-bugs-filed"><strong>There are currently no
-          <span tal:condition="context/has_bugtasks">open</span> bugs filed
-          against <tal:displayname replace="context/displayname" />.</strong></p>
-
-        <p id="no-bugs-report"><a href="+filebug">Report a bug.</a></p>
-      </tal:no_hot_bugs>
-      <div class="yui-u">
-        <div id="structural-subscription-content-box"></div>
-      </div>
-
-    </tal:uses_launchpad_bugtracker>
-
-    <p id="no-malone"
-       tal:condition="view/bug_tracking_usage/enumvalue:UNKNOWN">
-      <strong tal:condition="view/can_have_external_bugtracker">
-        <tal:displayname replace="context/displayname" />
-        must be configured in order for Launchpad to forward bugs to
-        the project's developers.
-      </strong>
-      <strong tal:condition="not: view/can_have_external_bugtracker">
-        <tal:displayname replace="context/displayname" />
-        does not use Launchpad for bug tracking.
-      </strong>
-    </p>
-
-    <p tal:condition="view/external_bugtracker"
-       id="bugtracker">
-      <strong>Bugs are tracked in
-        <tal:bugtracker replace="structure view/bugtracker" />.
-      </strong>
-    </p>
-
-    <tal:also_in_ubuntu
-      condition="not: view/bug_tracking_usage/enumvalue:LAUNCHPAD">
-      <metal:also-in-ubuntu
-        use-macro="context/@@+bugtarget-macros-search/also-in-ubuntu" />
-    </tal:also_in_ubuntu>
-
-    <div
-      tal:condition="not: view/bug_tracking_usage/enumvalue:LAUNCHPAD"
-      tal:define="configure_bugtracker context/menu:overview/configure_bugtracker | nothing">
-      <a class="sprite maybe"
-        href="https://help.launchpad.net/Bugs";>Getting started
-      with bug tracking in Launchpad</a>.
-
-      <p tal:condition="context/required:launchpad.Edit"
-          id="no-malone-edit"
-          >
-        <a tal:condition="configure_bugtracker"
-          tal:replace="structure configure_bugtracker/fmt:link"/>
-        <a class="sprite edit"
-          tal:condition="not: configure_bugtracker"
-          tal:attributes="href string:${context/fmt:url/+edit}">
-          Enable bug tracking.</a>
-      </p>
-    </div>
-
-    </div><!-- main -->
-  </body>
-</html>

=== modified file 'lib/lp/registry/browser/tests/test_subscription_links.py'
--- lib/lp/registry/browser/tests/test_subscription_links.py	2011-11-21 14:37:25 +0000
+++ lib/lp/registry/browser/tests/test_subscription_links.py	2011-12-06 04:48:26 +0000
@@ -132,7 +132,7 @@
     """Test structural subscriptions on the product bugs view."""
 
     rootsite = 'bugs'
-    view = '+bugs-index'
+    view = '+bugs'
 
 
 class ProjectGroupView(_TestStructSubs):
@@ -192,7 +192,7 @@
     """Test structural subscriptions on the product series bugs view."""
 
     rootsite = 'bugs'
-    view = '+bugs-index'
+    view = '+bugs'
 
     def setUp(self):
         super(ProductSeriesBugs, self).setUp()
@@ -306,7 +306,7 @@
     """Test structural subscriptions on the distro bugs view."""
 
     rootsite = 'bugs'
-    view = '+bugs-index'
+    view = '+bugs'
 
     def test_subscribe_link_owner(self):
         self._create_scenario(self.target.owner)
@@ -473,7 +473,7 @@
     """Test structural subscriptions on the product bugs view."""
 
     rootsite = 'bugs'
-    view = '+bugs-index'
+    view = '+bugs'
 
 
 class ProjectGroupDoesNotUseLPView(_DoesNotUseLP):
@@ -584,7 +584,7 @@
 
 class DistroDoesNotUseLPBugs(DistroDoesNotUseLPView):
     rootsite = 'bugs'
-    view = '+bugs-index'
+    view = '+bugs'
 
 
 class DistroMilestoneDoesNotUseLPView(DistroMilestoneView):