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
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.
I have defined a menu for bug task pages like this:
class BugTaskPageMenu (MaloneApplicat ionMenu) :
"""Malone application menu when viewing an IBugTask."""
usedfor = IBugTask
def context_bugs(self):
context_ title = self.context. contextname task_context_ canonical_ url() + "/+bugs"
target = self._get_
text = "%s Bugs" % context_title
summary = "Bugs in %s" % context_title
return Link(target, text, summary)
def filebug(self):
context_ title = self.context. contextname task_context_ canonical_ url() + "/+filebug"
filebug_url = self._get_
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 task_context_ canonical_ url() + "/+bugs" /launchpad. ubuntu. com/malone/ bugs/881
bugs_url = self._get_
# XXX: Brad Bollenbach, 2005-07-15: This URL is a workaround
# until the following bug is fixed:
#
# https:/
target = bugs_url + "/+advanced"
text = "Show Reports"
summary = "Show Reports for %s" % context_title
return showreports_link
def _get_task_ context_ canonical_ url(self) : url(self. context. context)
return canonical_
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.