{{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}}
{{ctx.Locale.Tr "repo.compare.title"}}
{{ctx.Locale.Tr "repo.compare.description"}}
{{else}}
{{ctx.Locale.Tr "action.compare_commits_general"}}
{{end}}
{{template "base/alert" .}}
{{$BaseCompareName := $.Repository.FullName -}}
{{$HeadCompareName := $.HeadRepo.FullName -}}
{{$OwnForkCompareName := "" -}}
{{if $.OwnForkRepo -}}
{{$OwnForkCompareName = $.OwnForkRepo.FullName -}}
{{end -}}
{{$RootRepoCompareName := "" -}}
{{if $.RootRepo -}}
{{$RootRepoCompareName = $.RootRepo.FullName -}}
{{end -}}
{{$showDiffBox := and .CommitCount (not .IsNothingToCompare)}}
{{if and .IsSigned .PageIsComparePull}}
{{$allowCreatePR := and ($.CompareInfo.BaseRef.IsBranch) ($.CompareInfo.HeadRef.IsBranch) (not $.CompareInfo.DirectComparison) (or $.AllowEmptyPr (not .IsNothingToCompare))}}
{{if .IsNothingToCompare}}
{{if $allowCreatePR}}
{{ctx.Locale.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}
{{else if and $.CompareInfo.BaseRef.IsBranch $.CompareInfo.HeadRef.IsBranch}}
{{ctx.Locale.Tr "repo.pulls.nothing_to_compare"}}
{{else}}
{{ctx.Locale.Tr "repo.pulls.nothing_to_compare_have_tag"}}
{{end}}
{{end}}
{{if .HasPullRequest}}
{{template "shared/issueicon" .}}
{{else if .Repository.IsArchived}}
{{else if $allowCreatePR}}
{{ctx.RenderUtils.RenderIssueTitle .PullRequest.Issue.Title $.Repository}}
#{{.PullRequest.Issue.Index}}
{{ctx.Locale.Tr "repo.pulls.view"}}
{{template "repo/issue/new_form" .}}
{{end}}
{{else}}{{/* not signed-in or not for pull-request */}}
{{if and (not .CommitCount) $.CompareInfo.CompareBase}}
{{ctx.Locale.Tr "repo.commits.nothing_to_compare"}}
{{end}}
{{end}}
{{template "repo/commits_table" .}}
{{template "repo/diff/box" .}}
{{end}}