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