~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/help/__init__.py

  • Committer: David Coles
  • Date: 2009-08-13 05:33:26 UTC
  • mto: (1294.2.124 ui-the-third)
  • mto: This revision was merged to the branch mainline in revision 1353.
  • Revision ID: coles.david@gmail.com-20090813053326-biq764rcow4stz4x
Add a special HelpTreeBreadcrumb, which has a submenu for the items.

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
    def text(self):
108
108
        return self.context.name
109
109
 
 
110
class HelpTreeBreadcrumb(HelpBreadcrumb):
 
111
    @property
 
112
    def menu(self):
 
113
        return dict((item.name, self.req.publisher.generate(item))
 
114
                    for item in self.context.values())
 
115
 
110
116
class Plugin(ViewPlugin, MediaPlugin):
111
117
    """The plugin for viewing help files."""
112
118
    forward_routes = (root_to_helptree, helptree_to_help)
116
122
             (HelpEntry, '+index', HelpEntryView)]
117
123
 
118
124
    breadcrumbs = {HelpEntry: HelpBreadcrumb,
119
 
                   HelpTree: HelpBreadcrumb,
 
125
                   HelpTree: HelpTreeBreadcrumb,
120
126
                  }
121
127
 
122
128
    tabs = [