| |
---|
| | </span> |
---|
| | </span> |
---|
| | </td> |
---|
| | <td class="branch-a-b-count"> |
---|
| | @if(branch.mergeInfo.isEmpty){ |
---|
| | @if(repository.repository.defaultBranch == branch.name){ |
---|
| | <span class="badge">Default</span> |
---|
| | } else { |
---|
| | @branch.mergeInfo.map{ info => |
---|
| | <div data-toggle="tooltip" title="@info.ahead commits ahead, @info.behind commits behind @repository.repository.defaultBranch"> |
---|
| |
---|
| | } |
---|
| | </td> |
---|
| | <td> |
---|
| | <div class="branch-action"> |
---|
| | @branch.mergeInfo.map{ info => |
---|
| | @prs.map{ case (pull, issue) => |
---|
| | <a href="@helpers.url(repository)/pull/@issue.issueId" title="@issue.title">#@issue.issueId</a> |
---|
| | @if(issue.closed) { |
---|
| | @if(info.isMerged){ |
---|
| | <a href="@helpers.url(repository)/pull/@issue.issueId" title="@issue.title" class="label label-info">Merged</a> |
---|
| | } else { |
---|
| | <a href="@helpers.url(repository)/pull/@issue.issueId" title="@issue.title" class="label label-important">Closed</a> |
---|
| | @if(repository.repository.defaultBranch != branch.name){ |
---|
| | @branch.mergeInfo.map{ info => |
---|
| | @prs.map{ case (pull, issue) => |
---|
| | <a href="@helpers.url(repository)/pull/@issue.issueId" title="@issue.title">#@issue.issueId</a> |
---|
| | @if(issue.closed) { |
---|
| | @if(info.isMerged){ |
---|
| | <a href="@helpers.url(repository)/pull/@issue.issueId" title="@issue.title" class="label label-info">Merged</a> |
---|
| | } else { |
---|
| | <a href="@helpers.url(repository)/pull/@issue.issueId" title="@issue.title" class="label label-important">Closed</a> |
---|
| | } |
---|
| | } else { |
---|
| | <a href="@helpers.url(repository)/pull/@issue.issueId" title="@issue.title" class="label label-success">Open</a> |
---|
| | } |
---|
| | }.getOrElse{ |
---|
| | @if(context.loginAccount.isDefined){ |
---|
| | <a href="@helpers.url(repository)/compare/@{repository.repository.parentUserName.map { parent => |
---|
| | helpers.urlEncode(parent) + ":" + helpers.encodeRefName(repository.repository.defaultBranch) |
---|
| | }.getOrElse { |
---|
| | helpers.encodeRefName(repository.repository.defaultBranch) |
---|
| | }}...@{helpers.encodeRefName(branch.name)}?expand=1" class="btn btn-default">New Pull request</a> |
---|
| | } else { |
---|
| | <a href="@helpers.url(repository)/compare/@{repository.repository.parentUserName.map { parent => |
---|
| | helpers.urlEncode(parent) + ":" + helpers.encodeRefName(repository.repository.defaultBranch) |
---|
| | }.getOrElse { |
---|
| | helpers.encodeRefName(repository.repository.defaultBranch) |
---|
| | }}...@{helpers.encodeRefName(branch.name)}" class="btn btn-default">Compare</a> |
---|
| | } |
---|
| | } |
---|
| | } else { |
---|
| | <a href="@helpers.url(repository)/pull/@issue.issueId" title="@issue.title" class="label label-success">Open</a> |
---|
| | } |
---|
| | }.getOrElse{ |
---|
| | @if(context.loginAccount.isDefined){ |
---|
| | <a href="@helpers.url(repository)/compare/@{repository.repository.parentUserName.map { parent => |
---|
| | helpers.urlEncode(parent) + ":" + helpers.encodeRefName(repository.repository.defaultBranch) |
---|
| | }.getOrElse { |
---|
| | helpers.encodeRefName(repository.repository.defaultBranch) |
---|
| | }}...@{helpers.encodeRefName(branch.name)}?expand=1" class="btn btn-default">New Pull request</a> |
---|
| | } else { |
---|
| | <a href="@helpers.url(repository)/compare/@{repository.repository.parentUserName.map { parent => |
---|
| | helpers.urlEncode(parent) + ":" + helpers.encodeRefName(repository.repository.defaultBranch) |
---|
| | }.getOrElse { |
---|
| | helpers.encodeRefName(repository.repository.defaultBranch) |
---|
| | }}...@{helpers.encodeRefName(branch.name)}" class="btn btn-default">Compare</a> |
---|
| | @if(hasWritePermission){ |
---|
| | <span style="margin-left: 8px;"> |
---|
| | @if(prs.map(!_._2.closed).getOrElse(false)){ |
---|
| | <a class="disabled" data-toggle="tooltip" title="You can’t delete this branch because it has an open pull request"><i class="octicon octicon-trashcan"></i></a> |
---|
| | } else { |
---|
| | @if(isProtected){ |
---|
| | <a class="disabled" data-toggle="tooltip" title="You can’t delete a protected branch."><i class="octicon octicon-trashcan"></i></a> |
---|
| | } else { |
---|
| | <a href="@helpers.url(repository)/delete/@helpers.encodeRefName(branch.name)" class="delete-branch" data-name="@branch.name" @if(info.isMerged){ data-toggle="tooltip" title="this branch is merged" }><i class="octicon octicon-trashcan @if(info.isMerged){warning} else {danger}"></i></a> |
---|
| | } |
---|
| | } |
---|
| | </span> |
---|
| | } |
---|
| | } |
---|
| | } |
---|
| | @if(hasWritePermission){ |
---|
| | <span style="margin-left: 8px;"> |
---|
| | @if(prs.map(!_._2.closed).getOrElse(false)){ |
---|
| | <a class="disabled" data-toggle="tooltip" title="You can’t delete this branch because it has an open pull request"><i class="octicon octicon-trashcan"></i></a> |
---|
| | } else { |
---|
| | @if(isProtected){ |
---|
| | <a class="disabled" data-toggle="tooltip" title="You can’t delete a protected branch."><i class="octicon octicon-trashcan"></i></a> |
---|
| | } else { |
---|
| | <a href="@helpers.url(repository)/delete/@helpers.encodeRefName(branch.name)" class="delete-branch" data-name="@branch.name" @if(info.isMerged){ data-toggle="tooltip" title="this branch is merged" }><i class="octicon octicon-trashcan @if(info.isMerged){warning} else {danger}"></i></a> |
---|
| | } |
---|
| | } |
---|
| | </span> |
---|
| | } |
---|
| | } |
---|
| | </div> |
---|
| | </td> |
---|
| | </tr> |
---|
| | } |
---|
| |
---|
| | |