This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / appview / pages / templates / repo / pulls / fragments / pullComposeHost.html
4.3 kB 80 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 {{ $hasCommits := and .Comparison .Comparison.FormatPatch }} 11 {{ $hasDiff := false }} 12 {{ if .Diff }}{{ if .Diff.Diff }}{{ $hasDiff = true }}{{ end }}{{ end }} 13 {{ $showDetails := and (or $hasCommits $hasDiff) (not .IsStacked) }} 14 15 <form 16 hx-post="/{{ .RepoInfo.FullName }}/pulls/new" 17 hx-trigger="submit, keydown[(ctrlKey || metaKey) && key=='Enter'] from:(#patch,#title,#body)" 18 hx-indicator="#create-pull-spinner" 19 hx-target="body" 20 hx-swap="innerHTML show:top" 21 class="flex flex-col gap-6" 22 > 23 <section class="relative flex flex-col gap-3"> 24 <div class="absolute left-3 -translate-x-1/2 top-3 -bottom-6 w-px bg-gray-200 dark:bg-gray-700"></div> 25 <div class="flex items-center gap-4 relative"> 26 <div class="flex-shrink-0 relative z-10"> 27 {{ template "pullComposeSectionNumber" 1 }} 28 </div> 29 <h3 class="text-sm tracking-wide font-bold my-0 dark:text-white">Source</h3> 30 </div> 31 <div class="ml-10 flex flex-col gap-3"> 32 {{ template "repo/pulls/fragments/pullStepSource" . }} 33 </div> 34 </section> 35 36 <section class="relative flex flex-col gap-3"> 37 {{ if $showDetails }} 38 <div class="absolute left-3 -translate-x-1/2 -top-6 -bottom-6 w-px bg-gray-200 dark:bg-gray-700"></div> 39 {{ else }} 40 <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> 41 {{ end }} 42 <div class="flex items-center gap-4 relative"> 43 <div class="flex-shrink-0 relative z-10"> 44 {{ template "pullComposeSectionNumber" 2 }} 45 </div> 46 <h3 class="text-sm tracking-wide font-bold my-0 dark:text-white">Review</h3> 47 </div> 48 <div class="ml-10 flex flex-col gap-3"> 49 {{ template "repo/pulls/fragments/pullStepReview" . }} 50 </div> 51 </section> 52 53 {{ if $showDetails }} 54 <section class="relative flex flex-col gap-3"> 55 <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> 56 <div class="flex items-center gap-4 relative"> 57 <div class="flex-shrink-0 relative z-10"> 58 {{ template "pullComposeSectionNumber" 3 }} 59 </div> 60 <h3 class="text-sm tracking-wide font-bold my-0 dark:text-white">Details</h3> 61 </div> 62 <div class="ml-10 flex flex-col gap-3"> 63 {{ template "repo/pulls/fragments/pullStepDetails" . }} 64 </div> 65 </section> 66 {{ else }} 67 <input type="hidden" name="title" value="{{ .Title }}" /> 68 <input type="hidden" name="body" value="{{ .Body }}" /> 69 <input type="hidden" name="titleDirty" value="{{ if .TitleDirty }}1{{ end }}" /> 70 <input type="hidden" name="bodyDirty" value="{{ if .BodyDirty }}1{{ end }}" /> 71 {{ end }} 72 </form> 73 74 <div id="pull" class="error dark:text-red-300 mt-4 ml-10"></div> 75 </div> 76{{ end }} 77 78{{ define "pullComposeSectionNumber" }} 79 <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> 80{{ end }}