Skip to content

Commit b93c87b

Browse files
silverwindKN4CK3R
andauthored
Issue card improvements (#30687)
Fixes #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 <img width="406" alt="Screenshot 2024-04-24 at 20 21 20" src="https://github.com/go-gitea/gitea/assets/115237/2fa88707-c2c4-40df-aee7-a684c3097ed0"> --------- Co-authored-by: KN4CK3R <[email protected]>
1 parent 51c28d9 commit b93c87b

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

templates/repo/issue/card.tmpl

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{{with .Issue}}
22
{{if eq $.Page.Project.CardType 1}}{{/* Images and Text*/}}
3+
{{$attachments := index $.Page.issuesAttachmentMap .ID}}
4+
{{if $attachments}}
35
<div class="card-attachment-images">
4-
{{range (index $.Page.issuesAttachmentMap .ID)}}
6+
{{range $attachments}}
57
<img src="{{.DownloadURL}}" alt="{{.Name}}" />
68
{{end}}
79
</div>
10+
{{end}}
811
{{end}}
9-
<div class="content tw-p-0 tw-w-full">
10-
<div class="tw-flex tw-items-start">
12+
<div class="content tw-w-full">
13+
<div class="tw-flex tw-items-start tw-gap-[5px]">
1114
<div class="issue-card-icon">
1215
{{template "shared/issueicon" .}}
1316
</div>
@@ -18,7 +21,7 @@
1821
</a>
1922
{{end}}
2023
</div>
21-
<div class="meta tw-my-1">
24+
<div class="meta">
2225
<span class="text light grey muted-links">
2326
{{if not $.Page.Repository}}{{.Repo.FullName}}{{end}}#{{.Index}}
2427
{{$timeStr := TimeSinceUnix .GetLastEventTimestamp ctx.Locale}}
@@ -59,13 +62,15 @@
5962
</div>
6063

6164
{{if or .Labels .Assignees}}
62-
<div class="extra content labels-list tw-p-0 tw-pt-1">
63-
{{range .Labels}}
64-
<a target="_blank" href="{{$.Issue.Repo.Link}}/issues?labels={{.ID}}">{{RenderLabel ctx ctx.Locale .}}</a>
65-
{{end}}
66-
<div class="right floated">
65+
<div class="tw-flex tw-justify-between">
66+
<div class="labels-list tw-flex-1">
67+
{{range .Labels}}
68+
<a target="_blank" href="{{$.Issue.Repo.Link}}/issues?labels={{.ID}}">{{RenderLabel ctx ctx.Locale .}}</a>
69+
{{end}}
70+
</div>
71+
<div class="tw-flex tw-flex-wrap tw-content-start tw-gap-1">
6772
{{range .Assignees}}
68-
<a target="_blank" href="{{.HomeLink}}" data-tooltip-content="{{ctx.Locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{ctx.AvatarUtils.Avatar . 28 "mini tw-mr-2"}}</a>
73+
<a target="_blank" href="{{.HomeLink}}" data-tooltip-content="{{ctx.Locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{ctx.AvatarUtils.Avatar . 28}}</a>
6974
{{end}}
7075
</div>
7176
</div>

web_src/css/repo/issue-card.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.issue-card {
22
display: flex;
33
flex-direction: column;
4+
gap: 4px;
45
align-items: start;
56
border-radius: var(--border-radius);
67
padding: 8px 10px;
@@ -17,7 +18,6 @@
1718
.issue-card-title {
1819
flex: 1;
1920
font-size: 14px;
20-
margin-left: 4px;
2121
}
2222

2323
.issue-card.sortable-chosen .issue-card-title {

0 commit comments

Comments
 (0)