From b93c87b6fe025408777d9f2091d29941e439e58c Mon Sep 17 00:00:00 2001 From: silverwind Date: Sat, 27 Apr 2024 15:35:26 +0200 Subject: [PATCH] Issue card improvements (#30687) Fixes https://github.com/go-gitea/gitea/issues/30682 and does a few improvements: - Use gap instead of margin/padding - Don't render empty image div - Remove `right floated` class that did nothing Screenshot 2024-04-24 at 20 21 20 --------- Co-authored-by: KN4CK3R --- templates/repo/issue/card.tmpl | 25 +++++++++++++++---------- web_src/css/repo/issue-card.css | 2 +- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/templates/repo/issue/card.tmpl b/templates/repo/issue/card.tmpl index bb9340bb2e4..4a0ac050aa2 100644 --- a/templates/repo/issue/card.tmpl +++ b/templates/repo/issue/card.tmpl @@ -1,13 +1,16 @@ {{with .Issue}} {{if eq $.Page.Project.CardType 1}}{{/* Images and Text*/}} + {{$attachments := index $.Page.issuesAttachmentMap .ID}} + {{if $attachments}}
- {{range (index $.Page.issuesAttachmentMap .ID)}} + {{range $attachments}} {{.Name}} {{end}}
+ {{end}} {{end}} -
-
+
+
{{template "shared/issueicon" .}}
@@ -18,7 +21,7 @@ {{end}}
-
+
{{if not $.Page.Repository}}{{.Repo.FullName}}{{end}}#{{.Index}} {{$timeStr := TimeSinceUnix .GetLastEventTimestamp ctx.Locale}} @@ -59,13 +62,15 @@
{{if or .Labels .Assignees}} -
- {{range .Labels}} - {{RenderLabel ctx ctx.Locale .}} - {{end}} -
+
+
+ {{range .Labels}} + {{RenderLabel ctx ctx.Locale .}} + {{end}} +
+
diff --git a/web_src/css/repo/issue-card.css b/web_src/css/repo/issue-card.css index b9368df4f60..609b1b3dbd7 100644 --- a/web_src/css/repo/issue-card.css +++ b/web_src/css/repo/issue-card.css @@ -1,6 +1,7 @@ .issue-card { display: flex; flex-direction: column; + gap: 4px; align-items: start; border-radius: var(--border-radius); padding: 8px 10px; @@ -17,7 +18,6 @@ .issue-card-title { flex: 1; font-size: 14px; - margin-left: 4px; } .issue-card.sortable-chosen .issue-card-title {