{{template "repo/issue/view_content/sidebar/branch_selector_field" .}} {{if .Issue.IsPull}} {{template "repo/issue/view_content/sidebar/pull_review" .}} {{template "repo/issue/view_content/sidebar/pull_wip" .}}
{{end}} {{template "repo/issue/labels/labels_selector_field" .}} {{template "repo/issue/labels/labels_sidebar" dict "root" $}}
{{template "repo/issue/view_content/sidebar/milestones" .}}
{{template "repo/issue/view_content/sidebar/projects" .}}
{{template "repo/issue/view_content/sidebar/assignees" .}}
{{if .Participants}} {{template "repo/issue/view_content/sidebar/participants" .}} {{end}} {{if and $.IssueWatch (not .Repository.IsArchived)}}
{{template "repo/issue/view_content/sidebar/watch" .}} {{end}} {{if .Repository.IsTimetrackerEnabled $.Context}} {{template "repo/issue/view_content/sidebar/timetracking" .}} {{end}}
{{template "repo/issue/view_content/sidebar/due_deadline" .}} {{if .Repository.IsDependenciesEnabled $.Context}}
{{if (and (not .BlockedByDependencies) (not .BlockedByDependenciesNotPermitted) (not .BlockingDependencies) (not .BlockingDependenciesNotPermitted))}} {{ctx.Locale.Tr "repo.issues.dependency.title"}}

{{if .Issue.IsPull}} {{ctx.Locale.Tr "repo.issues.dependency.pr_no_dependencies"}} {{else}} {{ctx.Locale.Tr "repo.issues.dependency.issue_no_dependencies"}} {{end}}

{{end}} {{if or .BlockingDependencies .BlockingDependenciesNotPermitted}} {{ctx.Locale.Tr "repo.issues.dependency.blocks_short"}}
{{range .BlockingDependencies}}
#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
{{.Repository.OwnerName}}/{{.Repository.Name}}
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} {{svg "octicon-trash" 16}} {{end}}
{{end}} {{if .BlockingDependenciesNotPermitted}}
{{ctx.Locale.TrN (len .BlockingDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockingDependenciesNotPermitted)}}
{{end}}
{{end}} {{if or .BlockedByDependencies .BlockedByDependenciesNotPermitted}} {{ctx.Locale.Tr "repo.issues.dependency.blocked_by_short"}}
{{range .BlockedByDependencies}}
#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
{{.Repository.OwnerName}}/{{.Repository.Name}}
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} {{svg "octicon-trash" 16}} {{end}}
{{end}} {{if $.CanCreateIssueDependencies}} {{range .BlockedByDependenciesNotPermitted}}
{{svg "octicon-lock" 16}} #{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
{{.Repository.OwnerName}}/{{.Repository.Name}}
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} {{svg "octicon-trash" 16}} {{end}}
{{end}} {{else if .BlockedByDependenciesNotPermitted}}
{{ctx.Locale.TrN (len .BlockedByDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockedByDependenciesNotPermitted)}}
{{end}}
{{end}} {{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}}
{{$.CsrfTokenHtml}}
{{end}}
{{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}} {{end}} {{end}}
{{$issueReferenceLink := printf "%s#%d" .Issue.Repo.FullName .Issue.Index}}
{{ctx.Locale.Tr "repo.issues.reference_link" $issueReferenceLink}}
{{if and .IsRepoAdmin (not .Repository.IsArchived)}}
{{if or .PinEnabled .Issue.IsPinned}}
{{$.CsrfTokenHtml}}
{{end}} {{end}} {{if and .Issue.IsPull .IsIssuePoster (not .Issue.IsClosed) .Issue.PullRequest.HeadRepo}} {{if and (not (eq .Issue.PullRequest.HeadRepo.FullName .Issue.PullRequest.BaseRepo.FullName)) .CanWriteToHeadRepo}}
{{end}} {{end}}