diff --git a/appview/db/pulls.go b/appview/db/pulls.go index bf9db112..793b261f 100644 --- a/appview/db/pulls.go +++ b/appview/db/pulls.go @@ -233,6 +233,11 @@ func ReopenPull(e Execer, repoAt syntax.ATURI, pullId int) error { return err } +func MergePull(e Execer, repoAt syntax.ATURI, pullId int) error { + _, err := e.Exec(`update pulls set open = 2 where repo_at = ? and pull_id = ?`, repoAt, pullId) + return err +} + type PullCount struct { Open int Closed int diff --git a/appview/pages/pages.go b/appview/pages/pages.go index d0eb8d81..a8cfa8ec 100644 --- a/appview/pages/pages.go +++ b/appview/pages/pages.go @@ -531,15 +531,26 @@ func (p *Pages) RepoPulls(w io.Writer, params RepoPullsParams) error { } type RepoSinglePullParams struct { - LoggedInUser *auth.User - RepoInfo RepoInfo - DidHandleMap map[string]string - Pull db.Pull - Comments []db.PullComment - Active string + LoggedInUser *auth.User + RepoInfo RepoInfo + DidHandleMap map[string]string + Pull db.Pull + State string + PullOwnerHandle string + Comments []db.PullComment + Active string + MergeCheck types.MergeCheckResponse } func (p *Pages) RepoSinglePull(w io.Writer, params RepoSinglePullParams) error { + switch params.Pull.Open { + case 0: + params.State = "close" + case 1: + params.State = "open" + case 2: + params.State = "merged" + } params.Active = "pulls" return p.executeRepo("repo/pulls/pull", w, params) } diff --git a/appview/pages/templates/repo/pulls/new.html b/appview/pages/templates/repo/pulls/new.html index f7884cc1..421832f9 100644 --- a/appview/pages/templates/repo/pulls/new.html +++ b/appview/pages/templates/repo/pulls/new.html @@ -10,6 +10,11 @@
+ The branch you want to make your change against. +
+ {{- .Pull.Patch -}}
+
+