-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Improve issue card #26561
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
Improve issue card #26561
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{{with .Issue}} | ||
{{if eq $.Page.Project.CardType 1}}{{/* Images and Text*/}} | ||
<div class="card-attachment-images"> | ||
<div class="issue-card-content card-attachment-images"> | ||
{{range (index $.Page.issuesAttachmentMap .ID)}} | ||
<img src="{{.DownloadURL}}" alt="{{.Name}}" /> | ||
{{end}} | ||
</div> | ||
{{end}} | ||
<div class="content gt-p-0 gt-w-100"> | ||
<div class="issue-card-content"> | ||
<div class="gt-df gt-items-start"> | ||
<div class="issue-card-icon"> | ||
{{template "shared/issueicon" .}} | ||
|
@@ -18,7 +18,7 @@ | |
</a> | ||
{{end}} | ||
</div> | ||
<div class="meta gt-my-2"> | ||
<div class="gt-my-2"> | ||
<span class="text light grey muted-links"> | ||
{{if not $.Page.Repository}}{{.Repo.FullName}}{{end}}#{{.Index}} | ||
{{$timeStr := TimeSinceUnix .GetLastEventTimestamp ctx.Locale}} | ||
|
@@ -32,16 +32,16 @@ | |
</span> | ||
</div> | ||
{{if .MilestoneID}} | ||
<div class="meta gt-my-2"> | ||
<a class="milestone" href="{{$.Page.RepoLink}}/milestone/{{.MilestoneID}}"> | ||
<div class="ft-df gt-my-2"> | ||
<a class="sidebar-item-link muted" href="{{$.Page.RepoLink}}/milestone/{{.MilestoneID}}"> | ||
{{svg "octicon-milestone" 16 "gt-mr-2 gt-vm"}} | ||
<span class="gt-vm">{{.Milestone.Name}}</span> | ||
{{.Milestone.Name}} | ||
</a> | ||
</div> | ||
{{end}} | ||
{{if $.Page.LinkedPRs}} | ||
{{range index $.Page.LinkedPRs .ID}} | ||
<div class="meta gt-my-2"> | ||
<div class="gt-my-2"> | ||
<a href="{{$.Page.RepoLink}}/pulls/{{.Index}}"> | ||
<span class="gt-m-0 text {{if .PullRequest.HasMerged}}purple{{else if .IsClosed}}red{{else}}green{{end}}">{{svg "octicon-git-merge" 16 "gt-mr-2 gt-vm"}}</span> | ||
<span class="gt-vm">{{.Title}} <span class="text light grey">#{{.Index}}</span></span> | ||
|
@@ -51,16 +51,18 @@ | |
{{end}} | ||
</div> | ||
|
||
{{if or .Labels .Assignees}} | ||
<div class="extra content labels-list gt-p-0 gt-pt-2"> | ||
{{if .Labels}} | ||
<div class="issue-card-content labels-list"> | ||
{{range .Labels}} | ||
<a target="_blank" href="{{$.Page.RepoLink}}/issues?labels={{.ID}}">{{RenderLabel ctx .}}</a> | ||
<a {{if $.Page.PageIsProjects}}target="_blank"{{end}} href="{{$.Page.RepoLink}}/issues?labels={{.ID}}">{{RenderLabel ctx .}}</a> | ||
{{end}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not possible in this case. for _, . := range(Labels) { … } , with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ps: in other places, the "Page" variable is usually called "root" or "ctxData", which means the root context data of this request (aka: |
||
</div> | ||
{{end}} | ||
{{if .Assignees}} | ||
<div class="issue-card-content gt-df"> | ||
{{range .Assignees}} | ||
<a class="flex-text-inline" {{if $.Page.PageIsProjects}}target="_blank"{{end}} href="{{.HomeLink}}" data-tooltip-content="{{ctx.Locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{ctx.AvatarUtils.Avatar . 28 "mini gt-mr-3"}}</a> | ||
{{end}} | ||
<div class="right floated"> | ||
{{range .Assignees}} | ||
<a target="_blank" href="{{.HomeLink}}" data-tooltip-content="{{ctx.Locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{ctx.AvatarUtils.Avatar . 28 "mini gt-mr-3"}}</a> | ||
{{end}} | ||
</div> | ||
</div> | ||
{{end}} | ||
{{end}} |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -73,7 +73,8 @@ | |||||||
} | ||||||||
|
||||||||
.card-attachment-images { | ||||||||
display: inline-block; | ||||||||
display: flex; | ||||||||
flex-wrap: wrap; | ||||||||
white-space: nowrap; | ||||||||
overflow: hidden; | ||||||||
text-align: center; | ||||||||
|
@@ -82,12 +83,18 @@ | |||||||
.card-attachment-images img { | ||||||||
display: inline-block; | ||||||||
max-height: 50px; | ||||||||
max-width: 100%; | ||||||||
border-radius: var(--border-radius); | ||||||||
margin-right: 2px; | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Better to have this just in case, to ensure the image maintains aspect ratio when scaling width/height. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will fix that overlap, does require max-width: 100%;
max-height: 100%;
aspect-ratio: 1; |
||||||||
} | ||||||||
|
||||||||
.card-attachment-images img:not(:first-child) { | ||||||||
padding-top: 0.25rem; | ||||||||
} | ||||||||
|
||||||||
.card-attachment-images img:only-child { | ||||||||
max-height: 90px; | ||||||||
max-width: 100%; | ||||||||
margin: auto; | ||||||||
} | ||||||||
|
||||||||
|
Uh oh!
There was an error while loading. Please reload this page.