From f178c002eea837512363bc099253a3124dde8873 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Fri, 10 Mar 2023 00:49:17 +0800 Subject: [PATCH] refactor --- templates/repo/branch_dropdown.tmpl | 128 ++++++++++-------- .../js/components/RepoBranchTagDropdown.js | 59 +++----- web_src/js/features/repo-legacy.js | 2 +- 3 files changed, 90 insertions(+), 99 deletions(-) diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl index 89d65146a9d62..9379d16bc3a86 100644 --- a/templates/repo/branch_dropdown.tmpl +++ b/templates/repo/branch_dropdown.tmpl @@ -2,101 +2,111 @@ {{$defaultBranch := $.root.BranchName}}{{if and .root.IsViewTag (not .noTag)}}{{$defaultBranch = .root.TagName}}{{end}}{{if eq $defaultBranch ""}}{{$defaultBranch = $.root.Repository.DefaultBranch}}{{end}} {{$type := ""}}{{if and .root.IsViewTag (not .noTag)}}{{$type = "tag"}}{{else if .root.IsViewBranch}}{{$type = "branch"}}{{else}}{{$type = "tree"}}{{end}} {{$showBranchesInDropdown := not .root.HideBranchesInDropdown}} + + +
-