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

« back to all changes in this revision

Viewing changes to ivle/webapp/filesystem/svnlog/__init__.py

  • Committer: William Grant
  • Date: 2009-12-08 03:50:24 UTC
  • mfrom: (1294.2.143 ui-the-third)
  • Revision ID: grantw@unimelb.edu.au-20091208035024-wjx8zp54gth15ph8
Merge ui-the-third. This is another UI revamp.

The header is now thin! Thin! The yellow bar is gone. The tabs are gone.
Breadcrumbs are here. Routes is replaced (with an object publishing
mechanism). Views are less repetitive. etc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from ivle.webapp.base.xhtml import XHTMLView
28
28
from ivle.webapp.base.plugins import ViewPlugin, MediaPlugin
29
29
from ivle.webapp.errors import NotFound, BadRequest
30
 
from ivle.webapp.filesystem import make_path_segments
 
30
from ivle.webapp.filesystem import make_path_breadcrumbs
 
31
from ivle.webapp import ApplicationRoot
31
32
 
32
33
class SubversionLogView(XHTMLView):
33
34
    template = 'template.html'
34
35
    tab = 'files'
35
36
 
 
37
    subpath_allowed = True
 
38
 
36
39
    def authorize(self, req):
37
40
        return req.user is not None
38
41
 
74
77
        ctx['url'] = req.make_path(os.path.join('svnlog', self.path))
75
78
        ctx['diffurl'] = req.make_path(os.path.join('diff', self.path))
76
79
        ctx['title'] = os.path.normpath(self.path).rsplit('/', 1)[-1]
77
 
        ctx['paths'] = make_path_segments(self.path)
 
80
        self.extra_breadcrumbs = make_path_breadcrumbs(req, self.subpath,
 
81
                                                   suffix='(Subversion log)')
78
82
 
79
83
        sr = ivle.svn.revision_from_string(
80
84
                   req.get_fieldstorage().getfirst("r"))
90
94
                                  ivle.util.split_path(req.path)[0],
91
95
                                  pathaction[0][1:])) + '?r=%d' % log['revno'])
92
96
 
 
97
    @property
 
98
    def path(self):
 
99
        return os.path.join(*self.subpath) if self.subpath else ''
 
100
 
93
101
class Plugin(ViewPlugin, MediaPlugin):
94
 
    urls = [
95
 
        ('/svnlog', SubversionLogView, {'path': ''}),
96
 
        ('/svnlog/*path', SubversionLogView),
97
 
    ]
 
102
    views = [(ApplicationRoot, 'svnlog', SubversionLogView)]
98
103
 
99
104
    media = 'media'