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

« back to all changes in this revision

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

  • Committer: Matt Giuca
  • Date: 2010-02-18 03:57:33 UTC
  • Revision ID: matt.giuca@gmail.com-20100218035733-d4v0iy4hq0wbjas6
ivle.fileservice_lib.listing: Previously assumed any SVN client error meant the directory was not versioned, and silently dropped SVN metadata. Now checks the error message, and for any unexpected errors, raises the exception rather than assuming unversioned. Fixes Launchpad Bug #523592.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
                                   self.context.semester.semester)
70
70
 
71
71
 
 
72
class ProjectsBreadcrumb(object):
 
73
    """Static 'Projects' breadcrumb to precede ProjectBreadcrumb."""
 
74
    def __init__(self, req, context):
 
75
        self.req = req
 
76
        self.context = context
 
77
 
 
78
    @property
 
79
    def url(self):
 
80
        return self.req.publisher.generate(self.context, None, '+projects')
 
81
 
 
82
    @property
 
83
    def text(self):
 
84
        return 'Projects'
 
85
 
 
86
 
72
87
class ProjectBreadcrumb(object):
73
88
    def __init__(self, req, context):
74
89
        self.req = req
82
97
    def text(self):
83
98
        return self.context.name
84
99
 
 
100
    @property
 
101
    def extra_breadcrumbs_before(self):
 
102
        return [ProjectsBreadcrumb(self.req, self.context.project_set.offering)]
 
103
 
 
104
 
 
105
class EnrolmentsBreadcrumb(object):
 
106
    """Static 'Enrolments' breadcrumb to precede EnrolmentBreadcrumb."""
 
107
    def __init__(self, req, context):
 
108
        self.req = req
 
109
        self.context = context
 
110
 
 
111
    @property
 
112
    def url(self):
 
113
        return self.req.publisher.generate(self.context, None, '+enrolments')
 
114
 
 
115
    @property
 
116
    def text(self):
 
117
        return 'Enrolments'
 
118
 
 
119
 
 
120
class EnrolmentBreadcrumb(object):
 
121
    def __init__(self, req, context):
 
122
        self.req = req
 
123
        self.context = context
 
124
 
 
125
    @property
 
126
    def text(self):
 
127
        return self.context.user.fullname
 
128
 
 
129
    @property
 
130
    def extra_breadcrumbs_before(self):
 
131
        return [EnrolmentsBreadcrumb(self.req, self.context.offering)]