(refs #2)Add action type "merge" for ISSUE_COMMENT.

This commit is contained in:
takezoe
2013-08-05 15:16:26 +09:00
parent b58c19b88b
commit 50cb59f569
4 changed files with 32 additions and 16 deletions

View File

@@ -105,7 +105,8 @@ trait PullRequestsControllerBase extends ControllerBase {
try {
// TODO mark issue as 'merged'
val loginAccount = context.loginAccount.get
createComment(repository.owner, repository.name, loginAccount.userName, issueId, "Closed", "close")
createComment(repository.owner, repository.name, loginAccount.userName, issueId, "Merge", "merge")
createComment(repository.owner, repository.name, loginAccount.userName, issueId, "Close", "close")
updateClosed(repository.owner, repository.name, issueId, true)
recordMergeActivity(repository.owner, repository.name, loginAccount.userName, issueId, form.message)

View File

@@ -116,12 +116,14 @@
@if(comment.action == "close" || comment.action == "close_comment"){
<div class="small issue-comment-action">
<span class="label label-important">Closed</span>
@avatar(comment.commentedUserName, 20)
<a href="@url(comment.commentedUserName)" class="username strong">@comment.commentedUserName</a> closed the issue @datetime(comment.registeredDate)
</div>
}
@if(comment.action == "reopen" || comment.action == "reopen_comment"){
<div class="small issue-comment-action">
<span class="label label-success">Reopened</span>
@avatar(comment.commentedUserName, 20)
<a href="@url(comment.commentedUserName)" class="username strong">@comment.commentedUserName</a> reopened the issue @datetime(comment.registeredDate)
</div>
}

View File

@@ -61,6 +61,7 @@
</div>
</div>
@comments.map { comment =>
@if(comment.action != "close" && comment.action != "reopen" && comment.action != "merge"){
<div class="issue-avatar-image">@avatar(comment.commentedUserName, 48)</div>
<div class="box issue-comment-box" id="comment-@comment.commentId">
<div class="box-header-small">
@@ -77,20 +78,28 @@
@markdown(comment.content, repository, false, true)
</div>
</div>
<div class="small issue-comment-action">
@if(comment.action == "close" || comment.action == "close_comment"){
<div class="small issue-comment-action">
<span class="label label-important">Closed</span>
<a href="@url(comment.commentedUserName)" class="username strong">@comment.commentedUserName</a> closed the issue @datetime(comment.registeredDate)
</div>
}
@if(comment.action == "reopen" || comment.action == "reopen_comment"){
<div class="small issue-comment-action">
<span class="label label-success">Reopened</span>
<a href="@url(comment.commentedUserName)" class="username strong">@comment.commentedUserName</a> reopened the issue @datetime(comment.registeredDate)
</div>
}
}
@if(comment.action == "merge"){
<div class="small" style="margin-top: 10px; margin-bottom: 10px;">
<span class="label label-info">Merged</span>
@avatar(comment.commentedUserName, 20)
<a href="@url(comment.commentedUserName)" class="username strong">@comment.commentedUserName</a> merged the pull request @datetime(comment.registeredDate)
</div>
}
@if(comment.action == "close" || comment.action == "close_comment"){
<div class="small issue-comment-action">
<span class="label label-important">Closed</span>
@avatar(comment.commentedUserName, 20)
<a href="@url(comment.commentedUserName)" class="username strong">@comment.commentedUserName</a> closed the pull request @datetime(comment.registeredDate)
</div>
}
@if(comment.action == "reopen" || comment.action == "reopen_comment"){
<div class="small issue-comment-action">
<span class="label label-success">Reopened</span>
@avatar(comment.commentedUserName, 20)
<a href="@url(comment.commentedUserName)" class="username strong">@comment.commentedUserName</a> reopened the issue @datetime(comment.registeredDate)
</div>
}
}
@if(hasWritePermission && !issue.closed){
<div class="box issue-comment-box" style="background-color: #d8f5cd;">
@@ -184,7 +193,11 @@ git push origin @{pullreq.branch}</pre>
</div>
<div class="span2">
@if(issue.closed) {
<span class="label label-important issue-status">Closed</span>
@if(comments.exists(_.action == "merge")){
<span class="label label-info issue-status">Merged</span>
} else {
<span class="label label-important issue-status">Closed</span>
}
} else {
<span class="label label-success issue-status">Open</span>
}

View File

@@ -13,7 +13,7 @@
@import context._
@import view.helpers._
@html.main("%s - Pull Request #%d - %s/%s".format(issue.title, issue.issueId, repository.owner, repository.name)){
@html.header("issues", repository)
@html.header("pulls", repository)
<ul class="nav nav-tabs" id="pullreq-tab">
<li class="active"><a href="#discussion">Discussion</a></li>
<li><a href="#commits">Commits <span class="badge">@commits.flatten.size</span></a></li>