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

« back to all changes in this revision

Viewing changes to ivle/webapp/admin/breadcrumbs.py

  • Committer: William Grant
  • Date: 2010-02-17 08:50:16 UTC
  • Revision ID: grantw@unimelb.edu.au-20100217085016-g0sy4ylul7t3v8uf
Add breadcrumbs for enrolments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
    def text(self):
83
83
        return self.context.name
84
84
 
 
85
 
 
86
class EnrolmentsBreadcrumb(object):
 
87
    """Static 'Enrolments' breadcrumb to precede EnrolmentBreadcrumb."""
 
88
    def __init__(self, req, context):
 
89
        self.req = req
 
90
        self.context = context
 
91
 
 
92
    @property
 
93
    def url(self):
 
94
        return self.req.publisher.generate(self.context, None, '+enrolments')
 
95
 
 
96
    @property
 
97
    def text(self):
 
98
        return 'Enrolments'
 
99
 
 
100
 
 
101
class EnrolmentBreadcrumb(object):
 
102
    def __init__(self, req, context):
 
103
        self.req = req
 
104
        self.context = context
 
105
 
 
106
    @property
 
107
    def text(self):
 
108
        return self.context.user.fullname
 
109
 
 
110
    @property
 
111
    def extra_breadcrumbs_before(self):
 
112
        return [EnrolmentsBreadcrumb(self.req, self.context.offering)]