From e97baed800ed9b83c5634492205318ab0c820719 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 18 Sep 2023 12:25:36 +0800 Subject: [PATCH] Remove a `gt-float-right` and some unnecessary helpers (#27110) Follow Remove polluted .ui.right #26825 Remove more `gt-float-right`, remove unnecessary helpers, remove negative margin tricks. ![image](https://github.com/go-gitea/gitea/assets/2114189/2785c6e6-7823-4699-a4f3-184eef50ceda) --- templates/repo/release/list.tmpl | 37 +++++++++++----------- web_src/css/repo/release-tag.css | 54 ++++++++++---------------------- 2 files changed, 35 insertions(+), 56 deletions(-) diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl index b93134b5d9..a717fba651 100644 --- a/templates/repo/release/list.tmpl +++ b/templates/repo/release/list.tmpl @@ -16,19 +16,19 @@
-

+

{{.Title}} {{if .IsDraft}} - {{$.locale.Tr "repo.release.draft"}} + {{$.locale.Tr "repo.release.draft"}} {{else if .IsPrerelease}} - {{$.locale.Tr "repo.release.prerelease"}} + {{$.locale.Tr "repo.release.prerelease"}} {{else if not .IsTag}} - {{$.locale.Tr "repo.release.stable"}} + {{$.locale.Tr "repo.release.stable"}} {{end}}

-
+
{{if and $.CanCreateRelease (not .IsTag)}} - + {{svg "octicon-pencil"}} {{end}} @@ -38,7 +38,7 @@

{{if gt .Publisher.ID 0}} - {{ctx.AvatarUtils.Avatar .Publisher 20}} + {{ctx.AvatarUtils.Avatar .Publisher 20 "gt-mr-2"}} {{.Publisher.Name}} @@ -55,9 +55,9 @@

{{if .OriginalAuthor}} - {{svg "octicon-mark-github" 16 "gt-mr-2"}}{{.OriginalAuthor}} + {{svg "octicon-mark-github" 20 "gt-mr-2"}}{{.OriginalAuthor}} {{else if .Publisher}} - {{ctx.AvatarUtils.Avatar .Publisher 20}} + {{ctx.AvatarUtils.Avatar .Publisher 20 "gt-mr-2"}} {{.Publisher.GetDisplayName}} {{else}} Ghost @@ -77,8 +77,9 @@

{{Str2html .Note}}
-
- +
+
+ {{$.locale.Tr "repo.release.downloads"}}
-   +
{{end}} diff --git a/web_src/css/repo/release-tag.css b/web_src/css/repo/release-tag.css index 5d1830f16a..a146eda6a9 100644 --- a/web_src/css/repo/release-tag.css +++ b/web_src/css/repo/release-tag.css @@ -7,22 +7,14 @@ .repository.releases #release-list .release-list-title { font-size: 2rem; font-weight: var(--font-weight-normal); - margin-top: -4px; - margin-bottom: 0; -} - -.repository.releases #release-list > li { - list-style: none; -} - -.repository.releases #release-list > li .meta, -.repository.releases #release-list > li .detail { - padding-top: 30px; - padding-bottom: 40px; + display: flex; + align-items: center; + gap: 0.25em; + margin: 0; } .repository.releases #release-list > li .meta { - margin-top: 4px; + padding-top: 25px; position: relative; text-align: right; display: flex; @@ -31,44 +23,30 @@ } .repository.releases #release-list > li .detail { + padding-bottom: 20px; border-left: 1px solid var(--color-secondary); } .repository.releases #release-list > li .detail .author img { - margin-bottom: 3px; -} - -.repository.releases #release-list > li .detail .download > a .svg { - margin-left: 5px; - margin-right: 5px; + margin-bottom: 2px; /* the legacy trick to align the avatar vertically, no better solution at the moment */ } .repository.releases #release-list > li .detail .download .list { padding-left: 0; -} - -.repository.releases #release-list > li .detail .download .list li { - list-style: none; - display: block; - padding: 8px; border: 1px solid var(--color-secondary); + border-radius: var(--border-radius); background: var(--color-light); } -.repository.releases #release-list > li .detail .download .list li a > .text.right { - margin-right: 5px; +.repository.releases #release-list > li .detail .download .list li { + display: flex; + justify-content: space-between; + padding: 8px; + border-bottom: 1px solid var(--color-secondary); } -.repository.releases #release-list > li .detail .download .list li + li { - border-top: 0; -} - -.repository.releases #release-list > li .detail .download .list li:first-of-type { - border-radius: var(--border-radius) 0 0 var(--border-radius); -} - -.repository.releases #release-list > li .detail .download .list li:last-of-type { - border-radius: 0 var(--border-radius) var(--border-radius) 0; +.repository.releases #release-list > li .detail .download .list li:last-child { + border-bottom: none; } .repository.releases #release-list > li .detail .dot { @@ -77,7 +55,7 @@ background-color: var(--color-secondary-dark-3); position: absolute; left: -5.5px; - top: 40px; + top: 30px; border-radius: var(--border-radius-circle); border: 2.5px solid var(--color-body); }