forked from NYANDEV/forgejo
a98cc429c7
- Don't expect that rendering is done on a repository, use the given issue to figure out the repository link. - Resolves https://codeberg.org/forgejo/forgejo/issues/1321 (cherry picked from commit 63f16652ca21809d2e088c46ddb88b84c08a5ad6) (cherry picked from commit 821785d0af2fc2a41997675fc2809e1e45c0cdd8) (cherry picked from commit 345742a0dc2b505a5bdc0747d4e2cda7136e735d) (cherry picked from commit 2a37b91d7ced112b06d04950a9970cbd2d52f0f2) (cherry picked from commit 9d40b409d715d336f68ec6306d8a928c171c85fc) (cherry picked from commit c4c377e73312f36111d5f874195c9aebbb9c8635) (cherry picked from commit dc149daafefcd4bf8cbb26fee70b78cf35d301d2) (cherry picked from commit 418b0ff439dfb44ee7e6110cffbabe3426719163)
73 lines
2.8 KiB
Go HTML Template
73 lines
2.8 KiB
Go HTML Template
{{with .Issue}}
|
|
{{if eq $.Page.Project.CardType 1}}{{/* Images and Text*/}}
|
|
<div class="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="gt-df gt-items-start">
|
|
<div class="issue-card-icon">
|
|
{{template "shared/issueicon" .}}
|
|
</div>
|
|
<a class="issue-card-title muted issue-title" href="{{.Link}}">{{.Title | RenderEmoji ctx | RenderCodeBlock}}</a>
|
|
{{if and $.isPinnedIssueCard $.Page.IsRepoAdmin}}
|
|
<a role="button" class="issue-card-unpin muted gt-df gt-ac" data-tooltip-content={{ctx.Locale.Tr "repo.issues.unpin_issue"}} data-issue-id="{{.ID}}" data-unpin-url="{{$.Page.Link}}/unpin/{{.Index}}">
|
|
{{svg "octicon-x" 16}}
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
<div class="meta gt-my-2">
|
|
<span class="text light grey muted-links">
|
|
{{if not $.Page.Repository}}{{.Repo.FullName}}{{end}}#{{.Index}}
|
|
{{$timeStr := TimeSinceUnix .GetLastEventTimestamp ctx.Locale}}
|
|
{{if .OriginalAuthor}}
|
|
{{ctx.Locale.Tr .GetLastEventLabelFake $timeStr (.OriginalAuthor|Escape) | Safe}}
|
|
{{else if gt .Poster.ID 0}}
|
|
{{ctx.Locale.Tr .GetLastEventLabel $timeStr (.Poster.HomeLink|Escape) (.Poster.GetDisplayName | Escape) | Safe}}
|
|
{{else}}
|
|
{{ctx.Locale.Tr .GetLastEventLabelFake $timeStr (.Poster.GetDisplayName | Escape) | Safe}}
|
|
{{end}}
|
|
</span>
|
|
</div>
|
|
{{if .MilestoneID}}
|
|
<div class="meta gt-my-2">
|
|
<a class="milestone" href="{{.Repo.Link}}/milestone/{{.MilestoneID}}">
|
|
{{svg "octicon-milestone" 16 "gt-mr-2 gt-vm"}}
|
|
<span class="gt-vm">{{.Milestone.Name}}</span>
|
|
</a>
|
|
</div>
|
|
{{end}}
|
|
{{if $.Page.LinkedPRs}}
|
|
{{range index $.Page.LinkedPRs .ID}}
|
|
<div class="meta gt-my-2">
|
|
<a href="{{$.Issue.Repo.Link}}/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>
|
|
</a>
|
|
</div>
|
|
{{end}}
|
|
{{end}}
|
|
{{$tasks := .GetTasks}}
|
|
{{if gt $tasks 0}}
|
|
<div class="meta gt-my-2">
|
|
{{svg "octicon-checklist" 16 "gt-mr-2 gt-vm"}}
|
|
<span class="gt-vm">{{.GetTasksDone}} / {{$tasks}}</span>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
|
|
{{if or .Labels .Assignees}}
|
|
<div class="extra content labels-list gt-p-0 gt-pt-2">
|
|
{{range .Labels}}
|
|
<a target="_blank" href="{{$.Issue.Repo.Link}}/issues?labels={{.ID}}">{{RenderLabel ctx .}}</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}}
|