Skip to content

Commit 34dc5b1

Browse files
committed
Merge branch 'main' into add-file-tree-to-file-view-page
1 parent 335375f commit 34dc5b1

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

templates/repo/home_branch_dropdown.tmpl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
{{$branchDropdownCurrentRefType := "branch"}}
2-
{{$branchDropdownCurrentRefShortName := .ctxData.BranchName}}
3-
{{if .ctxData.IsViewTag}}
4-
{{$branchDropdownCurrentRefType = "tag"}}
5-
{{$branchDropdownCurrentRefShortName = .ctxData.TagName}}
6-
{{end}}
1+
{{- /* for repo home (default branch) and /owner/repo/src/branch/the-name */ -}}
2+
{{- $branchDropdownCurrentRefType := "branch" -}}
3+
{{- $branchDropdownCurrentRefShortName := .ctxData.BranchName -}}
4+
{{- if .IsViewTag -}}
5+
{{- /* for /owner/repo/src/tag/the-name */ -}}
6+
{{- $branchDropdownCurrentRefType = "tag" -}}
7+
{{- $branchDropdownCurrentRefShortName = .ctxData.TagName -}}
8+
{{- else if .IsViewCommit -}}
9+
{{- /* for /owner/repo/src/commit/000000 */ -}}
10+
{{- $branchDropdownCurrentRefType = "commit" -}}
11+
{{- $branchDropdownCurrentRefShortName = ShortSha .ctxData.CommitID -}}
12+
{{- end -}}
713
{{template "repo/branch_dropdown" dict
814
"Repository" .ctxData.Repository
915
"ShowTabBranches" true

templates/repo/view_file_tree_sidebar.tmpl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
{{$branchDropdownCurrentRefType := "branch"}}
2-
{{$branchDropdownCurrentRefShortName := .BranchName}}
3-
{{if .IsViewTag}}
4-
{{$branchDropdownCurrentRefType = "tag"}}
5-
{{$branchDropdownCurrentRefShortName = .TagName}}
6-
{{end}}
1+
{{- /* for repo home (default branch) and /owner/repo/src/branch/the-name */ -}}
2+
{{- $branchDropdownCurrentRefType := "branch" -}}
3+
{{- $branchDropdownCurrentRefShortName := .BranchName -}}
4+
{{- if .IsViewTag -}}
5+
{{- /* for /owner/repo/src/tag/the-name */ -}}
6+
{{- $branchDropdownCurrentRefType = "tag" -}}
7+
{{- $branchDropdownCurrentRefShortName = .TagName -}}
8+
{{- else if .IsViewCommit -}}
9+
{{- /* for /owner/repo/src/commit/000000 */ -}}
10+
{{- $branchDropdownCurrentRefType = "commit" -}}
11+
{{- $branchDropdownCurrentRefShortName = ShortSha .CommitID -}}
12+
{{- end -}}
713

814
<div class="view-file-tree-sidebar-top">
915
<div class="sidebar-header">

0 commit comments

Comments
 (0)