~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-23 05:27:07 UTC
  • Revision ID: matt.giuca@gmail.com-20100223052707-3a76wo23r2z503t8
browser.js: Adjusted condition for enabling "Commit" action; now allowed if
    no files are selected AND current directory is versioned (as well as if
    all selected files are versioned). Committing with 0 files selected will
    commit the current directory.
ivle.fileservice_lib.action: Fixed to allow commit to contain 0 paths. This
    will commit the current directory instead.
This fixes Launchpad bug #526161.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
    @property
39
39
    def text(self):
40
 
        perms = self.context.get_permissions(self.req.user, self.req.config)
41
 
        # Show nickname iff current user has permission to view this user
42
 
        # (Else, show just the login name)
43
 
        if 'view' in perms:
44
 
            return self.context.nick
45
 
        else:
46
 
            return self.context.login
 
40
        return self.context.nick
47
41
 
48
42
    @property
49
43
    def extra_breadcrumbs_before(self):
50
44
        return [UsersBreadcrumb()]
51
45
 
52
46
 
53
 
class SubjectsBreadcrumb(object):
54
 
    @property
55
 
    def url(self):
56
 
        return '/subjects'
57
 
 
58
 
    @property
59
 
    def text(self):
60
 
        return 'Subjects'
61
 
 
62
47
class SubjectBreadcrumb(object):
63
48
    def __init__(self, req, context):
64
49
        self.req = req
65
50
        self.context = context
66
51
 
67
52
    @property
68
 
    def url(self):
69
 
        return self.req.publisher.generate(self.context)
70
 
 
71
 
    @property
72
53
    def text(self):
73
54
        return self.context.name
74
55
 
75
 
    @property
76
 
    def extra_breadcrumbs_before(self):
77
 
        return [SubjectsBreadcrumb()]
78
 
 
79
56
 
80
57
class OfferingBreadcrumb(object):
81
58
    def __init__(self, req, context):