@(branchInfo: Seq[( gitbucket.core.util.JGitUtil.BranchInfo, Option[(gitbucket.core.model.PullRequest, gitbucket.core.model.Issue)], Boolean, Option[(gitbucket.core.model.CommitState, List[gitbucket.core.model.CommitStatus])] )], hasWritePermission: Boolean, repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(implicit context: gitbucket.core.controller.Context) @import gitbucket.core.view.helpers @gitbucket.core.html.main(s"${repository.owner}/${repository.name}", Some(repository)) { @gitbucket.core.html.menu("branches", repository){

All branches
@branchInfo.map { case (branch, prs, isProtected, status) =>

@if(isProtected){ } @branch.name Updated @gitbucket.core.helper.html.datetimeago(branch.commitTime, false) by @helpers.user(branch.committerName, branch.committerEmailAddress, "muted-link") @status.map { case (summary, statuses) => @gitbucket.core.helper.html.commitstatus(branch.commitId, summary, statuses) }

@if(repository.repository.defaultBranch == branch.name){ Default } else { @branch.mergeInfo.map{ info =>
@info.ahead
@info.behind
} }

@if(repository.repository.defaultBranch != branch.name){ @branch.mergeInfo.map{ info => @prs.map{ case (pull, issue) => #@issue.issueId @if(issue.closed) { @if(info.isMerged){ Merged } else { Closed } } else { Open } }.getOrElse{ @if(context.loginAccount.isDefined){ New Pull request } else { Compare } } @if(hasWritePermission){ @if(prs.map(!_._2.closed).getOrElse(false)){ } else { @if(isProtected){ } else { } } } } }

}

} }