This repository has no description
3.3 kB
82 lines
1{{ define "repo/pulls/fragments/pullStepDetails" }}
2 {{ $hasSidePanel := and .LabelDefs .RepoInfo.Roles.IsPushAllowed }}
3 {{ $labelCtx := dict "Defs" .LabelDefs "State" .LabelState "RepoInfo" .RepoInfo "Subject" "" "LoggedInUser" .LoggedInUser }}
4
5 <section class="flex flex-col md:flex-row gap-6">
6 <div class="flex-1 min-w-0 flex flex-col gap-4">
7 {{ template "pullStepDetailsSingle" . }}
8 {{ template "pullSubmitRow" . }}
9 </div>
10
11 {{ if $hasSidePanel }}
12 <aside class="w-full md:w-72 md:flex-shrink-0 flex flex-col gap-6">
13 {{ template "editBasicLabels" $labelCtx }}
14 {{ template "editKvLabels" $labelCtx }}
15 </aside>
16 {{ end }}
17 </section>
18
19 <script>
20 document.querySelectorAll('input[name=body]').forEach(el => {
21 el.addEventListener('oninput', () => {
22 document.querySelector('#bodyDirty').value = 1;
23 });
24 });
25 </script>
26{{ end }}
27
28{{ define "pullStepDetailsSingle" }}
29 <input type="hidden" name="titleDirty" id="titleDirty" value="{{ if .TitleDirty }}1{{ end }}" />
30 <input type="hidden" name="bodyDirty" id="bodyDirty" value="{{ if .BodyDirty }}1{{ end }}" />
31 <div class="flex flex-col gap-1">
32 <label for="title" class="text-xs tracking-wide text-gray-800 dark:text-gray-200">Title</label>
33 <input
34 type="text"
35 name="title"
36 id="title"
37 value="{{ .Title }}"
38 oninput="document.getElementById('titleDirty').value='1'"
39 class="w-full dark:bg-gray-800 dark:text-white dark:border-gray-700"
40 placeholder="One-line summary of your change."
41 required
42 />
43 </div>
44
45 {{ template "fragments/markdownEditor" (dict
46 "Name" "body"
47 "Value" .Body
48 "Rows" 6
49 "Placeholder" "Describe your change. Markdown is supported."
50 ) }}
51{{ end }}
52
53{{ define "pullSubmitRow" }}
54 <div class="flex items-center justify-end gap-4 mt-auto">
55 {{ if and .MergeCheck .MergeCheck.IsConflicted }}
56 <div class="flex items-center gap-2 text-sm">
57 <span class="inline-flex items-center gap-1 text-red-600 dark:text-red-400">
58 {{ i "x" "w-4 h-4" }}
59 Can't automatically merge
60 </span>
61 <span class="text-gray-500 dark:text-gray-400">You can still create the pull request</span>
62 </div>
63 {{ else if and .MergeCheck .MergeCheck.Error }}
64 <div class="flex items-center gap-2 text-sm text-red-600 dark:text-red-400">
65 {{ i "triangle-alert" "w-4 h-4" }}
66 Merge check failed
67 </div>
68 {{ end }}
69
70 <button
71 type="submit"
72 class="btn-create flex items-center gap-2"
73 hx-indicator="#create-pull-spinner"
74 >
75 <span id="create-pull-spinner" class="group flex items-center">
76 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }}
77 {{ i "git-pull-request-create" "w-4 h-4 inline group-[.htmx-request]:hidden" }}
78 </span>
79 Create pull request
80 </button>
81 </div>
82{{ end }}