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

« back to all changes in this revision

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

  • Committer: William Grant
  • Date: 2010-01-30 01:49:18 UTC
  • mfrom: (1465.1.2 exercise-breadcrumbs)
  • Revision ID: grantw@unimelb.edu.au-20100130014918-bn9i82pp30hin59r
Add an 'Exercises' breadcrumb before the exercise name.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
17
 
 
18
class ExercisesBreadcrumb(object):
 
19
    @property
 
20
    def url(self):
 
21
        return '/+exercises'
 
22
 
 
23
    @property
 
24
    def text(self):
 
25
        return 'Exercises'
 
26
 
 
27
 
18
28
class ExerciseBreadcrumb(object):
19
29
    def __init__(self, req, context):
20
30
        self.req = req
28
38
    def text(self):
29
39
        return self.context.name
30
40
 
 
41
    @property
 
42
    def extra_breadcrumbs_before(self):
 
43
        return [ExercisesBreadcrumb()]
 
44
 
 
45
 
31
46
class WorksheetBreadcrumb(object):
32
47
    def __init__(self, req, context):
33
48
        self.req = req