diff --git a/src/main/scala/app/PullRequestsController.scala b/src/main/scala/app/PullRequestsController.scala index d3fb03d..ba869c9 100644 --- a/src/main/scala/app/PullRequestsController.scala +++ b/src/main/scala/app/PullRequestsController.scala @@ -13,11 +13,11 @@ import util.JGitUtil.CommitInfo class PullRequestsController extends PullRequestsControllerBase - with RepositoryService with AccountService with IssuesService with PullRequestService + with RepositoryService with AccountService with IssuesService with PullRequestService with MilestonesService with ReferrerAuthenticator with CollaboratorsAuthenticator trait PullRequestsControllerBase extends ControllerBase { - self: ReferrerAuthenticator with RepositoryService with IssuesService + self: ReferrerAuthenticator with RepositoryService with IssuesService with MilestonesService with PullRequestService with CollaboratorsAuthenticator => val form = mapping( @@ -133,6 +133,28 @@ redirect(s"/${repository.owner}/${repository.name}/pulls/${issueId}") }) + get("/:owner/:repository/pulls/:id")(referrersOnly { repository => + val owner = repository.owner + val name = repository.name + val issueId = params("id") + + getIssue(owner, name, issueId) map { + issues.html.issue( + _, + getComments(owner, name, issueId.toInt), + getIssueLabels(owner, name, issueId.toInt), + (getCollaborators(owner, name) :+ owner).sorted, + getMilestones(owner, name), + Nil, + hasWritePermission(owner, name, context.loginAccount), + repository) + } getOrElse NotFound + }) + + post("/:owner/:repository/pulls/:id/merge")(collaboratorsOnly { repository => + // TODO Not implemented yet. + }) + private def withGit[T](oldDir: java.io.File, newDir: java.io.File)(action: (Git, Git) => T): T = { val oldGit = Git.open(oldDir) val newGit = Git.open(newDir)