Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue card improvements #30687

Merged
merged 5 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions templates/repo/issue/card.tmpl
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{{with .Issue}}
{{if eq $.Page.Project.CardType 1}}{{/* Images and Text*/}}
{{$attachmentIDs := index $.Page.issuesAttachmentMap .ID}}
{{if $attachmentIDs}}
silverwind marked this conversation as resolved.
Show resolved Hide resolved
<div class="card-attachment-images">
{{range (index $.Page.issuesAttachmentMap .ID)}}
{{range $attachmentIDs}}
silverwind marked this conversation as resolved.
Show resolved Hide resolved
<img src="{{.DownloadURL}}" alt="{{.Name}}" />
{{end}}
</div>
{{end}}
{{end}}
<div class="content tw-p-0 tw-w-full">
<div class="tw-flex tw-items-start">
<div class="content tw-w-full">
<div class="tw-flex tw-items-start tw-gap-[5px]">
<div class="issue-card-icon">
{{template "shared/issueicon" .}}
</div>
Expand All @@ -18,7 +21,7 @@
</a>
{{end}}
</div>
<div class="meta tw-my-1">
<div class="meta">
<span class="text light grey muted-links">
{{if not $.Page.Repository}}{{.Repo.FullName}}{{end}}#{{.Index}}
{{$timeStr := TimeSinceUnix .GetLastEventTimestamp ctx.Locale}}
Expand Down Expand Up @@ -59,13 +62,15 @@
</div>

{{if or .Labels .Assignees}}
<div class="extra content labels-list tw-p-0 tw-pt-1">
{{range .Labels}}
<a target="_blank" href="{{$.Issue.Repo.Link}}/issues?labels={{.ID}}">{{RenderLabel ctx ctx.Locale .}}</a>
{{end}}
<div class="right floated">
<div class="tw-flex tw-justify-between">
<div class="labels-list tw-flex-1">
{{range .Labels}}
<a target="_blank" href="{{$.Issue.Repo.Link}}/issues?labels={{.ID}}">{{RenderLabel ctx ctx.Locale .}}</a>
{{end}}
</div>
<div class="tw-flex tw-flex-wrap tw-content-start tw-gap-1">
{{range .Assignees}}
<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>
<a target="_blank" href="{{.HomeLink}}" data-tooltip-content="{{ctx.Locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{ctx.AvatarUtils.Avatar . 28}}</a>
{{end}}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion web_src/css/repo/issue-card.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.issue-card {
display: flex;
flex-direction: column;
gap: 4px;
align-items: start;
border-radius: var(--border-radius);
padding: 8px 10px;
Expand All @@ -17,7 +18,6 @@
.issue-card-title {
flex: 1;
font-size: 14px;
margin-left: 4px;
}

.issue-card.sortable-chosen .issue-card-title {
Expand Down