This repository has no description
4.1 kB
76 lines
1{{ define "repo/pulls/fragments/pullComposeHost" }}
2 <div id="pr-compose-host" class="flex flex-col">
3 {{ if .PrefillError }}
4 <div class="mb-4 p-3 border border-red-200 dark:border-red-800 rounded bg-red-50 dark:bg-red-900/30 text-sm text-red-800 dark:text-red-200 flex items-center gap-2">
5 {{ i "triangle-alert" "w-4 h-4 flex-shrink-0" }}
6 <span>{{ .PrefillError }}</span>
7 </div>
8 {{ end }}
9
10 {{ $showDetails := .StepReviewParams }}
11
12 <form
13 hx-post="/{{ .RepoInfo.RepoDid }}/pulls/new"
14 hx-trigger="submit, keydown[(ctrlKey || metaKey) && key=='Enter'] from:(#patch,#title,#body)"
15 hx-indicator="#create-pull-spinner"
16 hx-swap="none"
17 class="flex flex-col gap-6"
18 >
19 <section class="relative flex flex-col gap-3">
20 <div class="absolute left-3 -translate-x-1/2 top-3 -bottom-6 w-px bg-gray-200 dark:bg-gray-700"></div>
21 <div class="flex items-center gap-4 relative">
22 <div class="flex-shrink-0 relative z-10">
23 {{ template "pullComposeSectionNumber" 1 }}
24 </div>
25 <h3 class="text-sm tracking-wide font-bold my-0 dark:text-white">Source</h3>
26 </div>
27 <div class="ml-10 flex flex-col gap-3">
28 {{ template "repo/pulls/fragments/pullStepSource" . }}
29 </div>
30 </section>
31
32 <section class="relative flex flex-col gap-3">
33 {{ if $showDetails }}
34 <div class="absolute left-3 -translate-x-1/2 -top-6 -bottom-6 w-px bg-gray-200 dark:bg-gray-700"></div>
35 {{ else }}
36 <div class="absolute left-3 -translate-x-1/2 -top-6 -bottom-12 w-px bg-gray-200 dark:bg-gray-700 [mask-image:linear-gradient(to_bottom,black_calc(100%-1.5rem),transparent)]"></div>
37 {{ end }}
38 <div class="flex items-center gap-4 relative">
39 <div class="flex-shrink-0 relative z-10">
40 {{ template "pullComposeSectionNumber" 2 }}
41 </div>
42 <h3 class="text-sm tracking-wide font-bold my-0 dark:text-white">Review</h3>
43 </div>
44 <div class="ml-10 flex flex-col gap-3">
45 {{ template "repo/pulls/fragments/pullStepReview" . }}
46 </div>
47 </section>
48
49 {{ if $showDetails }}
50 <section class="relative flex flex-col gap-3">
51 <div class="absolute left-3 -translate-x-1/2 -top-6 -bottom-12 w-px bg-gray-200 dark:bg-gray-700 [mask-image:linear-gradient(to_bottom,black_calc(100%-1.5rem),transparent)]"></div>
52 <div class="flex items-center gap-4 relative">
53 <div class="flex-shrink-0 relative z-10">
54 {{ template "pullComposeSectionNumber" 3 }}
55 </div>
56 <h3 class="text-sm tracking-wide font-bold my-0 dark:text-white">Details</h3>
57 </div>
58 <div class="ml-10 flex flex-col gap-3">
59 {{ template "repo/pulls/fragments/pullStepDetails" . }}
60 </div>
61 </section>
62 {{ else }}
63 <input type="hidden" name="title" value="{{ .Title }}" />
64 <input type="hidden" name="body" value="{{ .Body }}" />
65 <input type="hidden" name="titleDirty" value="{{ if .TitleDirty }}1{{ end }}" />
66 <input type="hidden" name="bodyDirty" value="{{ if .BodyDirty }}1{{ end }}" />
67 {{ end }}
68 </form>
69
70 <div id="pull" class="error dark:text-red-300 mt-4 ml-10"></div>
71 </div>
72{{ end }}
73
74{{ define "pullComposeSectionNumber" }}
75 <span class="inline-flex items-center justify-center w-6 h-6 rounded-full bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-300 text-xs font-bold">{{ . }}</span>
76{{ end }}