v0.35.1 2aca1df

issues_form_templ.go RawHistoryFolder

1// Code generated by templ - DO NOT EDIT.
2
3// templ: version: v0.3.1020
4// SPDX-License-Identifier: AGPL-3.0-or-later
5
6package web
7
8//lint:file-ignore SA4006 This context is only used if a nested component is present.
9
10import "github.com/a-h/templ"
11import templruntime "github.com/a-h/templ/runtime"
12
13// IssueForm is the public form that proposes an issue to the owner. It needs
14// JavaScript: the script (issue-form.js) solves a proof of work in a worker,
15// so the form stays hidden until it runs, and the page says why without it.
16func IssueForm(l Layout, p IssueFormPage) templ.Component {
17	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
18		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
19		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
20			return templ_7745c5c3_CtxErr
21		}
22		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
23		if !templ_7745c5c3_IsBuffer {
24			defer func() {
25				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
26				if templ_7745c5c3_Err == nil {
27					templ_7745c5c3_Err = templ_7745c5c3_BufErr
28				}
29			}()
30		}
31		ctx = templ.InitializeContext(ctx)
32		templ_7745c5c3_Var1 := templ.GetChildren(ctx)
33		if templ_7745c5c3_Var1 == nil {
34			templ_7745c5c3_Var1 = templ.NopComponent
35		}
36		ctx = templ.ClearChildren(ctx)
37		templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
38			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
39			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
40			if !templ_7745c5c3_IsBuffer {
41				defer func() {
42					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
43					if templ_7745c5c3_Err == nil {
44						templ_7745c5c3_Err = templ_7745c5c3_BufErr
45					}
46				}()
47			}
48			ctx = templ.InitializeContext(ctx)
49			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<header class=\"show mr-h\"><h1>New issue</h1></header><noscript><p class=\"lede\">This form needs JavaScript: it runs a short proof of work so that bots cannot flood the tracker.</p></noscript><form class=\"cform create\" method=\"post\" action=\"")
50			if templ_7745c5c3_Err != nil {
51				return templ_7745c5c3_Err
52			}
53			var templ_7745c5c3_Var3 templ.SafeURL
54			templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Action))
55			if templ_7745c5c3_Err != nil {
56				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 19, Col: 35}
57			}
58			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
59			if templ_7745c5c3_Err != nil {
60				return templ_7745c5c3_Err
61			}
62			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\" hidden data-issue-form data-nonce=\"")
63			if templ_7745c5c3_Err != nil {
64				return templ_7745c5c3_Err
65			}
66			var templ_7745c5c3_Var4 string
67			templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Nonce)
68			if templ_7745c5c3_Err != nil {
69				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 22, Col: 23}
70			}
71			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var4)
72			if templ_7745c5c3_Err != nil {
73				return templ_7745c5c3_Err
74			}
75			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\" data-difficulty=\"")
76			if templ_7745c5c3_Err != nil {
77				return templ_7745c5c3_Err
78			}
79			var templ_7745c5c3_Var5 string
80			templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(p.Difficulty))
81			if templ_7745c5c3_Err != nil {
82				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 23, Col: 39}
83			}
84			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var5)
85			if templ_7745c5c3_Err != nil {
86				return templ_7745c5c3_Err
87			}
88			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\" data-min-submit-at=\"")
89			if templ_7745c5c3_Err != nil {
90				return templ_7745c5c3_Err
91			}
92			var templ_7745c5c3_Var6 string
93			templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.ResolveAttributeValue(i64(p.MinSubmitAt))
94			if templ_7745c5c3_Err != nil {
95				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 24, Col: 42}
96			}
97			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var6)
98			if templ_7745c5c3_Err != nil {
99				return templ_7745c5c3_Err
100			}
101			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "\" data-worker=\"")
102			if templ_7745c5c3_Err != nil {
103				return templ_7745c5c3_Err
104			}
105			var templ_7745c5c3_Var7 string
106			templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Worker)
107			if templ_7745c5c3_Err != nil {
108				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 25, Col: 25}
109			}
110			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7)
111			if templ_7745c5c3_Err != nil {
112				return templ_7745c5c3_Err
113			}
114			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "\" autocomplete=\"off\"><input type=\"hidden\" name=\"token\" value=\"")
115			if templ_7745c5c3_Err != nil {
116				return templ_7745c5c3_Err
117			}
118			var templ_7745c5c3_Var8 string
119			templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Token)
120			if templ_7745c5c3_Err != nil {
121				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 28, Col: 52}
122			}
123			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8)
124			if templ_7745c5c3_Err != nil {
125				return templ_7745c5c3_Err
126			}
127			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "\"> <input type=\"hidden\" name=\"form_token\" value=\"")
128			if templ_7745c5c3_Err != nil {
129				return templ_7745c5c3_Err
130			}
131			var templ_7745c5c3_Var9 string
132			templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.FormToken)
133			if templ_7745c5c3_Err != nil {
134				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 29, Col: 61}
135			}
136			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
137			if templ_7745c5c3_Err != nil {
138				return templ_7745c5c3_Err
139			}
140			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "\"> <input type=\"hidden\" name=\"solution\" value=\"\"> <label for=\"issue-title\">title</label> <input id=\"issue-title\" aria-describedby=\"")
141			if templ_7745c5c3_Err != nil {
142				return templ_7745c5c3_Err
143			}
144			var templ_7745c5c3_Var10 string
145			templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.ResolveAttributeValue(issueFieldDescription("title", p.ErrorField))
146			if templ_7745c5c3_Err != nil {
147				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 34, Col: 67}
148			}
149			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10)
150			if templ_7745c5c3_Err != nil {
151				return templ_7745c5c3_Err
152			}
153			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "\"")
154			if templ_7745c5c3_Err != nil {
155				return templ_7745c5c3_Err
156			}
157			if p.ErrorField == "title" {
158				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, " aria-invalid=\"true\"")
159				if templ_7745c5c3_Err != nil {
160					return templ_7745c5c3_Err
161				}
162			}
163			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, " name=\"title\" type=\"text\" required autocomplete=\"off\" value=\"")
164			if templ_7745c5c3_Err != nil {
165				return templ_7745c5c3_Err
166			}
167			var templ_7745c5c3_Var11 string
168			templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Title)
169			if templ_7745c5c3_Err != nil {
170				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 42, Col: 19}
171			}
172			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11)
173			if templ_7745c5c3_Err != nil {
174				return templ_7745c5c3_Err
175			}
176			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "\"> <output id=\"issue-title-count\" aria-live=\"off\" data-for=\"issue-title\" data-max=\"")
177			if templ_7745c5c3_Err != nil {
178				return templ_7745c5c3_Err
179			}
180			var templ_7745c5c3_Var12 string
181			templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(p.MaxTitle))
182			if templ_7745c5c3_Err != nil {
183				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 44, Col: 100}
184			}
185			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12)
186			if templ_7745c5c3_Err != nil {
187				return templ_7745c5c3_Err
188			}
189			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "\" for=\"issue-title\">")
190			if templ_7745c5c3_Err != nil {
191				return templ_7745c5c3_Err
192			}
193			var templ_7745c5c3_Var13 string
194			templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(runeCount(p.Title)))
195			if templ_7745c5c3_Err != nil {
196				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 44, Col: 147}
197			}
198			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
199			if templ_7745c5c3_Err != nil {
200				return templ_7745c5c3_Err
201			}
202			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, " / ")
203			if templ_7745c5c3_Err != nil {
204				return templ_7745c5c3_Err
205			}
206			var templ_7745c5c3_Var14 string
207			templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.MaxTitle))
208			if templ_7745c5c3_Err != nil {
209				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 44, Col: 170}
210			}
211			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
212			if templ_7745c5c3_Err != nil {
213				return templ_7745c5c3_Err
214			}
215			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "</output> ")
216			if templ_7745c5c3_Err != nil {
217				return templ_7745c5c3_Err
218			}
219			if p.ErrorField == "title" {
220				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<p id=\"issue-title-error\" class=\"f-error\" role=\"alert\">")
221				if templ_7745c5c3_Err != nil {
222					return templ_7745c5c3_Err
223				}
224				var templ_7745c5c3_Var15 string
225				templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(p.Error)
226				if templ_7745c5c3_Err != nil {
227					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 46, Col: 68}
228				}
229				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
230				if templ_7745c5c3_Err != nil {
231					return templ_7745c5c3_Err
232				}
233				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</p>")
234				if templ_7745c5c3_Err != nil {
235					return templ_7745c5c3_Err
236				}
237			}
238			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<label for=\"issue-body\">description</label> <textarea id=\"issue-body\" aria-describedby=\"")
239			if templ_7745c5c3_Err != nil {
240				return templ_7745c5c3_Err
241			}
242			var templ_7745c5c3_Var16 string
243			templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.ResolveAttributeValue(issueFieldDescription("body", p.ErrorField))
244			if templ_7745c5c3_Err != nil {
245				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 51, Col: 66}
246			}
247			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var16)
248			if templ_7745c5c3_Err != nil {
249				return templ_7745c5c3_Err
250			}
251			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "\"")
252			if templ_7745c5c3_Err != nil {
253				return templ_7745c5c3_Err
254			}
255			if p.ErrorField == "body" {
256				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, " aria-invalid=\"true\"")
257				if templ_7745c5c3_Err != nil {
258					return templ_7745c5c3_Err
259				}
260			}
261			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, " name=\"body\" rows=\"8\" placeholder=\"Markdown, optional\">")
262			if templ_7745c5c3_Err != nil {
263				return templ_7745c5c3_Err
264			}
265			var templ_7745c5c3_Var17 string
266			templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(p.Body)
267			if templ_7745c5c3_Err != nil {
268				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 58, Col: 12}
269			}
270			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
271			if templ_7745c5c3_Err != nil {
272				return templ_7745c5c3_Err
273			}
274			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</textarea> <output id=\"issue-body-count\" aria-live=\"off\" data-for=\"issue-body\" data-max=\"")
275			if templ_7745c5c3_Err != nil {
276				return templ_7745c5c3_Err
277			}
278			var templ_7745c5c3_Var18 string
279			templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(p.MaxBody))
280			if templ_7745c5c3_Err != nil {
281				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 59, Col: 97}
282			}
283			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var18)
284			if templ_7745c5c3_Err != nil {
285				return templ_7745c5c3_Err
286			}
287			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "\" for=\"issue-body\">")
288			if templ_7745c5c3_Err != nil {
289				return templ_7745c5c3_Err
290			}
291			var templ_7745c5c3_Var19 string
292			templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(runeCount(p.Body)))
293			if templ_7745c5c3_Err != nil {
294				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 59, Col: 142}
295			}
296			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
297			if templ_7745c5c3_Err != nil {
298				return templ_7745c5c3_Err
299			}
300			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, " / ")
301			if templ_7745c5c3_Err != nil {
302				return templ_7745c5c3_Err
303			}
304			var templ_7745c5c3_Var20 string
305			templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.MaxBody))
306			if templ_7745c5c3_Err != nil {
307				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 59, Col: 164}
308			}
309			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
310			if templ_7745c5c3_Err != nil {
311				return templ_7745c5c3_Err
312			}
313			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "</output> ")
314			if templ_7745c5c3_Err != nil {
315				return templ_7745c5c3_Err
316			}
317			if p.ErrorField == "body" {
318				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "<p id=\"issue-body-error\" class=\"f-error\" role=\"alert\">")
319				if templ_7745c5c3_Err != nil {
320					return templ_7745c5c3_Err
321				}
322				var templ_7745c5c3_Var21 string
323				templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(p.Error)
324				if templ_7745c5c3_Err != nil {
325					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 61, Col: 67}
326				}
327				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
328				if templ_7745c5c3_Err != nil {
329					return templ_7745c5c3_Err
330				}
331				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "</p>")
332				if templ_7745c5c3_Err != nil {
333					return templ_7745c5c3_Err
334				}
335			}
336			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "<label for=\"issue-author\">name (optional, not verified)</label> <input id=\"issue-author\" aria-describedby=\"")
337			if templ_7745c5c3_Err != nil {
338				return templ_7745c5c3_Err
339			}
340			var templ_7745c5c3_Var22 string
341			templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.ResolveAttributeValue(issueFieldDescription("author", p.ErrorField))
342			if templ_7745c5c3_Err != nil {
343				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 66, Col: 68}
344			}
345			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var22)
346			if templ_7745c5c3_Err != nil {
347				return templ_7745c5c3_Err
348			}
349			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "\"")
350			if templ_7745c5c3_Err != nil {
351				return templ_7745c5c3_Err
352			}
353			if p.ErrorField == "author" {
354				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, " aria-invalid=\"true\"")
355				if templ_7745c5c3_Err != nil {
356					return templ_7745c5c3_Err
357				}
358			}
359			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, " name=\"author\" type=\"text\" autocomplete=\"off\" value=\"")
360			if templ_7745c5c3_Err != nil {
361				return templ_7745c5c3_Err
362			}
363			var templ_7745c5c3_Var23 string
364			templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Author)
365			if templ_7745c5c3_Err != nil {
366				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 73, Col: 20}
367			}
368			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var23)
369			if templ_7745c5c3_Err != nil {
370				return templ_7745c5c3_Err
371			}
372			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "\"> <output id=\"issue-author-count\" aria-live=\"off\" data-for=\"issue-author\" data-max=\"")
373			if templ_7745c5c3_Err != nil {
374				return templ_7745c5c3_Err
375			}
376			var templ_7745c5c3_Var24 string
377			templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(p.MaxAuthor))
378			if templ_7745c5c3_Err != nil {
379				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 75, Col: 103}
380			}
381			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24)
382			if templ_7745c5c3_Err != nil {
383				return templ_7745c5c3_Err
384			}
385			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "\" for=\"issue-author\">")
386			if templ_7745c5c3_Err != nil {
387				return templ_7745c5c3_Err
388			}
389			var templ_7745c5c3_Var25 string
390			templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(runeCount(p.Author)))
391			if templ_7745c5c3_Err != nil {
392				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 75, Col: 152}
393			}
394			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
395			if templ_7745c5c3_Err != nil {
396				return templ_7745c5c3_Err
397			}
398			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, " / ")
399			if templ_7745c5c3_Err != nil {
400				return templ_7745c5c3_Err
401			}
402			var templ_7745c5c3_Var26 string
403			templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.MaxAuthor))
404			if templ_7745c5c3_Err != nil {
405				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 75, Col: 176}
406			}
407			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
408			if templ_7745c5c3_Err != nil {
409				return templ_7745c5c3_Err
410			}
411			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "</output> ")
412			if templ_7745c5c3_Err != nil {
413				return templ_7745c5c3_Err
414			}
415			if p.ErrorField == "author" {
416				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "<p id=\"issue-author-error\" class=\"f-error\" role=\"alert\">")
417				if templ_7745c5c3_Err != nil {
418					return templ_7745c5c3_Err
419				}
420				var templ_7745c5c3_Var27 string
421				templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(p.Error)
422				if templ_7745c5c3_Err != nil {
423					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 77, Col: 69}
424				}
425				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
426				if templ_7745c5c3_Err != nil {
427					return templ_7745c5c3_Err
428				}
429				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "</p>")
430				if templ_7745c5c3_Err != nil {
431					return templ_7745c5c3_Err
432				}
433			}
434			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "<div class=\"hp\" aria-hidden=\"true\"><label for=\"issue-website\">Leave this field empty</label> <input id=\"issue-website\" name=\"website\" type=\"text\" tabindex=\"-1\" autocomplete=\"off\" value=\"\"></div><p class=\"dim\" data-status role=\"status\" aria-live=\"polite\">Checking your browser… (this takes a few seconds)</p><div class=\"f-btns\"><button type=\"submit\" class=\"btn primary\" disabled>Submit for moderation</button> <a class=\"btn\" href=\"")
435			if templ_7745c5c3_Err != nil {
436				return templ_7745c5c3_Err
437			}
438			var templ_7745c5c3_Var28 templ.SafeURL
439			templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Cancel))
440			if templ_7745c5c3_Err != nil {
441				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/issues_form.templ`, Line: 86, Col: 49}
442			}
443			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
444			if templ_7745c5c3_Err != nil {
445				return templ_7745c5c3_Err
446			}
447			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "\">Cancel</a></div></form>")
448			if templ_7745c5c3_Err != nil {
449				return templ_7745c5c3_Err
450			}
451			return nil
452		})
453		templ_7745c5c3_Err = Shell(l, issueFormRail()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
454		if templ_7745c5c3_Err != nil {
455			return templ_7745c5c3_Err
456		}
457		return nil
458	})
459}
460
461func issueFormRail() templ.Component {
462	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
463		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
464		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
465			return templ_7745c5c3_CtxErr
466		}
467		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
468		if !templ_7745c5c3_IsBuffer {
469			defer func() {
470				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
471				if templ_7745c5c3_Err == nil {
472					templ_7745c5c3_Err = templ_7745c5c3_BufErr
473				}
474			}()
475		}
476		ctx = templ.InitializeContext(ctx)
477		templ_7745c5c3_Var29 := templ.GetChildren(ctx)
478		if templ_7745c5c3_Var29 == nil {
479			templ_7745c5c3_Var29 = templ.NopComponent
480		}
481		ctx = templ.ClearChildren(ctx)
482		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "<section aria-labelledby=\"r-about\"><h2 id=\"r-about\">Before you write</h2><p class=\"dim\">The owner reads every issue before it appears. Plain text and Markdown only; no address of yours is kept.</p></section>")
483		if templ_7745c5c3_Err != nil {
484			return templ_7745c5c3_Err
485		}
486		return nil
487	})
488}
489
490func issueFieldDescription(field, invalid string) string {
491	ids := "issue-" + field + "-count"
492	if field == invalid {
493		ids += " issue-" + field + "-error"
494	}
495	return ids
496}
497
498var _ = templruntime.GeneratedTemplate

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 4

Tags 45

↑↓ moveenter openesc close