Skip to content

Commit

Permalink
Issue card improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
silverwind committed Apr 24, 2024
1 parent a19d2bb commit 4dc4e22
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
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}}
<div class="card-attachment-images">
{{range (index $.Page.issuesAttachmentMap .ID)}}
{{range $attachmentIDs}}
<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

0 comments on commit 4dc4e22

Please sign in to comment.