summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Bertogli <albertito@blitiri.com.ar>2017-08-27 20:17:26 +0200
committerAlberto Bertogli <albertito@blitiri.com.ar>2017-08-27 20:17:26 +0200
commit5def4c9e01c87073d743a71827fee1be0ee41881 (patch)
tree3dc436a17b12c94316d93d72011fea0f03878d2b
parent891a9443817329492c75ad99b8ff8899c460dee1 (diff)
downloadgit-arr-fork-5def4c9e01c87073d743a71827fee1be0ee41881.zip
views: Include the root tree in the summary
Including the tree as part of the summary gives a bit more information and provides an easy path into the tree. It does clutter things a bit, so this is an experiment and may be removed later.
-rw-r--r--views/summary.html5
-rw-r--r--views/tree-list.html16
-rw-r--r--views/tree.html18
3 files changed, 23 insertions, 16 deletions
diff --git a/views/summary.html b/views/summary.html
index d30e895..652ee6e 100644
--- a/views/summary.html
+++ b/views/summary.html
@@ -35,6 +35,11 @@
% end
% if "master" in repo.branch_names():
+<b><a href="b/master/t/">[master]</a> /</b><br/>
+% kwargs = dict(repo = repo, tree=repo.tree("master"),
+% treeroot="b/master/t", dirname=smstr.from_url(""))
+% include tree-list **kwargs
+<hr/>
% kwargs = dict(repo = repo, start_ref = "refs/heads/master",
% limit = repo.info.commits_in_summary,
% shorten = shorten, repo_root = ".", offset = 0)
diff --git a/views/tree-list.html b/views/tree-list.html
new file mode 100644
index 0000000..5eea1aa
--- /dev/null
+++ b/views/tree-list.html
@@ -0,0 +1,16 @@
+<table class="nice ls">
+% key_func = lambda (t, n, s): (t != 'tree', n.raw)
+% for type, name, size in sorted(tree.ls(dirname.raw), key = key_func):
+ <tr class="{{type}}">
+% if type == "blob":
+ <td class="name"><a href="{{treeroot}}/f={{name.url}}.html">
+ {{!name.html}}</a></td>
+ <td class="size">{{size}}</td>
+% elif type == "tree":
+ <td class="name">
+ <a class="explicit" href="{{treeroot}}/{{name.url}}/">
+ {{!name.html}}/</a></td>
+% end
+ </tr>
+% end
+</table>
diff --git a/views/tree.html b/views/tree.html
index 12c21b0..3f3829c 100644
--- a/views/tree.html
+++ b/views/tree.html
@@ -36,22 +36,8 @@
% end
</h3>
-<table class="nice ls">
-% key_func = lambda (t, n, s): (t != 'tree', n.raw)
-% for type, name, size in sorted(tree.ls(dirname.raw), key = key_func):
- <tr class="{{type}}">
-% if type == "blob":
- <td class="name"><a href="./f={{name.url}}.html">
- {{!name.html}}</a></td>
- <td class="size">{{size}}</td>
-% elif type == "tree":
- <td class="name">
- <a class="explicit" href="./{{name.url}}/">
- {{!name.html}}/</a></td>
-% end
- </tr>
-% end
-</table>
+% kwargs = dict(repo = repo, tree=tree, treeroot=".")
+% include tree-list **kwargs
</body>
</html>