From b7b7322cce54ba73fcd347decdb9b7b2ad9d7c5a Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Fri, 1 Aug 2025 02:33:05 +0900 Subject: [PATCH] Fix branch selector in repository viewer (#3813) --- .../twirl/gitbucket/core/helper/branchcontrol.scala.html | 4 ++-- src/main/twirl/gitbucket/core/repo/blob.scala.html | 5 ++++- src/main/twirl/gitbucket/core/repo/commits.scala.html | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/twirl/gitbucket/core/helper/branchcontrol.scala.html b/src/main/twirl/gitbucket/core/helper/branchcontrol.scala.html index 237a760cd..b58b68a78 100644 --- a/src/main/twirl/gitbucket/core/helper/branchcontrol.scala.html +++ b/src/main/twirl/gitbucket/core/helper/branchcontrol.scala.html @@ -67,7 +67,7 @@ }); function updateBranchControlList(active) { - if (active == 'branches') { + if (active === 'branches') { $('li#branch-control-tab-branches').addClass('active'); $('li#branch-control-tab-tags').removeClass('active'); @@ -81,7 +81,7 @@ } else { $('#branch-control-input').attr('placeholder', 'Find branch ...'); } - } else if (active == 'tags') { + } else if (active === 'tags') { $('li#branch-control-tab-branches').removeClass('active'); $('li#branch-control-tab-tags').addClass('active'); diff --git a/src/main/twirl/gitbucket/core/repo/blob.scala.html b/src/main/twirl/gitbucket/core/repo/blob.scala.html index 1178a80b3..30acdc5c8 100644 --- a/src/main/twirl/gitbucket/core/repo/blob.scala.html +++ b/src/main/twirl/gitbucket/core/repo/blob.scala.html @@ -40,7 +40,10 @@
@gitbucket.core.helper.html.branchcontrol(branch, repository, hasWritePermission){ @repository.branchList.map { x => -
  • @gitbucket.core.helper.html.checkicon(x == branch) @x
  • +
  • @gitbucket.core.helper.html.checkicon(x == branch) @x
  • + } + @repository.tags.map { x => +
  • @gitbucket.core.helper.html.checkicon(x.name == branch) @x.name
  • } }
    diff --git a/src/main/twirl/gitbucket/core/repo/commits.scala.html b/src/main/twirl/gitbucket/core/repo/commits.scala.html index e518d1eb3..8b7f1b7b6 100644 --- a/src/main/twirl/gitbucket/core/repo/commits.scala.html +++ b/src/main/twirl/gitbucket/core/repo/commits.scala.html @@ -12,7 +12,10 @@ @if(pathList.isEmpty){ @gitbucket.core.helper.html.branchcontrol(branch, repository, hasWritePermission){ @repository.branchList.map { x => -
  • @gitbucket.core.helper.html.checkicon(x == branch) @x
  • +
  • @gitbucket.core.helper.html.checkicon(x == branch) @x
  • + } + @repository.tags.map { x => +
  • @gitbucket.core.helper.html.checkicon(x.name == branch) @x.name
  • } } }