~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:28:20 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-20090813052820-ettbquyaaaymgtsz
Add breadcrumbs for help items and trees.

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
def helpentry_url(helpentry):
95
95
    return (helpentry.parent, helpentry.name)
96
96
 
 
97
class HelpBreadcrumb(object):
 
98
    def __init__(self, req, context):
 
99
        self.req = req
 
100
        self.context = context
 
101
 
 
102
    @property
 
103
    def url(self):
 
104
        return self.req.publisher.generate(self.context)
 
105
 
 
106
    @property
 
107
    def text(self):
 
108
        return self.context.name
 
109
 
97
110
class Plugin(ViewPlugin, MediaPlugin):
98
111
    """The plugin for viewing help files."""
99
112
    forward_routes = (root_to_helptree, helptree_to_help)
102
115
    views = [(HelpTree, '+index', HelpTreeView),
103
116
             (HelpEntry, '+index', HelpEntryView)]
104
117
 
 
118
    breadcrumbs = {HelpEntry: HelpBreadcrumb,
 
119
                   HelpTree: HelpBreadcrumb,
 
120
                  }
 
121
 
105
122
    tabs = [
106
123
        ('help', 'Help', 'Get help with IVLE', 'help.png', '+help', 100)
107
124
    ]