aboutsummaryrefslogtreecommitdiff
path: root/templates/gititemtree.qtpl
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-06-09 20:07:00 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-06-09 20:07:00 +0200
commit2fcc394c53f995750b52ad06153041f61f0a0c55 (patch)
tree6828a8e2520fdf27611efb33509f3cc745de68d4 /templates/gititemtree.qtpl
parent02614b3781f6acdfc6df0e7b07d856b2779c4ac7 (diff)
downloadcerrado-2fcc394c53f995750b52ad06153041f61f0a0c55.tar.gz
cerrado-2fcc394c53f995750b52ad06153041f61f0a0c55.tar.bz2
cerrado-2fcc394c53f995750b52ad06153041f61f0a0c55.zip
feat: Add global reference to ref and name
Diffstat (limited to 'templates/gititemtree.qtpl')
-rw-r--r--templates/gititemtree.qtpl8
1 files changed, 2 insertions, 6 deletions
diff --git a/templates/gititemtree.qtpl b/templates/gititemtree.qtpl
index 68b9856..ffc063d 100644
--- a/templates/gititemtree.qtpl
+++ b/templates/gititemtree.qtpl
@@ -4,23 +4,19 @@
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() %}
+{% func (g *GitItemTreePage) GitContent(name, ref string) %}
<div class="row">
<div class="col-md-12">
<div class="tree-list">
{% for _, e := range g.Tree.Entries %}
<div class="mode">{%s Ignore(e.Mode.ToOSFileMode()).String() %}</div>
{% if e.Mode.IsFile() %}
- <div class="name blob"><a href="/{%s g.Name %}/blob/{%s g.Ref%}/{%s g.CurrentPath %}/{%s e.Name %}">{%s e.Name %}</a></div>
+ <div class="name blob"><a href="/{%s name %}/blob/{%s ref%}/{%s g.CurrentPath %}/{%s e.Name %}">{%s e.Name %}</a></div>
{% else %}
<div class="name tree"><a href="./{%s g.CurrentPath %}/{%s e.Name %}">{%s e.Name %}</a></div>
{% endif %}