aboutsummaryrefslogtreecommitdiff
path: root/templates/gititemblob.qtpl
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-07-01 23:32:54 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-07-01 23:32:54 +0200
commit1b1460c8d4fa358433c51fd5293fd1c79f32aeff (patch)
treeb87528374798941a89e07ead5b92c2842deb40b6 /templates/gititemblob.qtpl
parent8f9853c8e26ffbad74e6414cec31104281a3860b (diff)
downloadcerrado-1b1460c8d4fa358433c51fd5293fd1c79f32aeff.tar.gz
cerrado-1b1460c8d4fa358433c51fd5293fd1c79f32aeff.tar.bz2
cerrado-1b1460c8d4fa358433c51fd5293fd1c79f32aeff.zip
feat: Add pathing to the tree tabv0.0.9
Diffstat (limited to 'templates/gititemblob.qtpl')
-rw-r--r--templates/gititemblob.qtpl17
1 files changed, 16 insertions, 1 deletions
diff --git a/templates/gititemblob.qtpl b/templates/gititemblob.qtpl
index f9bab3d..ca3a1fa 100644
--- a/templates/gititemblob.qtpl
+++ b/templates/gititemblob.qtpl
@@ -1,6 +1,8 @@
+{% import "git.gabrielgio.me/cerrado/pkg/u" %}
+
{% code
type GitItemBlobPage struct {
- File string
+ Path []string
Content []byte
}
%}
@@ -8,6 +10,19 @@ type GitItemBlobPage struct {
{% func (g *GitItemBlobPage) Nav(name, ref string) %}{%= GitItemNav(name, ref, Tree) %}{% endfunc %}
{% func (g *GitItemBlobPage) GitContent(name, ref string) %}
+<div class="pathing">
+ {% stripspace %}
+ {% if len(g.Path) != 0 %}
+ <a href="{%s url(name, Folder, ref, Root, []string{}) %}">root/</a>
+ {% for i, e := range g.Path[:len(g.Path)-1] %}
+ <a href="{%s url(name, Folder, ref, Root, g.Path[:1+i]) %}">{%s e %}/</a>
+ {% endfor %}
+ <a>{%s u.LastOrZero(g.Path) %}</a>
+ {% else %}
+ <a>root/</a>
+ {% endif %}
+ {% endstripspace %}
+</div>
<div class="code-view">
{%z= g.Content %}
</div>