From 18aa098f50e2a2c7db01dd4d04dde460fd40f5d5 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Fri, 7 Jun 2024 14:02:25 +0200 Subject: feat: Add blob endpoint --- templates/gititemtree.qtpl | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'templates/gititemtree.qtpl') diff --git a/templates/gititemtree.qtpl b/templates/gititemtree.qtpl index 5ace7b0..be7a27d 100644 --- a/templates/gititemtree.qtpl +++ b/templates/gititemtree.qtpl @@ -1,10 +1,28 @@ +{% import "github.com/go-git/go-git/v5/plumbing/object" %} + {% code type GitItemTreePage struct { + CurrentPath string + Tree *object.Tree + + // TODO: remove this since it can be passed by GitCommit + Ref string + Name string } %} {% func (g *GitItemTreePage) Nav(name, ref string) %}{%= GitItemNav(name, ref, Tree) %}{% endfunc %} {% func (g *GitItemTreePage) GitContent() %} -

Tree

+{% for _, e := range g.Tree.Entries %} +
+
{%s Ignore(e.Mode.ToOSFileMode()).String() %}
+ {% if e.Mode.IsFile() %} + + {% else %} + + {% endif %} +
{%dl Ignore(g.Tree.Size(e.Name))%} KiB
+
+{% endfor %} {% endfunc %} -- cgit v1.2.3