~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/controllers/annotate_ui.py

use a pretty template for the directory listings

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import os
21
21
import posixpath
22
22
 
23
 
from paste.httpexceptions import HTTPBadRequest, HTTPServerError
 
23
from paste.httpexceptions import HTTPBadRequest
24
24
 
25
25
from loggerhead.controllers import TemplatedBranchView
26
26
from loggerhead import util
62
62
            path = h.get_path(revid, file_id)
63
63
        filename = os.path.basename(path)
64
64
 
65
 
        # Directory Breadcrumbs
66
 
        directory_breadcrumbs = (
67
 
            util.directory_breadcrumbs(
68
 
                self._branch.friendly_name,
69
 
                self._branch.is_root,
70
 
                'files'))
71
 
 
72
 
        # Create breadcrumb trail for the path within the branch
73
 
        try:
74
 
            inv = h.get_inventory(revid)
75
 
        except:
76
 
            self.log.exception('Exception fetching changes')
77
 
            raise HTTPServerError('Could not fetch changes')
78
 
        branch_breadcrumbs = util.branch_breadcrumbs(path, inv, 'files')
79
 
 
80
65
        return {
81
66
            'revid': revid,
82
67
            'file_id': file_id,
86
71
            'change': h.get_changes([ revid ])[0],
87
72
            'contents': list(h.annotate_file(file_id, revid)),
88
73
            'fileview_active': True,
89
 
            'directory_breadcrumbs': directory_breadcrumbs,
90
 
            'branch_breadcrumbs': branch_breadcrumbs,
91
74
        }