Comment 0 for bug 1509

Revision history for this message
Brad Bollenbach (bradb) wrote :

I have defined a menu for bug task pages like this:

class BugTaskPageMenu(MaloneApplicationMenu):
    """Malone application menu when viewing an IBugTask."""

    usedfor = IBugTask

    def context_bugs(self):
        context_title = self.context.contextname
        target = self._get_task_context_canonical_url() + "/+bugs"
        text = "%s Bugs" % context_title
        summary = "Bugs in %s" % context_title

        return Link(target, text, summary)

    def filebug(self):
        context_title = self.context.contextname
        filebug_url = self._get_task_context_canonical_url() + "/+filebug"
        target = filebug_url
        text = "Report a Bug"
        summary = "Report a Bug in %s" % context_title

        return Link(target, text, summary)

    def showreports(self):
        context_title = self.context.contextname
        bugs_url = self._get_task_context_canonical_url() + "/+bugs"
        # XXX: Brad Bollenbach, 2005-07-15: This URL is a workaround
        # until the following bug is fixed:
        #
        # https://launchpad.ubuntu.com/malone/bugs/881
        target = bugs_url + "/+advanced"
        text = "Show Reports"
        summary = "Show Reports for %s" % context_title

        showreports_link = Link(target, text, summary)
        showreports_link.selected = True

        return showreports_link

    def _get_task_context_canonical_url(self):
        return canonical_url(self.context.context)

When I view the URL:

    http://localhost:8086/products/firefox/+bugs/6

I expect to see only the "Show Reports" tab selected. Instead, I see *both* the "Mozilla Firefox Bugs" and the "Show Reports" tab selected.