@(branchInfo: Seq[(gitbucket.core.util.JGitUtil.BranchInfo, Option[(gitbucket.core.model.PullRequest, gitbucket.core.model.Issue)], Boolean)], hasWritePermission: Boolean, repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(implicit context: gitbucket.core.controller.Context) @import context._ @import gitbucket.core.view.helpers._ @html.main(s"${repository.owner}/${repository.name}", Some(repository)) { @html.menu("branches", repository){ @branchInfo.map { case (branch, prs, isProtected) => }
All branches
@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 { } } } }
@if(isProtected){ } @branch.name Updated @helper.html.datetimeago(branch.commitTime, false) by @user(branch.committerName, branch.committerEmailAddress, "muted-link")
@if(branch.mergeInfo.isEmpty){ Default }else{ @branch.mergeInfo.map{ info =>
@info.ahead
@info.behind
} }
} }