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