Show More
@@ -47,8 +47,9 b' data-base-kernel-url="{{base_kernel_url}}"' | |||
|
47 | 47 | <div id="notebook_list_header" class="row-fluid list_header"> |
|
48 | 48 | <div id="project_name"> |
|
49 | 49 | <ul class="breadcrumb"> |
|
50 | {% for component in tree_url_path.strip('/').split('/') %} | |
|
51 | <li>{{component}} <span>/</span></li> | |
|
50 | <li><span><a href="{{breadcrumbs[0][0]}}">/</a></span></li> | |
|
51 | {% for crumb in breadcrumbs[1:] %} | |
|
52 | <li><a href="{{crumb[0]}}">{{crumb[1]}}</a> <span>/</span></li> | |
|
52 | 53 | {% endfor %} |
|
53 | 54 | </ul> |
|
54 | 55 | </div> |
@@ -29,6 +29,16 b' from ..utils import url_path_join, path2url, url2path, url_escape' | |||
|
29 | 29 | class TreeHandler(IPythonHandler): |
|
30 | 30 | """Render the tree view, listing notebooks, clusters, etc.""" |
|
31 | 31 | |
|
32 | def generate_breadcrumbs(self, path): | |
|
33 | breadcrumbs = [(url_escape(url_path_join(self.base_project_url, 'tree')), '')] | |
|
34 | comps = path.split('/') | |
|
35 | ncomps = len(comps) | |
|
36 | for i in range(ncomps): | |
|
37 | if comps[i]: | |
|
38 | link = url_escape(url_path_join(self.base_project_url, 'tree', *comps[0:i+1])) | |
|
39 | breadcrumbs.append((link, comps[i])) | |
|
40 | return breadcrumbs | |
|
41 | ||
|
32 | 42 | @web.authenticated |
|
33 | 43 | def get(self, path='', name=None): |
|
34 | 44 | path = path.strip('/') |
@@ -44,10 +54,12 b' class TreeHandler(IPythonHandler):' | |||
|
44 | 54 | if not nbm.path_exists(path=path): |
|
45 | 55 | # no such directory, 404 |
|
46 | 56 | raise web.HTTPError(404) |
|
57 | breadcrumbs = self.generate_breadcrumbs(path) | |
|
47 | 58 | self.write(self.render_template('tree.html', |
|
48 | 59 | project=self.project_dir, |
|
49 | 60 | tree_url_path=path, |
|
50 | 61 | notebook_path=path, |
|
62 | breadcrumbs=breadcrumbs | |
|
51 | 63 | )) |
|
52 | 64 | |
|
53 | 65 |
General Comments 0
You need to be logged in to leave comments.
Login now