From bc8dd4b3c2d0fcf1eeb34a53cc73996cdf363cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joa=CC=83o=20Costa?= Date: Sun, 29 Oct 2017 11:25:07 +0000 Subject: [PATCH] Truncate long branch names Fix #1135 --- .../twirl/gitbucket/core/helper/branchcontrol.scala.html | 3 ++- src/main/twirl/gitbucket/core/helper/dropdown.scala.html | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/twirl/gitbucket/core/helper/branchcontrol.scala.html b/src/main/twirl/gitbucket/core/helper/branchcontrol.scala.html index 38a5d938b..5afda3bab 100644 --- a/src/main/twirl/gitbucket/core/helper/branchcontrol.scala.html +++ b/src/main/twirl/gitbucket/core/helper/branchcontrol.scala.html @@ -4,7 +4,8 @@ @import gitbucket.core.view.helpers @gitbucket.core.helper.html.dropdown( value = if(branch.length == 40) branch.substring(0, 10) else branch, - prefix = if(branch.length == 40) "tree" else if(repository.branchList.contains(branch)) "branch" else "tree" + prefix = if(branch.length == 40) "tree" else if(repository.branchList.contains(branch)) "branch" else "tree", + maxValueWidth = "200px" ) {
  • Switch branches
  • diff --git a/src/main/twirl/gitbucket/core/helper/dropdown.scala.html b/src/main/twirl/gitbucket/core/helper/dropdown.scala.html index ea99758a9..1b8ee977c 100644 --- a/src/main/twirl/gitbucket/core/helper/dropdown.scala.html +++ b/src/main/twirl/gitbucket/core/helper/dropdown.scala.html @@ -1,11 +1,12 @@ @(value : String = "", prefix: String = "", style : String = "", + maxValueWidth : String = "", right : Boolean = false, filter: (String, String) = ("",""))(body: Html) @defining(if(filter._1.isEmpty) "" else filter._1 + "-" + scala.util.Random.alphanumeric.take(4).mkString){ filterId =>
    -