-
Next, choose a pull strategy.
+
+ Choose pull strategy
+
- {{ template "repo/pulls/fragments/pullPatchUpload" . }}
+ {{ if eq .Strategy "patch" }}
+ {{ template "repo/pulls/fragments/pullPatchUpload" . }}
+ {{ else if eq .Strategy "branch" }}
+ {{ template "repo/pulls/fragments/pullCompareBranches" . }}
+ {{ else }}
+ {{ template "repo/pulls/fragments/pullPatchUpload" . }}
+ {{ end }}
@@ -81,6 +120,7 @@
type="text"
name="title"
id="title"
+ value="{{ .Title }}"
class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600"
placeholder="One-line summary of your change."
/>
@@ -97,7 +137,7 @@
rows="6"
class="w-full resize-y dark:bg-gray-700 dark:text-white dark:border-gray-600"
placeholder="Describe your change. Markdown is supported."
- >
+ >{{ .Body }}
diff --git a/appview/state/pull.go b/appview/state/pull.go
index fa332064..eaf7778c 100644
--- a/appview/state/pull.go
+++ b/appview/state/pull.go
@@ -634,10 +634,21 @@ func (s *State) NewPull(w http.ResponseWriter, r *http.Request) {
return
}
+ // can be one of "patch", "branch" or "fork"
+ strategy := r.URL.Query().Get("strategy")
+ // ignored if strategy is "patch"
+ sourceBranch := r.URL.Query().Get("sourceBranch")
+ targetBranch := r.URL.Query().Get("targetBranch")
+
s.pages.RepoNewPull(w, pages.RepoNewPullParams{
LoggedInUser: user,
RepoInfo: f.RepoInfo(s, user),
Branches: result.Branches,
+ Strategy: strategy,
+ SourceBranch: sourceBranch,
+ TargetBranch: targetBranch,
+ Title: r.URL.Query().Get("title"),
+ Body: r.URL.Query().Get("body"),
})
case http.MethodPost:
@@ -1180,6 +1191,7 @@ func (s *State) CompareForksFragment(w http.ResponseWriter, r *http.Request) {
s.pages.PullCompareForkFragment(w, pages.PullCompareForkParams{
RepoInfo: f.RepoInfo(s, user),
Forks: forks,
+ Selected: r.URL.Query().Get("fork"),
})
}