diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-12-02 09:41:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-02 01:41:32 +0000 |
commit | e3e32605a144076572ac55fb5053655ee045a0f9 (patch) | |
tree | 2385ecadb2caf21b147a97d6f3237e5253b223ba /templates/repo/commits.tmpl | |
parent | def13ece7c7994e014e34cdc2fc4887d1998f019 (diff) | |
download | gitea-e3e32605a144076572ac55fb5053655ee045a0f9.tar.gz gitea-e3e32605a144076572ac55fb5053655ee045a0f9.zip |
Refactor RepoBranchTagSelector (#32681)
Diffstat (limited to 'templates/repo/commits.tmpl')
-rw-r--r-- | templates/repo/commits.tmpl | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/templates/repo/commits.tmpl b/templates/repo/commits.tmpl index 6bce585774..e79f3d7751 100644 --- a/templates/repo/commits.tmpl +++ b/templates/repo/commits.tmpl @@ -5,7 +5,24 @@ {{template "repo/sub_menu" .}} <div class="repo-button-row"> <div class="repo-button-row-left"> - {{template "repo/branch_dropdown" dict "root" .}} + + {{$branchDropdownCurrentRefType := "branch"}} + {{$branchDropdownCurrentRefShortName := .BranchName}} + {{if .IsViewTag}} + {{$branchDropdownCurrentRefType := "tag"}} + {{$branchDropdownCurrentRefShortName := .TagName}} + {{end}} + {{template "repo/branch_dropdown" dict + "Repository" .Repository + "ShowTabBranches" true + "ShowTabTags" true + "CurrentRefType" $branchDropdownCurrentRefType + "CurrentRefShortName" $branchDropdownCurrentRefShortName + "CurrentTreePath" .TreePath + "RefLinkTemplate" "{RepoLink}/commits/{RefType}/{RefShortName}/{TreePath}" + "AllowCreateNewRef" .CanCreateBranch + }} + <a href="{{.RepoLink}}/graph" class="ui basic small compact button"> {{svg "octicon-git-branch"}} {{ctx.Locale.Tr "repo.commit_graph"}} |