diff options
author | silverwind <me@silverwind.io> | 2024-04-11 05:16:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-11 03:16:44 +0000 |
commit | 50dbed652738182eb42af51967ec7bd10e84ede9 (patch) | |
tree | e25bce5c37480506e14dae138ff2587fc675c017 /templates | |
parent | e6d3f9fc07d193ce95cf0964f0d12da87156fac9 (diff) | |
download | gitea-50dbed652738182eb42af51967ec7bd10e84ede9.tar.gz gitea-50dbed652738182eb42af51967ec7bd10e84ede9.zip |
Fix author name alignment in commits table (#30396)
Fixes https://github.com/go-gitea/gitea/issues/30129 by introducing a
wrapper div with flexbox that collapses any inter-tag whitespace within.
View diff with whitespace hidden.
Author names aligned:
<img width="172" alt="Screenshot 2024-04-10 at 19 41 27"
src="https://github.com/go-gitea/gitea/assets/115237/d761e8f2-0e67-4f84-8d37-9ed73850470a">
Vertically centered on expand:
<img width="466" alt="Screenshot 2024-04-10 at 19 43 02"
src="https://github.com/go-gitea/gitea/assets/115237/decd68b3-19b5-4cfa-a505-b358e4a0715b">
Ellipsis works:
<img width="344" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/6f8624a2-f8b6-4f3e-ac98-c44dd0cdfca5">
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/commits_list.tmpl | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index be73c4ca18..bb5d2a0394 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -13,17 +13,19 @@ {{$commitRepoLink := $.RepoLink}}{{if $.CommitRepoLink}}{{$commitRepoLink = $.CommitRepoLink}}{{end}} {{range .Commits}} <tr> - <td class="author tw-flex"> - {{$userName := .Author.Name}} - {{if .User}} - {{if and .User.FullName DefaultShowFullName}} - {{$userName = .User.FullName}} + <td class="author"> + <div class="tw-flex"> + {{$userName := .Author.Name}} + {{if .User}} + {{if and .User.FullName DefaultShowFullName}} + {{$userName = .User.FullName}} + {{end}} + {{ctx.AvatarUtils.Avatar .User 28 "tw-mr-2"}}<a class="muted author-wrapper" href="{{.User.HomeLink}}">{{$userName}}</a> + {{else}} + {{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 28 "tw-mr-2"}} + <span class="author-wrapper">{{$userName}}</span> {{end}} - {{ctx.AvatarUtils.Avatar .User 28 "tw-mr-2"}}<a class="muted author-wrapper" href="{{.User.HomeLink}}">{{$userName}}</a> - {{else}} - {{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 28 "tw-mr-2"}} - <span class="author-wrapper">{{$userName}}</span> - {{end}} + </div> </td> <td class="sha"> {{$class := "ui sha label"}} |