{{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}}
{{.locale.Tr "repo.pulls.compare_changes"}}
{{.locale.Tr "repo.pulls.compare_changes_desc"}}
{{else}}
{{.locale.Tr "action.compare_commits_general"}}
{{end}}
{{$BaseCompareName := $.BaseName -}}
{{- $HeadCompareName := $.HeadRepo.OwnerName -}}
{{- if and (eq $.BaseName $.HeadRepo.OwnerName) (ne $.Repository.Name $.HeadRepo.Name) -}}
{{- $HeadCompareName = printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}}
{{- end -}}
{{- $OwnForkCompareName := "" -}}
{{- if .OwnForkRepo -}}
{{- $OwnForkCompareName = .OwnForkRepo.OwnerName -}}
{{- end -}}
{{- $RootRepoCompareName := "" -}}
{{- if .RootRepo -}}
{{- $RootRepoCompareName = .RootRepo.OwnerName -}}
{{- if eq $.HeadRepo.OwnerName .RootRepo.OwnerName -}}
{{- $HeadCompareName = printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}}
{{- end -}}
{{- if .OwnForkRepo -}}
{{- if eq $.OwnForkRepo.OwnerName .RootRepo.OwnerName -}}
{{- $OwnForkRepoCompareName = printf "%s/%s" $.OwnForkRepo.OwnerName $.OwnForkRepo.Name -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{if .IsNothingToCompare}}
{{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived)}}
{{.locale.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}
{{template "repo/issue/new_form" .}}
{{else}}
{{.locale.Tr "repo.pulls.nothing_to_compare"}}
{{end}}
{{else if and .PageIsComparePull (gt .CommitCount 0)}}
{{if .HasPullRequest}}
{{.locale.Tr "repo.pulls.has_pull_request" (Escape $.RepoLink) (Escape $.RepoRelPath) .PullRequest.Index | Safe}}
{{RenderIssueTitle $.Context .PullRequest.Issue.Title $.RepoLink $.Repository.ComposeMetas}} #{{.PullRequest.Issue.Index}}
{{- if .PullRequest.HasMerged -}}
{{svg "octicon-git-merge" 16}} {{.locale.Tr "repo.pulls.view"}}
{{else if .Issue.IsClosed}}
{{svg "octicon-issue-closed" 16}} {{.locale.Tr "repo.pulls.view"}}
{{else}}
{{svg "octicon-git-pull-request" 16}} {{.locale.Tr "repo.pulls.view"}}
{{end}}
{{template "repo/issue/new_form" .}}
{{end}}
{{template "repo/commits_table" .}}
{{template "repo/diff/box" .}}
{{end}}
{{else}}
{{template "repo/commits_table" .}}
{{template "repo/diff/box" .}}
{{end}}