Skip to content

Commit ad9b126

Browse files
committed
fix
1 parent 2a8f9c8 commit ad9b126

File tree

3 files changed

+20
-29
lines changed

3 files changed

+20
-29
lines changed

templates/repo/home.tmpl

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,7 @@
3737
{{svg "octicon-sidebar-collapse" 20 "icon"}}
3838
</button>
3939
{{end}}
40-
{{$branchDropdownCurrentRefType := "branch"}}
41-
{{$branchDropdownCurrentRefShortName := .BranchName}}
42-
{{if .IsViewTag}}
43-
{{$branchDropdownCurrentRefType = "tag"}}
44-
{{$branchDropdownCurrentRefShortName = .TagName}}
45-
{{end}}
46-
{{template "repo/branch_dropdown" dict
47-
"Repository" .Repository
48-
"ShowTabBranches" true
49-
"ShowTabTags" true
50-
"CurrentRefType" $branchDropdownCurrentRefType
51-
"CurrentRefShortName" $branchDropdownCurrentRefShortName
52-
"CurrentTreePath" .TreePath
53-
"RefLinkTemplate" "{RepoLink}/src/{RefType}/{RefShortName}/{TreePath}"
54-
"AllowCreateNewRef" .CanCreateBranch
55-
"ShowViewAllRefsEntry" true
56-
"ContainerClasses" (Iif $hasAndShowTreeSidebar "tw-hidden" "")
57-
}}
40+
{{template "repo/home_branch_dropdown" (dict "ctxData" . "containerClasses" (Iif $hasAndShowTreeSidebar "tw-hidden" ""))}}
5841
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
5942
{{$cmpBranch := ""}}
6043
{{if ne .Repository.ID .BaseRepo.ID}}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{$branchDropdownCurrentRefType := "branch"}}
2+
{{$branchDropdownCurrentRefShortName := .ctxData.BranchName}}
3+
{{if .ctxData.IsViewTag}}
4+
{{$branchDropdownCurrentRefType = "tag"}}
5+
{{$branchDropdownCurrentRefShortName = .ctxData.TagName}}
6+
{{end}}
7+
{{template "repo/branch_dropdown" dict
8+
"Repository" .ctxData.Repository
9+
"ShowTabBranches" true
10+
"ShowTabTags" true
11+
"CurrentRefType" $branchDropdownCurrentRefType
12+
"CurrentRefShortName" $branchDropdownCurrentRefShortName
13+
"CurrentTreePath" .ctxData.TreePath
14+
"RefLinkTemplate" "{RepoLink}/src/{RefType}/{RefShortName}/{TreePath}"
15+
"AllowCreateNewRef" .ctxData.CanCreateBranch
16+
"ShowViewAllRefsEntry" true
17+
"ContainerClasses" .containerClasses
18+
}}

templates/repo/view_file_tree_sidebar.tmpl

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,7 @@
1313
<b> Files</b>
1414
</div>
1515
<div class="sidebar-ref">
16-
{{template "repo/branch_dropdown" dict
17-
"Repository" .Repository
18-
"ShowTabBranches" true
19-
"ShowTabTags" true
20-
"CurrentRefType" $branchDropdownCurrentRefType
21-
"CurrentRefShortName" $branchDropdownCurrentRefShortName
22-
"CurrentTreePath" .TreePath
23-
"RefLinkTemplate" "{RepoLink}/src/{RefType}/{RefShortName}/{TreePath}"
24-
"AllowCreateNewRef" .CanCreateBranch
25-
"ShowViewAllRefsEntry" true
26-
}}
16+
{{template "repo/home_branch_dropdown" (dict "ctxData" .)}}
2717

2818
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
2919
{{$cmpBranch := ""}}

0 commit comments

Comments
 (0)