LaunchpadMenus doesn't appear to allow for having a tab selected when viewing a page that isn't in the menu options

Bug #1507 reported by Brad Bollenbach
4
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Medium
Steve Alexander

Bug Description

I have an IBugTaskSubset, with four pages hanging off it:

  1. +index -- simple search
  2. "../+filebug" -- not relevant to this problem
  3. +advanced -- advanced search
  4. +results -- the search results page

I have defined this menu:

class MaloneApplicationMenu(ApplicationMenu):
    """Malone application menu when viewing an IBugTaskSubset."""

    usedfor = IBugTaskSubset
    facet = "bugs"
    links = ["context_bugs", "filebug", "showreports"]

    def context_bugs(self):
        context_title = self.context.context.title
        target = ""
        text = "%s Bugs" % context_title
        summary = "Bugs in %s" % context_title

        return Link(target, text, summary)

    def filebug(self):
        context_title = self.context.context.title
        filebug_url = self._get_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.context.title
        bugs_url = self._get_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

        return Link(target, text, summary)

    def _get_context_canonical_url(self):
        """Return the canonical URL of the IBugTaskSubset.context."""
        return canonical_url(self.context.context)

As you can see, there is no link that has the target "+results". However I want to tell the menu system that, when viewing the link:

    http://localhost:8086/products/firefox/+results

the tab "Show Reports" should be highlighted.

Given that the link above is not one of the menu options, there appears to be no way to be able to say this.

Brad Bollenbach (bradb)
Changed in launchpad:
assignee: nobody → stevea
status: New → Accepted
Brad Bollenbach (bradb)
description: updated
description: updated
Steve Alexander (stevea)
Changed in launchpad:
status: Accepted → Fixed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.