diff options
author | Giteabot <teabot@gitea.io> | 2023-09-28 14:14:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-28 06:14:34 +0000 |
commit | b00489886d7428ed38dcbe359bfb623f4f7d9d49 (patch) | |
tree | dfc025c6b177f314f636c4c83ed4411a396aeb53 /templates/repo | |
parent | 9b698362a333de2c388499f1a64d39545b0263bd (diff) | |
download | gitea-b00489886d7428ed38dcbe359bfb623f4f7d9d49.tar.gz gitea-b00489886d7428ed38dcbe359bfb623f4f7d9d49.zip |
Improve branch list UI (#27319) (#27324)
Backport #27319 by @wxiaoguang
1. Put the `"octicon-shield-lock"` into the flex container, then it
doesn't need a separate flex box
2. Remove some unnecessary `gt-df` helpers
3. Make `btn` button has the same flex behavior as `ui button`


Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/branch/list.tmpl | 22 | ||||
-rw-r--r-- | templates/repo/commit_status.tmpl | 2 |
2 files changed, 9 insertions, 15 deletions
diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index f554c851d3..370a412efb 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -19,12 +19,10 @@ <tbody> <tr> <td> - <div class="gt-df gt-ac"> - {{if .DefaultBranchBranch.IsProtected}} - <span class="gt-df gt-pr-2">{{svg "octicon-shield-lock"}}</span> - {{end}} + <div class="flex-text-block"> + {{if .DefaultBranchBranch.IsProtected}}{{svg "octicon-shield-lock"}}{{end}} <a class="gt-ellipsis" href="{{.RepoLink}}/src/branch/{{PathEscapeSegments .DefaultBranchBranch.DBBranch.Name}}">{{.DefaultBranchBranch.DBBranch.Name}}</a> - <button class="btn interact-fg gt-df gt-p-3" data-clipboard-text="{{.DefaultBranchBranch.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> + <button class="btn interact-fg gt-px-2" data-clipboard-text="{{.DefaultBranchBranch.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID)}} </div> <p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{.RepoLink}}/commit/{{PathEscape .DefaultBranchBranch.DBBranch.CommitID}}">{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink .Repository.ComposeMetas}}</span> · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime ctx.Locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}} {{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}</p> @@ -91,21 +89,19 @@ <tr> <td class="eight wide"> {{if .DBBranch.IsDeleted}} - <div class="gt-df gt-ac"> + <div class="flex-text-block"> <a class="gt-ellipsis" href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments .DBBranch.Name}}">{{.DBBranch.Name}}</a> - <button class="btn interact-fg gt-p-3" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> + <button class="btn interact-fg gt-px-2" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> </div> <p class="info">{{ctx.Locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{TimeSinceUnix .DBBranch.DeletedUnix ctx.Locale}}</p> {{else}} - <div class="gt-df gt-ac"> - {{if .IsProtected}} - <span class="gt-df gt-pr-2">{{svg "octicon-shield-lock"}}</span> - {{end}} + <div class="flex-text-block"> + {{if .IsProtected}}{{svg "octicon-shield-lock"}}{{end}} <a class="gt-ellipsis" href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments .DBBranch.Name}}">{{.DBBranch.Name}}</a> - <button class="btn interact-fg gt-df gt-p-3" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> + <button class="btn interact-fg gt-px-2" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}} </div> - <p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{$.RepoLink}}/commit/{{PathEscape .DBBranch.CommitID}}">{{ShortSha .DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink $.Repository.ComposeMetas}}</span> · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime ctx.Locale}}{{if .DBBranch.Pusher}} {{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}} {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}</p> + <p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{$.RepoLink}}/commit/{{PathEscape .DBBranch.CommitID}}">{{ShortSha .DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink $.Repository.ComposeMetas}}</span> · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime ctx.Locale}}{{if .DBBranch.Pusher}} {{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}} {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}</p> {{end}} </td> <td class="two wide ui"> diff --git a/templates/repo/commit_status.tmpl b/templates/repo/commit_status.tmpl index 3dc1da61d3..ebd8a55f65 100644 --- a/templates/repo/commit_status.tmpl +++ b/templates/repo/commit_status.tmpl @@ -1,5 +1,4 @@ <!-- make sure this matches the color logic in web_src/js/components/DashboardRepoList.vue --> -<span class="gt-df"> {{if eq .State "pending"}} {{svg "octicon-dot-fill" 18 "commit-status icon text yellow"}} {{end}} @@ -12,4 +11,3 @@ {{if eq .State "failure"}} {{svg "octicon-x" 18 "commit-status icon text red"}} {{end}} -</span> |