{{if .Flash}}
{{template "base/alert" .}}
{{end}}
{{$canEditIssueTitle := and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}}

{{ctx.RenderUtils.RenderIssueTitle .Issue.Title ($.Repository.ComposeMetas ctx) | RenderCodeBlock}} #{{.Issue.Index}}

{{if $canEditIssueTitle}} {{end}} {{if not .Issue.IsPull}} {{ctx.Locale.Tr "repo.issues.new"}} {{end}}
{{if $canEditIssueTitle}}
{{end}}
{{if .HasMerged}}
{{svg "octicon-git-merge" 16 "tw-mr-1"}} {{if eq .Issue.PullRequest.Status 3}}{{ctx.Locale.Tr "repo.pulls.manually_merged"}}{{else}}{{ctx.Locale.Tr "repo.pulls.merged"}}{{end}}
{{else if .Issue.IsClosed}}
{{svg (Iif .Issue.IsPull "octicon-git-pull-request" "octicon-issue-closed")}} {{ctx.Locale.Tr "repo.issues.closed_title"}}
{{else if .Issue.IsPull}} {{if .IsPullWorkInProgress}}
{{svg "octicon-git-pull-request-draft"}} {{ctx.Locale.Tr "repo.issues.draft_title"}}
{{else}}
{{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.issues.open_title"}}
{{end}} {{else}}
{{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues.open_title"}}
{{end}}
{{if .Issue.IsPull}} {{$headHref := .HeadTarget}} {{if .HeadBranchLink}} {{$headHref = HTMLFormat `%s ` .HeadBranchLink $headHref (ctx.Locale.Tr "copy_branch") .HeadTarget (svg "octicon-copy" 14)}} {{else}} {{if .Issue.PullRequest.IsAgitFlow}} {{$headHref = HTMLFormat `%s AGit` $headHref "https://docs.gitea.com/usage/agit" (ctx.Locale.Tr "repo.pull.agit_documentation")}} {{else}} {{$headHref = HTMLFormat `%s` (ctx.Locale.Tr "form.target_branch_not_exist") $headHref}} {{end}} {{end}} {{$baseHref := .BaseTarget}} {{if .BaseBranchLink}} {{if .BaseBranchNotExist}} {{$baseHref = HTMLFormat `%s` (ctx.Locale.Tr "form.target_branch_not_exist") $baseHref}} {{else}} {{$baseHref = HTMLFormat `%s` .BaseBranchLink $baseHref}} {{end}} {{end}} {{if .Issue.PullRequest.HasMerged}} {{$mergedStr:= DateUtils.TimeSince .Issue.PullRequest.MergedUnix}} {{if .Issue.OriginalAuthor}} {{.Issue.OriginalAuthor}} {{ctx.Locale.Tr "repo.pulls.merged_title_desc" .NumCommits $headHref $baseHref $mergedStr}} {{else}} {{.Issue.PullRequest.Merger.GetDisplayName}} {{ctx.Locale.Tr "repo.pulls.merged_title_desc" .NumCommits $headHref $baseHref $mergedStr}} {{end}} {{else}} {{if .Issue.OriginalAuthor}} {{.Issue.OriginalAuthor}} {{ctx.Locale.Tr "repo.pulls.title_desc" .NumCommits $headHref $baseHref}} {{else}} {{.Issue.Poster.GetDisplayName}} {{ctx.Locale.Tr "repo.pulls.title_desc" .NumCommits $headHref $baseHref}} {{end}} {{svg "octicon-arrow-right"}} {{end}} {{else}} {{$createdStr:= DateUtils.TimeSince .Issue.CreatedUnix}} {{if .Issue.OriginalAuthor}} {{ctx.Locale.Tr "repo.issues.opened_by_fake" $createdStr .Issue.OriginalAuthor}} {{else if gt .Issue.Poster.ID 0}} {{ctx.Locale.Tr "repo.issues.opened_by" $createdStr .Issue.Poster.HomeLink .Issue.Poster.GetDisplayName}} {{else}} {{ctx.Locale.Tr "repo.issues.opened_by_fake" $createdStr .Issue.Poster.GetDisplayName}} {{end}} ยท {{ctx.Locale.TrN .Issue.NumComments "repo.issues.num_comments_1" "repo.issues.num_comments" .Issue.NumComments}} {{end}}