File tree Expand file tree Collapse file tree 6 files changed +54
-5
lines changed
Expand file tree Collapse file tree 6 files changed +54
-5
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,17 @@ func NewFuncMap() []template.FuncMap {
117117 }
118118 return "tab-size-8"
119119 },
120+ "SubJumpablePath" : func (str string ) []string {
121+ var path []string
122+ index := strings .LastIndex (str , "/" )
123+ if index != - 1 && index != len (str ) {
124+ path = append (path , string (str [0 :index + 1 ]))
125+ path = append (path , string (str [index + 1 :]))
126+ } else {
127+ path = append (path , str )
128+ }
129+ return path
130+ },
120131 }}
121132}
122133
Original file line number Diff line number Diff line change @@ -1272,6 +1272,9 @@ footer .ui.language .menu {
12721272.repository .file .list # repo-files-table tr : hover {
12731273 background-color : # ffffEE ;
12741274}
1275+ .repository .file .list # repo-files-table .jumpable-path {
1276+ color : # 888 ;
1277+ }
12751278.repository .file .list # file-content .header .icon {
12761279 font-size : 1em ;
12771280 margin-top : -2px ;
Original file line number Diff line number Diff line change 205205 tr :hover {
206206 background-color : #ffffEE ;
207207 }
208+ .jumpable-path {
209+ color : #888 ;
210+ }
208211 }
209212
210213 #file-content {
Original file line number Diff line number Diff line change 4343 </td>
4444 {{else }}
4545 <td class= " name" >
46- <span class= " octicon octicon-file-{{if or $entry.IsDir}}directory{{else}}text{{end}}" ></span>
47- <a href= " {{EscapePound $.TreeLink}}/{{EscapePound $entry.Name}}" >{{$entry .Name }}</a>
46+ {{if $entry .IsDir }}
47+ {{$subJumpablePathName := $entry .GetSubJumpablePathName }}
48+ {{$subJumpablePath := SubJumpablePath $subJumpablePathName }}
49+ <span class= " octicon octicon-file-directory" ></span>
50+ <a href= " {{EscapePound $.TreeLink}}/{{EscapePound $subJumpablePathName}}" >
51+ {{if eq (len $subJumpablePath ) 2}}
52+ <span class= " jumpable-path" >{{index $subJumpablePath 0}}</span>{{index $subJumpablePath 1}}
53+ {{else }}
54+ {{index $subJumpablePath 0}}
55+ {{end }}
56+ </a>
57+ {{else }}
58+ <span class= " octicon octicon-file-text" ></span>
59+ <a href= " {{EscapePound $.TreeLink}}/{{EscapePound $entry.Name}}" >{{$entry .Name }}</a>
60+ {{end }}
4861 </td>
4962 {{end }}
5063 <td class= " message collapsing has-emoji" >
Original file line number Diff line number Diff line change 33 "ignore" : " test" ,
44 "package" : [
55 {
6- "checksumSHA1" : " OWuUWQ8sWC8n+eTQttx+3vfES8g =" ,
6+ "checksumSHA1" : " mIaKLz6373W+jDLjgE/Yzt/exeo =" ,
77 "path" : " code.gitea.io/git" ,
8- "revision" : " 634abd6a61c350a95f6b146c3a5fc323282608ae " ,
9- "revisionTime" : " 2016-12-22T08:49:21Z "
8+ "revision" : " 3d0fa331865619d2f3a7a0fcf23670a389310954 " ,
9+ "revisionTime" : " 2016-12-28T14:57:51Z "
1010 },
1111 {
1212 "checksumSHA1" : " dnGaLR7sd9D5YpQZP4QUGZiEq+c=" ,
You can’t perform that action at this time.
0 commit comments