1{{ define "title" }}new pull · {{ .RepoInfo.FullName }}{{ end }}
2
3{{ define "repoContent" }}
4 <form
5 hx-post="/{{ .RepoInfo.FullName }}/pulls/new"
6 class="mt-6 space-y-6"
7 hx-swap="none"
8 >
9 <div class="flex flex-col gap-4">
10 <label>configure your pull request</label>
11
12 <p>First, choose a target branch on {{ .RepoInfo.FullName }}.</p>
13 <div class="pb-2">
14 <select
15 required
16 name="targetBranch"
17 class="p-1 border border-gray-200 bg-white dark:bg-gray-700 dark:text-white dark:border-gray-600"
18 >
19 <option disabled selected>target branch</option>
20 {{ range .Branches }}
21 <option value="{{ .Reference.Name }}" class="py-1">
22 {{ .Reference.Name }}
23 </option>
24 {{ end }}
25 </select>
26 </div>
27
28 <p>Next, choose a pull strategy.</p>
29 <nav class="flex space-x-4 items-end">
30 <button
31 type="button"
32 class="px-3 py-2 pb-2 btn"
33 hx-get="/{{ .RepoInfo.FullName }}/pulls/new/patch-upload"
34 hx-target="#patch-strategy"
35 hx-swap="innerHTML"
36 >
37 paste patch
38 </button>
39
40 {{ if .RepoInfo.Roles.IsPushAllowed }}
41 <span class="text-sm text-gray-500 dark:text-gray-400 pb-2">
42 or
43 </span>
44 <button
45 type="button"
46 class="px-3 py-2 pb-2 btn"
47 hx-get="/{{ .RepoInfo.FullName }}/pulls/new/compare-branches"
48 hx-target="#patch-strategy"
49 hx-swap="innerHTML"
50 >
51 compare branches
52 </button>
53 {{ end }}
54
55
56 <span class="text-sm text-gray-500 dark:text-gray-400 pb-2">
57 or
58 </span>
59 <button
60 type="button"
61 class="px-3 py-2 pb-2 btn"
62 hx-get="/{{ .RepoInfo.FullName }}/pulls/new/compare-forks"
63 hx-target="#patch-strategy"
64 hx-swap="innerHTML"
65 >
66 compare forks
67 </button>
68 </nav>
69
70 <section id="patch-strategy">
71 {{ template "repo/pulls/fragments/pullPatchUpload" . }}
72 </section>
73
74 <p id="patch-preview"></p>
75
76 <div id="patch-error" class="error dark:text-red-300"></div>
77
78 <div>
79 <label for="title" class="dark:text-white">write a title</label>
80
81 <input
82 type="text"
83 name="title"
84 id="title"
85 class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600"
86 placeholder="One-line summary of your change."
87 />
88 </div>
89
90 <div>
91 <label for="body" class="dark:text-white"
92 >add a description</label
93 >
94
95 <textarea
96 name="body"
97 id="body"
98 rows="6"
99 class="w-full resize-y dark:bg-gray-700 dark:text-white dark:border-gray-600"
100 placeholder="Describe your change. Markdown is supported."
101 ></textarea>
102 </div>
103
104 <div class="flex justify-start items-center gap-2 mt-4">
105 <button type="submit" class="btn flex items-center gap-2">
106 {{ i "git-pull-request-create" "w-4 h-4" }}
107 create pull
108 </button>
109 </div>
110 </div>
111 <div id="pull" class="error dark:text-red-300"></div>
112 </form>
113{{ end }}