1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Implementation of Folder Jumping

This commit is contained in:
Sl@ny
2016-12-28 17:35:52 +01:00
committed by Kim "BKC" Carlbäcker
parent 331316894e
commit c22f9114c7
6 changed files with 54 additions and 5 deletions

View File

@@ -43,8 +43,21 @@
</td>
{{else}}
<td class="name">
<span class="octicon octicon-file-{{if or $entry.IsDir}}directory{{else}}text{{end}}"></span>
<a href="{{EscapePound $.TreeLink}}/{{EscapePound $entry.Name}}">{{$entry.Name}}</a>
{{if $entry.IsDir}}
{{$subJumpablePathName := $entry.GetSubJumpablePathName}}
{{$subJumpablePath := SubJumpablePath $subJumpablePathName}}
<span class="octicon octicon-file-directory"></span>
<a href="{{EscapePound $.TreeLink}}/{{EscapePound $subJumpablePathName}}">
{{if eq (len $subJumpablePath) 2}}
<span class="jumpable-path">{{index $subJumpablePath 0}}</span>{{index $subJumpablePath 1}}
{{else}}
{{index $subJumpablePath 0}}
{{end}}
</a>
{{else}}
<span class="octicon octicon-file-text"></span>
<a href="{{EscapePound $.TreeLink}}/{{EscapePound $entry.Name}}">{{$entry.Name}}</a>
{{end}}
</td>
{{end}}
<td class="message collapsing has-emoji">