aboutsummaryrefslogtreecommitdiff
path: root/templates/gititemtree.qtpl
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-08-04 15:00:13 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-08-04 15:00:13 +0200
commite775b5356ea3adaeeca2d4be5ef874b36fa183d0 (patch)
tree2fa12d9da673aac7f57f3bcfe86f53ce17074af4 /templates/gititemtree.qtpl
parent60004cfb97fe0eb64d1c8310e7c9caae96b8adbe (diff)
downloadcerrado-e775b5356ea3adaeeca2d4be5ef874b36fa183d0.tar.gz
cerrado-e775b5356ea3adaeeca2d4be5ef874b36fa183d0.tar.bz2
cerrado-e775b5356ea3adaeeca2d4be5ef874b36fa183d0.zip
feat: Handle submodulev0.0.14
Submodules tree entries won't have a broken link and will be labeled properly.
Diffstat (limited to 'templates/gititemtree.qtpl')
-rw-r--r--templates/gititemtree.qtpl7
1 files changed, 6 insertions, 1 deletions
diff --git a/templates/gititemtree.qtpl b/templates/gititemtree.qtpl
index 5898506..2753e24 100644
--- a/templates/gititemtree.qtpl
+++ b/templates/gititemtree.qtpl
@@ -1,5 +1,6 @@
{% import "git.gabrielgio.me/cerrado/pkg/u" %}
{% import "github.com/go-git/go-git/v5/plumbing/object" %}
+{% import "github.com/go-git/go-git/v5/plumbing/filemode" %}
{% code type GitItemTreePage struct {
Path []string
@@ -52,10 +53,14 @@
<div class="size"></div>
{% endif %}
{% for _, e := range g.Tree.Entries %}
- <div class="mode">{%s Ignore(e.Mode.ToOSFileMode()).String() %}</div>
{% if e.Mode.IsFile() %}
+ <div class="mode">{%s Ignore(e.Mode.ToOSFileMode()).String() %}</div>
<div class="name blob"><a href="{%s url(name, Blob, ref, e.Name, g.Path) %}">{%s e.Name %}</a></div>
+ {% elseif e.Mode == filemode.Submodule %}
+ <div class="mode">m---------</div>
+ <div class="name tree">{%s e.Name %} (submodule)</div>
{% else %}
+ <div class="mode">d---------</div>
<div class="name tree"><a href="{%s url(name, Folder, ref, e.Name, g.Path) %}">{%s e.Name %}</a></div>
{% endif %}
<div class="commit"></div>