{{template "repo/header" .}}
{{template "base/alert" .}} {{template "repo/sub_menu" .}} {{if .DefaultBranchBranch}}

{{.locale.Tr "repo.default_branch"}} {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} {{svg "octicon-arrow-switch"}} {{end}}

{{if .DefaultBranchBranch.IsProtected}} {{svg "octicon-shield-lock"}} {{end}} {{.DefaultBranchBranch.DBBranch.Name}}

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink .Repository.ComposeMetas}} · {{.locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime .locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "Context" $.Context "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}

{{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} {{end}} {{if .EnableFeed}} {{svg "octicon-rss"}} {{end}} {{if not $.DisableDownloadSourceArchives}} {{end}} {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted) (not $.IsMirror)}} {{end}}
{{end}} {{if .Branches}}

{{.locale.Tr "repo.branches"}}

{{range .Branches}} {{end}}
{{if .DBBranch.IsDeleted}} {{.DBBranch.Name}}

{{$.locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{TimeSinceUnix .DBBranch.DeletedUnix $.locale}}

{{else}} {{if .IsProtected}} {{svg "octicon-shield-lock"}} {{end}} {{.DBBranch.Name}}

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink $.Repository.ComposeMetas}} · {{$.locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime $.locale}}{{if .DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "Context" $.Context "user" .DBBranch.Pusher}}  {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}

{{end}}
{{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}}
{{.CommitsBehind}}
{{/* old code bears 0/0.0 = NaN output, so it might output invalid "width: NaNpx", it just works and doesn't caues any problem. */}}
{{.CommitsAhead}}
{{end}}
{{if not .LatestPullRequest}} {{if .IsIncluded}} {{svg "octicon-git-pull-request"}} {{$.locale.Tr "repo.branch.included"}} {{else if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}} {{end}} {{else if and .LatestPullRequest.HasMerged .MergeMovedOn}} {{if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}} {{end}} {{else}} {{if not .LatestPullRequest.IsSameRepo}}{{.LatestPullRequest.BaseRepo.FullName}}{{end}}#{{.LatestPullRequest.Issue.Index}} {{if .LatestPullRequest.HasMerged}} {{svg "octicon-git-merge" 16 "gt-mr-2"}}{{$.locale.Tr "repo.pulls.merged"}} {{else if .LatestPullRequest.Issue.IsClosed}} {{svg "octicon-git-pull-request" 16 "gt-mr-2"}}{{$.locale.Tr "repo.issues.closed_title"}} {{else}} {{svg "octicon-git-pull-request" 16 "gt-mr-2"}}{{$.locale.Tr "repo.issues.open_title"}} {{end}} {{end}} {{if and $.IsWriter (not $.Repository.IsArchived) (not .DBBranch.IsDeleted)}} {{end}} {{if $.EnableFeed}} {{svg "octicon-rss"}} {{end}} {{if and (not .DBBranch.IsDeleted) (not $.DisableDownloadSourceArchives)}} {{end}} {{if and $.IsWriter (not $.Repository.IsArchived) (not .DBBranch.IsDeleted) (not $.IsMirror)}} {{end}} {{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived) (not .IsProtected)}} {{if .DBBranch.IsDeleted}} {{else}} {{end}} {{end}}
{{template "base/paginate" .}} {{end}}