summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorSl@ny <webmaster@slany.work>2016-12-28 17:35:52 +0100
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2016-12-28 18:09:52 +0100
commitc22f9114c7e0874e99fd1504131423517905c9c1 (patch)
treeed70854ca628597d961fbf44acf61f1c9f8e6f16 /templates
parent331316894e391beb29fdebf9d8088973759bba1c (diff)
downloadgitea-c22f9114c7e0874e99fd1504131423517905c9c1.tar.gz
gitea-c22f9114c7e0874e99fd1504131423517905c9c1.zip
Implementation of Folder Jumping
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/view_list.tmpl17
1 files changed, 15 insertions, 2 deletions
diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl
index f1cbf58a4a..82167de64a 100644
--- a/templates/repo/view_list.tmpl
+++ b/templates/repo/view_list.tmpl
@@ -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">