diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 7ec9acc84e..b750e9129e 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -14,7 +14,7 @@ <tbody> {{if .HasParentPath}} <tr class="has-parent"> - <td colspan="3">{{svg "octicon-reply"}}<a class="muted" href="{{.BranchLink}}{{if .ParentPath}}{{PathEscapeSegments .ParentPath}}{{end}}">..</a></td> + <td colspan="3"><a class="muted" href="{{.BranchLink}}{{if .ParentPath}}{{PathEscapeSegments .ParentPath}}{{end}}">{{svg "octicon-reply" 16 "tw-mr-2"}}..</a></td> </tr> {{end}} {{range $item := .Files}} @@ -25,30 +25,29 @@ <td class="name four wide"> <span class="truncate"> {{if $entry.IsSubModule}} - {{svg "octicon-file-submodule"}} {{$refURL := $subModuleFile.RefURL AppUrl $.Repository.FullName $.SSHDomain}} {{/* FIXME: the usage of AppUrl seems incorrect, it would be fixed in the future, use AppSubUrl instead */}} + {{$icon := (svg "octicon-file-submodule" 16 "tw-mr-2")}} {{if $refURL}} - <a class="muted" href="{{$refURL}}">{{$entry.Name}}</a><span class="at">@</span><a href="{{$refURL}}/commit/{{PathEscape $subModuleFile.RefID}}">{{ShortSha $subModuleFile.RefID}}</a> + <a class="muted" href="{{$refURL}}">{{$icon}}{{$entry.Name}}</a><span class="at">@</span><a href="{{$refURL}}/commit/{{PathEscape $subModuleFile.RefID}}">{{ShortSha $subModuleFile.RefID}}</a> {{else}} - {{$entry.Name}}<span class="at">@</span>{{ShortSha $subModuleFile.RefID}} + {{$icon}}{{$entry.Name}}<span class="at">@</span>{{ShortSha $subModuleFile.RefID}} {{end}} {{else}} {{if $entry.IsDir}} {{$subJumpablePathName := $entry.GetSubJumpablePathName}} - {{svg "octicon-file-directory-fill"}} <a class="muted" href="{{$.TreeLink}}/{{PathEscapeSegments $subJumpablePathName}}" title="{{$subJumpablePathName}}"> {{$subJumpablePathFields := StringUtils.Split $subJumpablePathName "/"}} {{$subJumpablePathFieldLast := (Eval (len $subJumpablePathFields) "-" 1)}} - {{if eq $subJumpablePathFieldLast 0}} + {{svg "octicon-file-directory-fill" 16 "tw-mr-2" -}} + {{if eq $subJumpablePathFieldLast 0 -}} {{$subJumpablePathName}} - {{else}} - {{$subJumpablePathPrefixes := slice $subJumpablePathFields 0 $subJumpablePathFieldLast}} + {{else -}} + {{$subJumpablePathPrefixes := slice $subJumpablePathFields 0 $subJumpablePathFieldLast -}} <span class="text light-2">{{StringUtils.Join $subJumpablePathPrefixes "/"}}</span>/{{index $subJumpablePathFields $subJumpablePathFieldLast}} {{end}} </a> {{else}} - {{svg (printf "octicon-%s" (EntryIcon $entry))}} - <a class="muted" href="{{$.TreeLink}}/{{PathEscapeSegments $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a> + <a class="muted" href="{{$.TreeLink}}/{{PathEscapeSegments $entry.Name}}" title="{{$entry.Name}}">{{svg (printf "octicon-%s" (EntryIcon $entry)) 16 "tw-mr-2"}}{{$entry.Name}}</a> {{end}} {{end}} </span> diff --git a/tests/integration/repo_test.go b/tests/integration/repo_test.go index c1d2f327b4..1651bc4f10 100644 --- a/tests/integration/repo_test.go +++ b/tests/integration/repo_test.go @@ -181,11 +181,11 @@ func TestViewRepoWithSymlinks(t *testing.T) { return fmt.Sprintf("%s: %s", file, cls) }) assert.Len(t, items, 5) - assert.Equal(t, "a: svg octicon-file-directory-fill", items[0]) - assert.Equal(t, "link_b: svg octicon-file-directory-symlink", items[1]) - assert.Equal(t, "link_d: svg octicon-file-symlink-file", items[2]) - assert.Equal(t, "link_hi: svg octicon-file-symlink-file", items[3]) - assert.Equal(t, "link_link: svg octicon-file-symlink-file", items[4]) + assert.Equal(t, "a: tw-mr-2 svg octicon-file-directory-fill", items[0]) + assert.Equal(t, "link_b: tw-mr-2 svg octicon-file-directory-symlink", items[1]) + assert.Equal(t, "link_d: tw-mr-2 svg octicon-file-symlink-file", items[2]) + assert.Equal(t, "link_hi: tw-mr-2 svg octicon-file-symlink-file", items[3]) + assert.Equal(t, "link_link: tw-mr-2 svg octicon-file-symlink-file", items[4]) } // TestViewAsRepoAdmin tests PR #2167