1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-27 04:38:36 +00:00

Refactor RepoBranchTagSelector (#32681)

This commit is contained in:
wxiaoguang
2024-12-02 09:41:32 +08:00
committed by GitHub
parent def13ece7c
commit e3e32605a1
8 changed files with 275 additions and 288 deletions

View File

@@ -47,7 +47,22 @@
{{$isHomepage := (eq $n 0)}}
<div class="repo-button-row" data-is-homepage="{{$isHomepage}}">
<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}/src/{RefType}/{RefShortName}/{TreePath}"
"AllowCreateNewRef" .CanCreateBranch
}}
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
{{$cmpBranch := ""}}
{{if ne .Repository.ID .BaseRepo.ID}}