{{template "base/alert" .}}
{{if .Repository.IsArchived}}
{{if .Repository.ArchivedUnix.IsZero}}
{{ctx.Locale.Tr "repo.archive.title"}}
{{else}}
{{ctx.Locale.Tr "repo.archive.title_date" (DateUtils.AbsoluteLong .Repository.ArchivedUnix)}}
{{end}}
{{end}}
{{template "repo/code/recently_pushed_new_branches" .}}
{{if $hasTreeSidebar}}
{{template "repo/view_file_tree_sidebar" .}}
{{end}}
{{template "repo/sub_menu" .}}
{{if $showSidebar}}
{{template "repo/home_sidebar_top" .}}
{{template "repo/home_sidebar_bottom" .}}
{{end}}
{{if $hasTreeSidebar}}
{{end}}
{{template "repo/home_branch_dropdown" (dict "ctxData" . "containerClasses" (Iif $hasAndShowTreeSidebar "tw-hidden" ""))}}
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
{{$cmpBranch := ""}}
{{if ne .Repository.ID .BaseRepo.ID}}
{{$cmpBranch = printf "%s/%s:" (.Repository.OwnerName|PathEscape) (.Repository.Name|PathEscape)}}
{{end}}
{{$cmpBranch = print $cmpBranch (.BranchName|PathEscapeSegments)}}
{{$compareLink := printf "%s/compare/%s...%s" .BaseRepo.Link (.BaseRepo.DefaultBranch|PathEscapeSegments) $cmpBranch}}
{{svg "octicon-git-pull-request"}}
{{end}}
{{if $isTreePathRoot}}
{{ctx.Locale.Tr "repo.find_file.go_to_file"}}
{{end}}
{{if and .CanWriteCode .IsViewBranch (not .Repository.IsMirror) (not .Repository.IsArchived) (not .IsViewFile)}}
{{end}}
{{if and $isTreePathRoot .Repository.IsTemplate}}
{{ctx.Locale.Tr "repo.use_template"}}
{{end}}
{{if not $isTreePathRoot}}
{{$treeNameIdxLast := Eval $treeNamesLen "-" 1}}
{{StringUtils.EllipsisString .Repository.Name 30}}
{{- range $i, $v := .TreeNames -}}
/
{{- if eq $i $treeNameIdxLast -}}
{{$v}}
{{- else -}}
{{$p := index $.Paths $i}}{{$v}}
{{- end -}}
{{- end -}}
{{end}}
{{if $isTreePathRoot}}
{{template "repo/clone_panel" .}}
{{end}}
{{if and (not $isTreePathRoot) (not .IsViewFile) (not .IsBlame)}}{{/* IsViewDirectory (not home), TODO: split the templates, avoid using "if" tricks */}}
{{svg "octicon-history" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.file_history"}}
{{end}}
{{template "repo/home_content" .}}