{{template "repo/header" .}} -
+
{{template "base/alert" .}} {{if .Repository.IsArchived}} @@ -22,9 +17,9 @@ {{template "repo/code/recently_pushed_new_branches" .}} -
- {{if $hasTreeSidebar}} -
{{template "repo/view_file_tree_sidebar" .}}
+
+ {{if .TreeNames}} +
{{template "repo/view_file_tree_sidebar" .}}
{{end}}
diff --git a/templates/repo/home_content.tmpl b/templates/repo/home_content.tmpl index 881a9de1a4d66..291ceb50cdca7 100644 --- a/templates/repo/home_content.tmpl +++ b/templates/repo/home_content.tmpl @@ -1,14 +1,11 @@ -{{$treeNamesLen := len .TreeNames}} -{{$isTreePathRoot := eq $treeNamesLen 0}} +{{$isTreePathRoot := not .TreeNames}} {{$showSidebar := and $isTreePathRoot (not .HideRepoInfo) (not .IsBlame)}} -{{$hasTreeSidebar := not $isTreePathRoot}} -{{$showTreeSidebar := .RepoPreferences.ShowFileViewTreeSidebar}} {{template "repo/sub_menu" .}}
- {{if $hasTreeSidebar}} - {{end}} @@ -58,7 +55,7 @@ {{end}} {{if not $isTreePathRoot}} - {{$treeNameIdxLast := Eval $treeNamesLen "-" 1}} + {{$treeNameIdxLast := Eval (len .TreeNames) "-" 1}} {{StringUtils.EllipsisString .Repository.Name 30}} {{- range $i, $v := .TreeNames -}}