diff options
Diffstat (limited to 'templates/gititemblob.qtpl')
-rw-r--r-- | templates/gititemblob.qtpl | 17 |
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> |