|
5 | 5 | {{template "repo/sub_menu" .}} |
6 | 6 | <div class="repo-button-row"> |
7 | 7 | <div class="repo-button-row-left"> |
8 | | - |
9 | | - {{$branchDropdownCurrentRefType := "branch"}} |
10 | | - {{$branchDropdownCurrentRefShortName := .RefName}} |
11 | | - {{if .IsViewTag}} |
12 | | - {{$branchDropdownCurrentRefType = "tag"}} |
13 | | - {{$branchDropdownCurrentRefShortName = .TagName}} |
14 | | - {{else if not .IsViewBranch}} |
15 | | - {{$branchDropdownCurrentRefShortName = ShortSha .RefName}} |
16 | | - {{end}} |
17 | | - {{template "repo/branch_dropdown" dict |
| 8 | + {{- /* for /owner/repo/commits/branch/the-name */ -}} |
| 9 | + {{- $branchDropdownCurrentRefType := "branch" -}} |
| 10 | + {{- $branchDropdownCurrentRefShortName := .BranchName -}} |
| 11 | + {{- if .IsViewTag -}} |
| 12 | + {{- /* for /owner/repo/commits/tag/the-name */ -}} |
| 13 | + {{- $branchDropdownCurrentRefType = "tag" -}} |
| 14 | + {{- $branchDropdownCurrentRefShortName = .TagName -}} |
| 15 | + {{- else if .IsViewCommit -}} |
| 16 | + {{- /* for /owner/repo/commits/commit/000000 */ -}} |
| 17 | + {{- $branchDropdownCurrentRefType = "commit" -}} |
| 18 | + {{- $branchDropdownCurrentRefShortName = ShortSha .CommitID -}} |
| 19 | + {{- end -}} |
| 20 | + {{- template "repo/branch_dropdown" dict |
18 | 21 | "Repository" .Repository |
19 | 22 | "ShowTabBranches" true |
20 | 23 | "ShowTabTags" true |
|
23 | 26 | "CurrentTreePath" .TreePath |
24 | 27 | "RefLinkTemplate" "{RepoLink}/commits/{RefType}/{RefShortName}/{TreePath}" |
25 | 28 | "AllowCreateNewRef" .CanCreateBranch |
26 | | - }} |
27 | | - |
| 29 | + -}} |
28 | 30 | <a href="{{.RepoLink}}/graph" class="ui basic small compact button"> |
29 | 31 | {{svg "octicon-git-branch"}} |
30 | 32 | {{ctx.Locale.Tr "repo.commit_graph"}} |
|
0 commit comments