This repository has no description
1{{ define "repo/issues/fragments/putIssue" }}
2<!-- this form is used for new and edit, .Issue is passed when editing -->
3<form
4 {{ if eq .Action "edit" }}
5 hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/edit"
6 {{ else }}
7 hx-post="/{{ .RepoInfo.FullName }}/issues/new"
8 {{ end }}
9 hx-trigger="submit, keydown[(ctrlKey || metaKey) && key=='Enter'] from:(#title,#body)"
10 hx-swap="none"
11 class="group">
12 <div class="flex flex-col gap-2">
13 <div>
14 <label for="title">Title</label>
15 <input type="text" name="title" id="title" class="w-full" value="{{ if .Issue }}{{ .Issue.Title }}{{ end }}" />
16 </div>
17 <div>
18 <label for="body">Body</label>
19 {{ template "fragments/markdownEditor"
20 (dict "Name" "body"
21 "Value" (and .Issue .Issue.Body)
22 "BlobName" "blob"
23 "Rows" 15
24 "Placeholder" "Describe your issue. Markdown is supported.") }}
25 </div>
26 <div class="flex justify-between">
27 <div id="issues" class="error"></div>
28 <div class="flex gap-2 items-stretch">
29 <a
30 class="btn-flat text-red-500 dark:text-red-400 flex items-center gap-2 no-underline hover:no-underline"
31 type="button"
32 {{ if .Issue }}
33 href="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}"
34 {{ else }}
35 href="/{{ .RepoInfo.FullName }}/issues"
36 {{ end }}
37 >
38 {{ i "x" "w-4 h-4" }}
39 Cancel
40 </a>
41 <button type="submit" class="btn-create-flat flex items-center gap-2">
42 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }}
43 {{ if eq .Action "edit" }}
44 {{ i "check" "w-4 h-4 inline group-[.htmx-request]:hidden" }}
45 Save
46 {{ else }}
47 {{ i "circle-plus" "w-4 h-4 inline group-[.htmx-request]:hidden" }}
48 Create issue
49 {{ end }}
50 </button>
51 </div>
52 </div>
53 </div>
54</form>
55{{ end }}