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:find textarea"
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" autocomplete="off" 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 "Rows" 15
23 "Placeholder" "Describe your issue. Markdown is supported.") }}
24 </div>
25 <div class="flex justify-between">
26 <div id="issues" class="error"></div>
27 <div class="flex gap-2 items-stretch">
28 <a
29 class="btn-flat text-red-500 dark:text-red-400 flex items-center gap-2 no-underline hover:no-underline"
30 type="button"
31 {{ if .Issue }}
32 href="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}"
33 {{ else }}
34 href="/{{ .RepoInfo.FullName }}/issues"
35 {{ end }}
36 >
37 {{ i "x" "w-4 h-4" }}
38 Cancel
39 </a>
40 <button type="submit" class="btn-create-flat flex items-center gap-2">
41 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }}
42 {{ if eq .Action "edit" }}
43 {{ i "check" "w-4 h-4 inline group-[.htmx-request]:hidden" }}
44 Save
45 {{ else }}
46 {{ i "circle-plus" "w-4 h-4 inline group-[.htmx-request]:hidden" }}
47 Create issue
48 {{ end }}
49 </button>
50 </div>
51 </div>
52 </div>
53</form>
54{{ end }}