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