diff --git a/src/main/twirl/repo/commit.scala.html b/src/main/twirl/repo/commit.scala.html index 0d75061..0986090 100644 --- a/src/main/twirl/repo/commit.scala.html +++ b/src/main/twirl/repo/commit.scala.html @@ -1,4 +1,4 @@ -@(commitId: String, commit: util.JGitUtil.CommitInfo, branchs: List[String], tags: List[String], repository: service.RepositoryService.RepositoryInfo, diffs: Seq[util.JGitUtil.DiffInfo])(implicit context: app.Context) +@(commitId: String, commit: util.JGitUtil.CommitInfo, branches: List[String], tags: List[String], repository: service.RepositoryService.RepositoryInfo, diffs: Seq[util.JGitUtil.DiffInfo])(implicit context: app.Context) @import context._ @import view.helpers @import view.implicits._ @@ -19,11 +19,15 @@
@@ -97,14 +101,52 @@ $(this).val('Show file list'); } }); + $('a.branch:first, a.tag:first').css({ 'font-weight': 'bold', 'color': '#555555' }); + + @if(branches.size > 5){ + // hide branches + @for(i <- 1 to branches.size - 2){ + $('#branch-@i').hide(); + } + // add omit link + $('#branch-@(branches.size - 1)').before( + $('...').click(function(){ + @for(i <- 1 to branches.size - 2){ + $('#branch-@i').show(); + this.remove(); + } + }) + ); + } + + @if(tags.size > 5){ + // hide tags + @for(i <- 1 to tags.size - 2){ + $('#tag-@i').hide(); + } + // add omit link + $('#tag-@(tags.size - 1)').before( + $('...').click(function(){ + @for(i <- 1 to tags.size - 2){ + $('#tag-@i').show(); + this.remove(); + } + }) + ); + } }); diff --git a/src/main/webapp/assets/common/css/gitbucket.css b/src/main/webapp/assets/common/css/gitbucket.css index 6ee61cf..e43e8bf 100644 --- a/src/main/webapp/assets/common/css/gitbucket.css +++ b/src/main/webapp/assets/common/css/gitbucket.css @@ -59,6 +59,17 @@ font-weight: bold; } +a.omit { + background-color: #ddd; + padding-left: 8px; + padding-right: 8px; + font-weight: bold; +} + +a.omit:hover { + background-color: #aaa; +} + .monospace { font-family: monospace; }