diff options
author | silverwind <me@silverwind.io> | 2020-08-26 17:52:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-26 11:52:44 -0400 |
commit | 7d14d6c1c13f1eac4b9456c5db4c3594bc4dc237 (patch) | |
tree | 7c1b062b9d39d257c8e7968cbe92d19037e86374 /templates/repo | |
parent | 69b3dd636201d340ab6bdfa49ed95456a4e5acb7 (diff) | |
download | gitea-7d14d6c1c13f1eac4b9456c5db4c3594bc4dc237.tar.gz gitea-7d14d6c1c13f1eac4b9456c5db4c3594bc4dc237.zip |
Fix file table overflows (#12603)
- Fix overflow regression from https://github.com/go-gitea/gitea/pull/12553.
- Fix submodule columns stretching the table
- Refactor template to share more HTML nodes
- Introduce CSS helper classes
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/view_list.tmpl | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index db810890f5..36c3024d1d 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -43,37 +43,39 @@ {{$entry := index $item 0}} {{$commit := index $item 1}} <tr> - {{if $entry.IsSubModule}} - <td> - {{svg "octicon-file-submodule" 16}} - {{$refURL := $commit.RefURL AppUrl $.Repository.FullName}} - {{if $refURL}} - <a href="{{$refURL}}">{{$entry.Name}}</a> @ <a href="{{$refURL}}/commit/{{$commit.RefID}}">{{ShortSha $commit.RefID}}</a> + <td class="name four wide"> + <span class="truncate"> + {{if $entry.IsSubModule}} + {{svg "octicon-file-submodule" 16}} + {{$refURL := $commit.RefURL AppUrl $.Repository.FullName}} + {{if $refURL}} + <a class="flex-0" href="{{$refURL}}">{{$entry.Name}}</a><span class="at">@</span><a class="flex-1" href="{{$refURL}}/commit/{{$commit.RefID}}">{{ShortSha $commit.RefID}}</a> + {{else}} + {{$entry.Name}}<span class="at">@</span>{{ShortSha $commit.RefID}} + {{end}} {{else}} - {{$entry.Name}} @ {{ShortSha $commit.RefID}} + {{if $entry.IsDir}} + {{$subJumpablePathName := $entry.GetSubJumpablePathName}} + {{$subJumpablePath := SubJumpablePath $subJumpablePathName}} + {{svg "octicon-file-directory" 16}} + <a class="flex-1" href="{{EscapePound $.TreeLink}}/{{EscapePound $subJumpablePathName}}" title="{{$subJumpablePathName}}"> + {{if eq (len $subJumpablePath) 2}} + <span class="jumpable-path">{{index $subJumpablePath 0}}</span>{{index $subJumpablePath 1}} + {{else}} + {{index $subJumpablePath 0}} + {{end}} + </a> + {{else}} + {{svg (printf "octicon-%s" (EntryIcon $entry)) 16}} + <a class="flex-1" href="{{EscapePound $.TreeLink}}/{{EscapePound $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a> + {{end}} {{end}} - </td> - {{else}} - <td class="name four wide"> - {{if $entry.IsDir}} - {{$subJumpablePathName := $entry.GetSubJumpablePathName}} - {{$subJumpablePath := SubJumpablePath $subJumpablePathName}} - {{svg "octicon-file-directory" 16}} - <a href="{{EscapePound $.TreeLink}}/{{EscapePound $subJumpablePathName}}" title="{{$subJumpablePathName}}"> - {{if eq (len $subJumpablePath) 2}} - <span class="jumpable-path">{{index $subJumpablePath 0}}</span>{{index $subJumpablePath 1}} - {{else}} - {{index $subJumpablePath 0}} - {{end}} - </a> - {{else}} - {{svg (printf "octicon-%s" (EntryIcon $entry)) 16}} - <a href="{{EscapePound $.TreeLink}}/{{EscapePound $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a> - {{end}} - </td> - {{end}} + </span> + </td> <td class="message nine wide"> - <a href="{{$.RepoLink}}/commit/{{$commit.ID}}" title="{{$commit.Summary}}">{{$commit.Summary | RenderEmoji}}</a> + <span class="truncate"> + <a class="flex-1" href="{{$.RepoLink}}/commit/{{$commit.ID}}" title="{{$commit.Summary}}">{{$commit.Summary | RenderEmoji}}</a> + </span> </td> <td class="text right age three wide">{{TimeSince $commit.Committer.When $.Lang}}</td> </tr> |