detached 0e6522c

mr_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
13import "strings"
14
15// MRList is the list of the merge requests of a repository: the open ones,
16// then the merged and closed ones.
17func MRList(l Layout, p MRListPage) templ.Component {
18	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
19		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
20		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
21			return templ_7745c5c3_CtxErr
22		}
23		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
24		if !templ_7745c5c3_IsBuffer {
25			defer func() {
26				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
27				if templ_7745c5c3_Err == nil {
28					templ_7745c5c3_Err = templ_7745c5c3_BufErr
29				}
30			}()
31		}
32		ctx = templ.InitializeContext(ctx)
33		templ_7745c5c3_Var1 := templ.GetChildren(ctx)
34		if templ_7745c5c3_Var1 == nil {
35			templ_7745c5c3_Var1 = templ.NopComponent
36		}
37		ctx = templ.ClearChildren(ctx)
38		templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
39			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
40			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
41			if !templ_7745c5c3_IsBuffer {
42				defer func() {
43					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
44					if templ_7745c5c3_Err == nil {
45						templ_7745c5c3_Err = templ_7745c5c3_BufErr
46					}
47				}()
48			}
49			ctx = templ.InitializeContext(ctx)
50			if p.Live {
51				templ_7745c5c3_Err = LiveSlot("mr-notice").Render(ctx, templ_7745c5c3_Buffer)
52				if templ_7745c5c3_Err != nil {
53					return templ_7745c5c3_Err
54				}
55			}
56			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, " <div class=\"filter\"><label for=\"mr-filter\" class=\"sr\">filter</label> <input id=\"mr-filter\" type=\"search\" data-filter=\".mrs tbody tr\" placeholder=\"Filter by title, branch, author or state…\" autocomplete=\"off\" hx-on:input=\"ermite.filter(this)\"></div>")
57			if templ_7745c5c3_Err != nil {
58				return templ_7745c5c3_Err
59			}
60			if p.Newest == "" {
61				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "<h2 class=\"rule-h\"><span>Open</span><span class=\"count\">")
62				if templ_7745c5c3_Err != nil {
63					return templ_7745c5c3_Err
64				}
65				var templ_7745c5c3_Var3 string
66				templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Open)))
67				if templ_7745c5c3_Err != nil {
68					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 26, Col: 78}
69				}
70				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
71				if templ_7745c5c3_Err != nil {
72					return templ_7745c5c3_Err
73				}
74				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</span></h2>")
75				if templ_7745c5c3_Err != nil {
76					return templ_7745c5c3_Err
77				}
78				templ_7745c5c3_Err = mrRows(p.Open, "Open merge requests").Render(ctx, templ_7745c5c3_Buffer)
79				if templ_7745c5c3_Err != nil {
80					return templ_7745c5c3_Err
81				}
82				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, " ")
83				if templ_7745c5c3_Err != nil {
84					return templ_7745c5c3_Err
85				}
86				if len(p.Open) == 0 {
87					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<p class=\"lede dim\">no open merge requests.</p>")
88					if templ_7745c5c3_Err != nil {
89						return templ_7745c5c3_Err
90					}
91				}
92				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, " ")
93				if templ_7745c5c3_Err != nil {
94					return templ_7745c5c3_Err
95				}
96				if p.OpenNote != "" {
97					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "<p class=\"note\">")
98					if templ_7745c5c3_Err != nil {
99						return templ_7745c5c3_Err
100					}
101					var templ_7745c5c3_Var4 string
102					templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(p.OpenNote)
103					if templ_7745c5c3_Err != nil {
104						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 32, Col: 32}
105					}
106					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
107					if templ_7745c5c3_Err != nil {
108						return templ_7745c5c3_Err
109					}
110					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "</p>")
111					if templ_7745c5c3_Err != nil {
112						return templ_7745c5c3_Err
113					}
114				}
115			}
116			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, " <h2 class=\"rule-h\"><span>Merged and closed</span><span class=\"count\">")
117			if templ_7745c5c3_Err != nil {
118				return templ_7745c5c3_Err
119			}
120			var templ_7745c5c3_Var5 string
121			templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Done)))
122			if templ_7745c5c3_Err != nil {
123				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 35, Col: 90}
124			}
125			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
126			if templ_7745c5c3_Err != nil {
127				return templ_7745c5c3_Err
128			}
129			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "</span></h2>")
130			if templ_7745c5c3_Err != nil {
131				return templ_7745c5c3_Err
132			}
133			templ_7745c5c3_Err = mrRows(p.Done, "Merged and closed merge requests").Render(ctx, templ_7745c5c3_Buffer)
134			if templ_7745c5c3_Err != nil {
135				return templ_7745c5c3_Err
136			}
137			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, " ")
138			if templ_7745c5c3_Err != nil {
139				return templ_7745c5c3_Err
140			}
141			if len(p.Done) == 0 {
142				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "<p class=\"lede dim\">nothing merged or closed yet.</p>")
143				if templ_7745c5c3_Err != nil {
144					return templ_7745c5c3_Err
145				}
146			}
147			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, " ")
148			if templ_7745c5c3_Err != nil {
149				return templ_7745c5c3_Err
150			}
151			if p.Older != "" || p.Newest != "" {
152				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "<nav class=\"pager\" aria-label=\"Pages\">")
153				if templ_7745c5c3_Err != nil {
154					return templ_7745c5c3_Err
155				}
156				if p.Newest != "" {
157					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "<a class=\"btn\" href=\"")
158					if templ_7745c5c3_Err != nil {
159						return templ_7745c5c3_Err
160					}
161					var templ_7745c5c3_Var6 templ.SafeURL
162					templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Newest))
163					if templ_7745c5c3_Err != nil {
164						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 43, Col: 50}
165					}
166					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
167					if templ_7745c5c3_Err != nil {
168						return templ_7745c5c3_Err
169					}
170					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "\">← Newest</a> ")
171					if templ_7745c5c3_Err != nil {
172						return templ_7745c5c3_Err
173					}
174				} else {
175					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "<span class=\"btn\" aria-disabled=\"true\">← Newest</span> ")
176					if templ_7745c5c3_Err != nil {
177						return templ_7745c5c3_Err
178					}
179				}
180				if p.Older != "" {
181					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<a class=\"btn\" href=\"")
182					if templ_7745c5c3_Err != nil {
183						return templ_7745c5c3_Err
184					}
185					var templ_7745c5c3_Var7 templ.SafeURL
186					templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Older))
187					if templ_7745c5c3_Err != nil {
188						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 48, Col: 49}
189					}
190					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
191					if templ_7745c5c3_Err != nil {
192						return templ_7745c5c3_Err
193					}
194					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "\" rel=\"next\">Older →</a>")
195					if templ_7745c5c3_Err != nil {
196						return templ_7745c5c3_Err
197					}
198				} else {
199					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<span class=\"btn\" aria-disabled=\"true\">Older →</span>")
200					if templ_7745c5c3_Err != nil {
201						return templ_7745c5c3_Err
202					}
203				}
204				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "</nav>")
205				if templ_7745c5c3_Err != nil {
206					return templ_7745c5c3_Err
207				}
208			}
209			return nil
210		})
211		templ_7745c5c3_Err = Shell(l, mrListRail(p)).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
212		if templ_7745c5c3_Err != nil {
213			return templ_7745c5c3_Err
214		}
215		return nil
216	})
217}
218
219func mrRows(rows []MRRow, label string) templ.Component {
220	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
221		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
222		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
223			return templ_7745c5c3_CtxErr
224		}
225		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
226		if !templ_7745c5c3_IsBuffer {
227			defer func() {
228				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
229				if templ_7745c5c3_Err == nil {
230					templ_7745c5c3_Err = templ_7745c5c3_BufErr
231				}
232			}()
233		}
234		ctx = templ.InitializeContext(ctx)
235		templ_7745c5c3_Var8 := templ.GetChildren(ctx)
236		if templ_7745c5c3_Var8 == nil {
237			templ_7745c5c3_Var8 = templ.NopComponent
238		}
239		ctx = templ.ClearChildren(ctx)
240		if len(rows) > 0 {
241			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "<table class=\"list mrs\" aria-label=\"")
242			if templ_7745c5c3_Err != nil {
243				return templ_7745c5c3_Err
244			}
245			var templ_7745c5c3_Var9 string
246			templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.ResolveAttributeValue(label)
247			if templ_7745c5c3_Err != nil {
248				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 59, Col: 44}
249			}
250			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
251			if templ_7745c5c3_Err != nil {
252				return templ_7745c5c3_Err
253			}
254			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "\"><tbody data-rows>")
255			if templ_7745c5c3_Err != nil {
256				return templ_7745c5c3_Err
257			}
258			for _, m := range rows {
259				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "<tr")
260				if templ_7745c5c3_Err != nil {
261					return templ_7745c5c3_Err
262				}
263				if m.Cursor {
264					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, " data-cursor")
265					if templ_7745c5c3_Err != nil {
266						return templ_7745c5c3_Err
267					}
268				}
269				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, " data-state=\"")
270				if templ_7745c5c3_Err != nil {
271					return templ_7745c5c3_Err
272				}
273				var templ_7745c5c3_Var10 string
274				templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.State)
275				if templ_7745c5c3_Err != nil {
276					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 62, Col: 55}
277				}
278				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10)
279				if templ_7745c5c3_Err != nil {
280					return templ_7745c5c3_Err
281				}
282				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "\"><td class=\"c-n mute\">")
283				if templ_7745c5c3_Err != nil {
284					return templ_7745c5c3_Err
285				}
286				var templ_7745c5c3_Var11 string
287				templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(m.Number)
288				if templ_7745c5c3_Err != nil {
289					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 63, Col: 37}
290				}
291				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
292				if templ_7745c5c3_Err != nil {
293					return templ_7745c5c3_Err
294				}
295				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "</td><td class=\"c-state\">")
296				if templ_7745c5c3_Err != nil {
297					return templ_7745c5c3_Err
298				}
299				var templ_7745c5c3_Var12 string
300				templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(m.State)
301				if templ_7745c5c3_Err != nil {
302					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 64, Col: 35}
303				}
304				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
305				if templ_7745c5c3_Err != nil {
306					return templ_7745c5c3_Err
307				}
308				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "</td><td class=\"c-subject\"><a href=\"")
309				if templ_7745c5c3_Err != nil {
310					return templ_7745c5c3_Err
311				}
312				var templ_7745c5c3_Var13 templ.SafeURL
313				templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(m.Href))
314				if templ_7745c5c3_Err != nil {
315					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 65, Col: 59}
316				}
317				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
318				if templ_7745c5c3_Err != nil {
319					return templ_7745c5c3_Err
320				}
321				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "\">")
322				if templ_7745c5c3_Err != nil {
323					return templ_7745c5c3_Err
324				}
325				var templ_7745c5c3_Var14 string
326				templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(m.Title)
327				if templ_7745c5c3_Err != nil {
328					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 65, Col: 71}
329				}
330				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
331				if templ_7745c5c3_Err != nil {
332					return templ_7745c5c3_Err
333				}
334				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "</a> <span class=\"mute\">")
335				if templ_7745c5c3_Err != nil {
336					return templ_7745c5c3_Err
337				}
338				var templ_7745c5c3_Var15 string
339				templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(m.Branches)
340				if templ_7745c5c3_Err != nil {
341					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 65, Col: 109}
342				}
343				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
344				if templ_7745c5c3_Err != nil {
345					return templ_7745c5c3_Err
346				}
347				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "</span></td><td class=\"c-who dim\">")
348				if templ_7745c5c3_Err != nil {
349					return templ_7745c5c3_Err
350				}
351				var templ_7745c5c3_Var16 string
352				templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(m.Author)
353				if templ_7745c5c3_Err != nil {
354					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 66, Col: 38}
355				}
356				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
357				if templ_7745c5c3_Err != nil {
358					return templ_7745c5c3_Err
359				}
360				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "</td><td class=\"c-when nowrap dim\">")
361				if templ_7745c5c3_Err != nil {
362					return templ_7745c5c3_Err
363				}
364				if m.WhenAt != "" {
365					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "<time datetime=\"")
366					if templ_7745c5c3_Err != nil {
367						return templ_7745c5c3_Err
368					}
369					var templ_7745c5c3_Var17 string
370					templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.WhenAt)
371					if templ_7745c5c3_Err != nil {
372						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 69, Col: 33}
373					}
374					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var17)
375					if templ_7745c5c3_Err != nil {
376						return templ_7745c5c3_Err
377					}
378					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "\" title=\"")
379					if templ_7745c5c3_Err != nil {
380						return templ_7745c5c3_Err
381					}
382					var templ_7745c5c3_Var18 string
383					templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.WhenAt)
384					if templ_7745c5c3_Err != nil {
385						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 69, Col: 52}
386					}
387					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var18)
388					if templ_7745c5c3_Err != nil {
389						return templ_7745c5c3_Err
390					}
391					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "\">")
392					if templ_7745c5c3_Err != nil {
393						return templ_7745c5c3_Err
394					}
395					var templ_7745c5c3_Var19 string
396					templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(m.When)
397					if templ_7745c5c3_Err != nil {
398						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 69, Col: 63}
399					}
400					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
401					if templ_7745c5c3_Err != nil {
402						return templ_7745c5c3_Err
403					}
404					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "</time>")
405					if templ_7745c5c3_Err != nil {
406						return templ_7745c5c3_Err
407					}
408				}
409				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "</td></tr>")
410				if templ_7745c5c3_Err != nil {
411					return templ_7745c5c3_Err
412				}
413			}
414			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "</tbody></table>")
415			if templ_7745c5c3_Err != nil {
416				return templ_7745c5c3_Err
417			}
418		}
419		return nil
420	})
421}
422
423func mrListRail(p MRListPage) templ.Component {
424	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
425		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
426		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
427			return templ_7745c5c3_CtxErr
428		}
429		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
430		if !templ_7745c5c3_IsBuffer {
431			defer func() {
432				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
433				if templ_7745c5c3_Err == nil {
434					templ_7745c5c3_Err = templ_7745c5c3_BufErr
435				}
436			}()
437		}
438		ctx = templ.InitializeContext(ctx)
439		templ_7745c5c3_Var20 := templ.GetChildren(ctx)
440		if templ_7745c5c3_Var20 == nil {
441			templ_7745c5c3_Var20 = templ.NopComponent
442		}
443		ctx = templ.ClearChildren(ctx)
444		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "<section aria-labelledby=\"r-states\"><h2 id=\"r-states\">States</h2><dl class=\"kv\"><dt>open</dt><dd>awaits review</dd><dt>merged</dt><dd>the target took the branch</dd><dt>closed</dt><dd>refused, branch kept</dd></dl></section><section aria-labelledby=\"r-new\"><h2 id=\"r-new\">Open one</h2>")
445		if templ_7745c5c3_Err != nil {
446			return templ_7745c5c3_Err
447		}
448		if len(p.Branches) > 0 {
449			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "<p class=\"dim\">compare a branch with ")
450			if templ_7745c5c3_Err != nil {
451				return templ_7745c5c3_Err
452			}
453			var templ_7745c5c3_Var21 string
454			templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(p.Default)
455			if templ_7745c5c3_Err != nil {
456				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 94, Col: 51}
457			}
458			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
459			if templ_7745c5c3_Err != nil {
460				return templ_7745c5c3_Err
461			}
462			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, ":</p><nav class=\"outline\" aria-label=\"Branches\">")
463			if templ_7745c5c3_Err != nil {
464				return templ_7745c5c3_Err
465			}
466			for _, b := range p.Branches {
467				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "<a href=\"")
468				if templ_7745c5c3_Err != nil {
469					return templ_7745c5c3_Err
470				}
471				var templ_7745c5c3_Var22 templ.SafeURL
472				templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(b.Href))
473				if templ_7745c5c3_Err != nil {
474					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 97, Col: 36}
475				}
476				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
477				if templ_7745c5c3_Err != nil {
478					return templ_7745c5c3_Err
479				}
480				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "\">")
481				if templ_7745c5c3_Err != nil {
482					return templ_7745c5c3_Err
483				}
484				var templ_7745c5c3_Var23 string
485				templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(b.Name)
486				if templ_7745c5c3_Err != nil {
487					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 97, Col: 47}
488				}
489				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
490				if templ_7745c5c3_Err != nil {
491					return templ_7745c5c3_Err
492				}
493				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "</a>")
494				if templ_7745c5c3_Err != nil {
495					return templ_7745c5c3_Err
496				}
497			}
498			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "</nav>")
499			if templ_7745c5c3_Err != nil {
500				return templ_7745c5c3_Err
501			}
502		} else {
503			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "<p class=\"dim\">there is no other branch to merge yet.</p>")
504			if templ_7745c5c3_Err != nil {
505				return templ_7745c5c3_Err
506			}
507		}
508		templ_7745c5c3_Err = CloneBlock(p.CLI).Render(ctx, templ_7745c5c3_Buffer)
509		if templ_7745c5c3_Err != nil {
510			return templ_7745c5c3_Err
511		}
512		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "</section>")
513		if templ_7745c5c3_Err != nil {
514			return templ_7745c5c3_Err
515		}
516		return nil
517	})
518}
519
520// MergeRequest is a merge request: its facts, its description, the diff with
521// the notes under their lines, the general comments; and in the rail the merge
522// form, the checks, the settings, the commits and the files.
523func MergeRequest(l Layout, p MRPage) templ.Component {
524	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
525		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
526		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
527			return templ_7745c5c3_CtxErr
528		}
529		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
530		if !templ_7745c5c3_IsBuffer {
531			defer func() {
532				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
533				if templ_7745c5c3_Err == nil {
534					templ_7745c5c3_Err = templ_7745c5c3_BufErr
535				}
536			}()
537		}
538		ctx = templ.InitializeContext(ctx)
539		templ_7745c5c3_Var24 := templ.GetChildren(ctx)
540		if templ_7745c5c3_Var24 == nil {
541			templ_7745c5c3_Var24 = templ.NopComponent
542		}
543		ctx = templ.ClearChildren(ctx)
544		templ_7745c5c3_Var25 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
545			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
546			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
547			if !templ_7745c5c3_IsBuffer {
548				defer func() {
549					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
550					if templ_7745c5c3_Err == nil {
551						templ_7745c5c3_Err = templ_7745c5c3_BufErr
552					}
553				}()
554			}
555			ctx = templ.InitializeContext(ctx)
556			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "<header class=\"show mr-h\"><h1><span class=\"mute\">")
557			if templ_7745c5c3_Err != nil {
558				return templ_7745c5c3_Err
559			}
560			var templ_7745c5c3_Var26 string
561			templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(p.Number)
562			if templ_7745c5c3_Err != nil {
563				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 113, Col: 36}
564			}
565			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
566			if templ_7745c5c3_Err != nil {
567				return templ_7745c5c3_Err
568			}
569			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "</span> ")
570			if templ_7745c5c3_Err != nil {
571				return templ_7745c5c3_Err
572			}
573			var templ_7745c5c3_Var27 string
574			templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(p.Title)
575			if templ_7745c5c3_Err != nil {
576				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 113, Col: 55}
577			}
578			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
579			if templ_7745c5c3_Err != nil {
580				return templ_7745c5c3_Err
581			}
582			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "</h1><dl class=\"kv show-kv\"><dt>state</dt><dd class=\"mr-state\" data-state=\"")
583			if templ_7745c5c3_Err != nil {
584				return templ_7745c5c3_Err
585			}
586			var templ_7745c5c3_Var28 string
587			templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.State)
588			if templ_7745c5c3_Err != nil {
589				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 116, Col: 45}
590			}
591			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var28)
592			if templ_7745c5c3_Err != nil {
593				return templ_7745c5c3_Err
594			}
595			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "\">")
596			if templ_7745c5c3_Err != nil {
597				return templ_7745c5c3_Err
598			}
599			var templ_7745c5c3_Var29 string
600			templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(p.State)
601			if templ_7745c5c3_Err != nil {
602				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 117, Col: 14}
603			}
604			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
605			if templ_7745c5c3_Err != nil {
606				return templ_7745c5c3_Err
607			}
608			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, " ")
609			if templ_7745c5c3_Err != nil {
610				return templ_7745c5c3_Err
611			}
612			if p.MergedShort != "" {
613				var templ_7745c5c3_Var30 string
614				templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(" · ")
615				if templ_7745c5c3_Err != nil {
616					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 119, Col: 14}
617				}
618				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
619				if templ_7745c5c3_Err != nil {
620					return templ_7745c5c3_Err
621				}
622				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "<a href=\"")
623				if templ_7745c5c3_Err != nil {
624					return templ_7745c5c3_Err
625				}
626				var templ_7745c5c3_Var31 templ.SafeURL
627				templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.MergedHref))
628				if templ_7745c5c3_Err != nil {
629					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 119, Col: 53}
630				}
631				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
632				if templ_7745c5c3_Err != nil {
633					return templ_7745c5c3_Err
634				}
635				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "\">")
636				if templ_7745c5c3_Err != nil {
637					return templ_7745c5c3_Err
638				}
639				var templ_7745c5c3_Var32 string
640				templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(p.MergedShort)
641				if templ_7745c5c3_Err != nil {
642					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 119, Col: 71}
643				}
644				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
645				if templ_7745c5c3_Err != nil {
646					return templ_7745c5c3_Err
647				}
648				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "</a>")
649				if templ_7745c5c3_Err != nil {
650					return templ_7745c5c3_Err
651				}
652				var templ_7745c5c3_Var33 string
653				templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(" · " + p.MergeMode)
654				if templ_7745c5c3_Err != nil {
655					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 119, Col: 99}
656				}
657				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33))
658				if templ_7745c5c3_Err != nil {
659					return templ_7745c5c3_Err
660				}
661			}
662			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "</dd><dt>branch</dt><dd>")
663			if templ_7745c5c3_Err != nil {
664				return templ_7745c5c3_Err
665			}
666			templ_7745c5c3_Err = branchLink(p.Source, p.SourceHref).Render(ctx, templ_7745c5c3_Buffer)
667			if templ_7745c5c3_Err != nil {
668				return templ_7745c5c3_Err
669			}
670			var templ_7745c5c3_Var34 string
671			templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(" → ")
672			if templ_7745c5c3_Err != nil {
673				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 125, Col: 14}
674			}
675			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34))
676			if templ_7745c5c3_Err != nil {
677				return templ_7745c5c3_Err
678			}
679			templ_7745c5c3_Err = branchLink(p.Target, p.TargetHref).Render(ctx, templ_7745c5c3_Buffer)
680			if templ_7745c5c3_Err != nil {
681				return templ_7745c5c3_Err
682			}
683			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "</dd><dt>opened</dt><dd>")
684			if templ_7745c5c3_Err != nil {
685				return templ_7745c5c3_Err
686			}
687			var templ_7745c5c3_Var35 string
688			templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(p.Opened.Name)
689			if templ_7745c5c3_Err != nil {
690				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 130, Col: 20}
691			}
692			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
693			if templ_7745c5c3_Err != nil {
694				return templ_7745c5c3_Err
695			}
696			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, " ")
697			if templ_7745c5c3_Err != nil {
698				return templ_7745c5c3_Err
699			}
700			if p.Opened.WhenAt != "" {
701				var templ_7745c5c3_Var36 string
702				templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(" · ")
703				if templ_7745c5c3_Err != nil {
704					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 132, Col: 14}
705				}
706				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36))
707				if templ_7745c5c3_Err != nil {
708					return templ_7745c5c3_Err
709				}
710				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "<time datetime=\"")
711				if templ_7745c5c3_Err != nil {
712					return templ_7745c5c3_Err
713				}
714				var templ_7745c5c3_Var37 string
715				templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Opened.WhenAt)
716				if templ_7745c5c3_Err != nil {
717					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 132, Col: 48}
718				}
719				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var37)
720				if templ_7745c5c3_Err != nil {
721					return templ_7745c5c3_Err
722				}
723				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "\" title=\"")
724				if templ_7745c5c3_Err != nil {
725					return templ_7745c5c3_Err
726				}
727				var templ_7745c5c3_Var38 string
728				templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Opened.Abs)
729				if templ_7745c5c3_Err != nil {
730					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 132, Col: 71}
731				}
732				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var38)
733				if templ_7745c5c3_Err != nil {
734					return templ_7745c5c3_Err
735				}
736				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "\">")
737				if templ_7745c5c3_Err != nil {
738					return templ_7745c5c3_Err
739				}
740				var templ_7745c5c3_Var39 string
741				templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(p.Opened.When)
742				if templ_7745c5c3_Err != nil {
743					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 132, Col: 89}
744				}
745				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39))
746				if templ_7745c5c3_Err != nil {
747					return templ_7745c5c3_Err
748				}
749				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "</time>")
750				if templ_7745c5c3_Err != nil {
751					return templ_7745c5c3_Err
752				}
753			}
754			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "</dd>")
755			if templ_7745c5c3_Err != nil {
756				return templ_7745c5c3_Err
757			}
758			if p.UpdatedAt != "" {
759				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "<dt>updated</dt><dd><time datetime=\"")
760				if templ_7745c5c3_Err != nil {
761					return templ_7745c5c3_Err
762				}
763				var templ_7745c5c3_Var40 string
764				templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.UpdatedAt)
765				if templ_7745c5c3_Err != nil {
766					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 137, Col: 37}
767				}
768				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var40)
769				if templ_7745c5c3_Err != nil {
770					return templ_7745c5c3_Err
771				}
772				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "\">")
773				if templ_7745c5c3_Err != nil {
774					return templ_7745c5c3_Err
775				}
776				var templ_7745c5c3_Var41 string
777				templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(p.Updated)
778				if templ_7745c5c3_Err != nil {
779					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 137, Col: 51}
780				}
781				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41))
782				if templ_7745c5c3_Err != nil {
783					return templ_7745c5c3_Err
784				}
785				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "</time></dd>")
786				if templ_7745c5c3_Err != nil {
787					return templ_7745c5c3_Err
788				}
789			}
790			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "</dl></header>")
791			if templ_7745c5c3_Err != nil {
792				return templ_7745c5c3_Err
793			}
794			templ_7745c5c3_Err = LiveSlot("mr-notice").Render(ctx, templ_7745c5c3_Buffer)
795			if templ_7745c5c3_Err != nil {
796				return templ_7745c5c3_Err
797			}
798			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, " ")
799			if templ_7745c5c3_Err != nil {
800				return templ_7745c5c3_Err
801			}
802			if p.Desc != "" {
803				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, "<article class=\"mr-desc prose\" aria-label=\"description\" hx-ignore>")
804				if templ_7745c5c3_Err != nil {
805					return templ_7745c5c3_Err
806				}
807				templ_7745c5c3_Err = templ.Raw(string(p.Desc)).Render(ctx, templ_7745c5c3_Buffer)
808				if templ_7745c5c3_Err != nil {
809					return templ_7745c5c3_Err
810				}
811				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "</article>")
812				if templ_7745c5c3_Err != nil {
813					return templ_7745c5c3_Err
814				}
815			}
816			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, " ")
817			if templ_7745c5c3_Err != nil {
818				return templ_7745c5c3_Err
819			}
820			if p.Since != nil {
821				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, "<nav class=\"since\" aria-label=\"Diff range\"><a href=\"")
822				if templ_7745c5c3_Err != nil {
823					return templ_7745c5c3_Err
824				}
825				var templ_7745c5c3_Var42 templ.SafeURL
826				templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Since.AllHref))
827				if templ_7745c5c3_Err != nil {
828					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 150, Col: 42}
829				}
830				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42))
831				if templ_7745c5c3_Err != nil {
832					return templ_7745c5c3_Err
833				}
834				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 74, "\"")
835				if templ_7745c5c3_Err != nil {
836					return templ_7745c5c3_Err
837				}
838				if !p.Since.Current {
839					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 75, " aria-current=\"page\"")
840					if templ_7745c5c3_Err != nil {
841						return templ_7745c5c3_Err
842					}
843				}
844				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 76, ">all changes <span class=\"mute\">vs ")
845				if templ_7745c5c3_Err != nil {
846					return templ_7745c5c3_Err
847				}
848				var templ_7745c5c3_Var43 string
849				templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
850				if templ_7745c5c3_Err != nil {
851					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 154, Col: 49}
852				}
853				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43))
854				if templ_7745c5c3_Err != nil {
855					return templ_7745c5c3_Err
856				}
857				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 77, "</span></a> <a href=\"")
858				if templ_7745c5c3_Err != nil {
859					return templ_7745c5c3_Err
860				}
861				var templ_7745c5c3_Var44 templ.SafeURL
862				templ_7745c5c3_Var44, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Since.SinceHref))
863				if templ_7745c5c3_Err != nil {
864					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 156, Col: 44}
865				}
866				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var44))
867				if templ_7745c5c3_Err != nil {
868					return templ_7745c5c3_Err
869				}
870				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 78, "\"")
871				if templ_7745c5c3_Err != nil {
872					return templ_7745c5c3_Err
873				}
874				if p.Since.Current {
875					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 79, " aria-current=\"page\"")
876					if templ_7745c5c3_Err != nil {
877						return templ_7745c5c3_Err
878					}
879				}
880				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 80, ">since your last read <span class=\"mute\">")
881				if templ_7745c5c3_Err != nil {
882					return templ_7745c5c3_Err
883				}
884				var templ_7745c5c3_Var45 string
885				templ_7745c5c3_Var45, templ_7745c5c3_Err = templ.JoinStringErrs(p.Since.ReadShort)
886				if templ_7745c5c3_Err != nil {
887					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 160, Col: 64}
888				}
889				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var45))
890				if templ_7745c5c3_Err != nil {
891					return templ_7745c5c3_Err
892				}
893				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 81, " → ")
894				if templ_7745c5c3_Err != nil {
895					return templ_7745c5c3_Err
896				}
897				var templ_7745c5c3_Var46 string
898				templ_7745c5c3_Var46, templ_7745c5c3_Err = templ.JoinStringErrs(p.Since.HeadShort)
899				if templ_7745c5c3_Err != nil {
900					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 160, Col: 90}
901				}
902				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var46))
903				if templ_7745c5c3_Err != nil {
904					return templ_7745c5c3_Err
905				}
906				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 82, "</span></a></nav>")
907				if templ_7745c5c3_Err != nil {
908					return templ_7745c5c3_Err
909				}
910			}
911			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 83, " ")
912			if templ_7745c5c3_Err != nil {
913				return templ_7745c5c3_Err
914			}
915			if p.SinceNote != "" {
916				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 84, "<p class=\"notice\">")
917				if templ_7745c5c3_Err != nil {
918					return templ_7745c5c3_Err
919				}
920				var templ_7745c5c3_Var47 string
921				templ_7745c5c3_Var47, templ_7745c5c3_Err = templ.JoinStringErrs(p.SinceNote)
922				if templ_7745c5c3_Err != nil {
923					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 164, Col: 34}
924				}
925				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var47))
926				if templ_7745c5c3_Err != nil {
927					return templ_7745c5c3_Err
928				}
929				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 85, "</p>")
930				if templ_7745c5c3_Err != nil {
931					return templ_7745c5c3_Err
932				}
933			}
934			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 86, " ")
935			if templ_7745c5c3_Err != nil {
936				return templ_7745c5c3_Err
937			}
938			templ_7745c5c3_Err = mrBar(p).Render(ctx, templ_7745c5c3_Buffer)
939			if templ_7745c5c3_Err != nil {
940				return templ_7745c5c3_Err
941			}
942			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 87, " ")
943			if templ_7745c5c3_Err != nil {
944				return templ_7745c5c3_Err
945			}
946			if p.Invisible {
947				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 88, "<p class=\"notice\">this diff holds invisible characters (direction controls, zero-width characters). They are shown as <span class=\"inv\">&lt;U+XXXX&gt;</span> markers, never applied.</p>")
948				if templ_7745c5c3_Err != nil {
949					return templ_7745c5c3_Err
950				}
951			}
952			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 89, " ")
953			if templ_7745c5c3_Err != nil {
954				return templ_7745c5c3_Err
955			}
956			if p.Note != "" {
957				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 90, "<p class=\"notice\">")
958				if templ_7745c5c3_Err != nil {
959					return templ_7745c5c3_Err
960				}
961				var templ_7745c5c3_Var48 string
962				templ_7745c5c3_Var48, templ_7745c5c3_Err = templ.JoinStringErrs(p.Note)
963				if templ_7745c5c3_Err != nil {
964					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 174, Col: 29}
965				}
966				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var48))
967				if templ_7745c5c3_Err != nil {
968					return templ_7745c5c3_Err
969				}
970				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 91, "</p>")
971				if templ_7745c5c3_Err != nil {
972					return templ_7745c5c3_Err
973				}
974			}
975			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 92, " <div id=\"diffs\" data-mr")
976			if templ_7745c5c3_Err != nil {
977				return templ_7745c5c3_Err
978			}
979			if p.Both {
980				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 93, " data-diff=\"")
981				if templ_7745c5c3_Err != nil {
982					return templ_7745c5c3_Err
983				}
984				var templ_7745c5c3_Var49 string
985				templ_7745c5c3_Var49, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
986				if templ_7745c5c3_Err != nil {
987					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 180, Col: 22}
988				}
989				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var49)
990				if templ_7745c5c3_Err != nil {
991					return templ_7745c5c3_Err
992				}
993				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 94, "\"")
994				if templ_7745c5c3_Err != nil {
995					return templ_7745c5c3_Err
996				}
997			} else {
998				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 95, " data-view=\"")
999				if templ_7745c5c3_Err != nil {
1000					return templ_7745c5c3_Err
1001				}
1002				var templ_7745c5c3_Var50 string
1003				templ_7745c5c3_Var50, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
1004				if templ_7745c5c3_Err != nil {
1005					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 182, Col: 22}
1006				}
1007				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var50)
1008				if templ_7745c5c3_Err != nil {
1009					return templ_7745c5c3_Err
1010				}
1011				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 96, "\"")
1012				if templ_7745c5c3_Err != nil {
1013					return templ_7745c5c3_Err
1014				}
1015			}
1016			if p.Both && !p.Pinned {
1017				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 97, " hx-live=\"this.dataset.diff = sessionStorage.getItem('diff') || this.dataset.diff\"")
1018				if templ_7745c5c3_Err != nil {
1019					return templ_7745c5c3_Err
1020				}
1021			}
1022			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 98, ">")
1023			if templ_7745c5c3_Err != nil {
1024				return templ_7745c5c3_Err
1025			}
1026			for _, f := range p.Files {
1027				templ_7745c5c3_Err = DiffFileView(f, p.DiffView).Render(ctx, templ_7745c5c3_Buffer)
1028				if templ_7745c5c3_Err != nil {
1029					return templ_7745c5c3_Err
1030				}
1031			}
1032			if len(p.Files) == 0 {
1033				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 99, "<p class=\"note\">no changed files.</p>")
1034				if templ_7745c5c3_Err != nil {
1035					return templ_7745c5c3_Err
1036				}
1037			}
1038			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 100, "</div><h2 class=\"rule-h\" id=\"comments\"><span>Comments</span><span class=\"count\">")
1039			if templ_7745c5c3_Err != nil {
1040				return templ_7745c5c3_Err
1041			}
1042			var templ_7745c5c3_Var51 string
1043			templ_7745c5c3_Var51, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.NUnresolved))
1044			if templ_7745c5c3_Err != nil {
1045				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 195, Col: 97}
1046			}
1047			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var51))
1048			if templ_7745c5c3_Err != nil {
1049				return templ_7745c5c3_Err
1050			}
1051			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 101, " open / ")
1052			if templ_7745c5c3_Err != nil {
1053				return templ_7745c5c3_Err
1054			}
1055			var templ_7745c5c3_Var52 string
1056			templ_7745c5c3_Var52, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.NComments))
1057			if templ_7745c5c3_Err != nil {
1058				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 195, Col: 126}
1059			}
1060			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var52))
1061			if templ_7745c5c3_Err != nil {
1062				return templ_7745c5c3_Err
1063			}
1064			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 102, "</span></h2>")
1065			if templ_7745c5c3_Err != nil {
1066				return templ_7745c5c3_Err
1067			}
1068			for _, c := range p.Loose {
1069				templ_7745c5c3_Err = commentView(c, "").Render(ctx, templ_7745c5c3_Buffer)
1070				if templ_7745c5c3_Err != nil {
1071					return templ_7745c5c3_Err
1072				}
1073			}
1074			for _, c := range p.General {
1075				templ_7745c5c3_Err = commentView(c, "").Render(ctx, templ_7745c5c3_Buffer)
1076				if templ_7745c5c3_Err != nil {
1077					return templ_7745c5c3_Err
1078				}
1079			}
1080			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 103, " ")
1081			if templ_7745c5c3_Err != nil {
1082				return templ_7745c5c3_Err
1083			}
1084			if p.NComments == 0 {
1085				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 104, "<p class=\"dim\">no comments yet.</p>")
1086				if templ_7745c5c3_Err != nil {
1087					return templ_7745c5c3_Err
1088				}
1089			}
1090			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 105, " ")
1091			if templ_7745c5c3_Err != nil {
1092				return templ_7745c5c3_Err
1093			}
1094			if p.GeneralForm != nil {
1095				templ_7745c5c3_Err = commentForm(*p.GeneralForm, "").Render(ctx, templ_7745c5c3_Buffer)
1096				if templ_7745c5c3_Err != nil {
1097					return templ_7745c5c3_Err
1098				}
1099			}
1100			return nil
1101		})
1102		templ_7745c5c3_Err = Shell(l, mrRail(p)).Render(templ.WithChildren(ctx, templ_7745c5c3_Var25), templ_7745c5c3_Buffer)
1103		if templ_7745c5c3_Err != nil {
1104			return templ_7745c5c3_Err
1105		}
1106		return nil
1107	})
1108}
1109
1110func branchLink(name, href string) templ.Component {
1111	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1112		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1113		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1114			return templ_7745c5c3_CtxErr
1115		}
1116		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1117		if !templ_7745c5c3_IsBuffer {
1118			defer func() {
1119				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1120				if templ_7745c5c3_Err == nil {
1121					templ_7745c5c3_Err = templ_7745c5c3_BufErr
1122				}
1123			}()
1124		}
1125		ctx = templ.InitializeContext(ctx)
1126		templ_7745c5c3_Var53 := templ.GetChildren(ctx)
1127		if templ_7745c5c3_Var53 == nil {
1128			templ_7745c5c3_Var53 = templ.NopComponent
1129		}
1130		ctx = templ.ClearChildren(ctx)
1131		if href != "" {
1132			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 106, "<a href=\"")
1133			if templ_7745c5c3_Err != nil {
1134				return templ_7745c5c3_Err
1135			}
1136			var templ_7745c5c3_Var54 templ.SafeURL
1137			templ_7745c5c3_Var54, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(href))
1138			if templ_7745c5c3_Err != nil {
1139				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 213, Col: 31}
1140			}
1141			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var54))
1142			if templ_7745c5c3_Err != nil {
1143				return templ_7745c5c3_Err
1144			}
1145			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 107, "\">")
1146			if templ_7745c5c3_Err != nil {
1147				return templ_7745c5c3_Err
1148			}
1149			var templ_7745c5c3_Var55 string
1150			templ_7745c5c3_Var55, templ_7745c5c3_Err = templ.JoinStringErrs(name)
1151			if templ_7745c5c3_Err != nil {
1152				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 213, Col: 40}
1153			}
1154			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var55))
1155			if templ_7745c5c3_Err != nil {
1156				return templ_7745c5c3_Err
1157			}
1158			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 108, "</a>")
1159			if templ_7745c5c3_Err != nil {
1160				return templ_7745c5c3_Err
1161			}
1162		} else {
1163			var templ_7745c5c3_Var56 string
1164			templ_7745c5c3_Var56, templ_7745c5c3_Err = templ.JoinStringErrs(name)
1165			if templ_7745c5c3_Err != nil {
1166				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 215, Col: 8}
1167			}
1168			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var56))
1169			if templ_7745c5c3_Err != nil {
1170				return templ_7745c5c3_Err
1171			}
1172		}
1173		return nil
1174	})
1175}
1176
1177// lineNotes are the comments under a line of the diff, and the form to write
1178// one when the reader asked for it. The diff is in the page twice (unified and
1179// split); the suffix keeps the ids unique, the unified table having none.
1180func lineNotes(notes []CommentView, form *CommentForm, suffix string) templ.Component {
1181	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1182		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1183		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1184			return templ_7745c5c3_CtxErr
1185		}
1186		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1187		if !templ_7745c5c3_IsBuffer {
1188			defer func() {
1189				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1190				if templ_7745c5c3_Err == nil {
1191					templ_7745c5c3_Err = templ_7745c5c3_BufErr
1192				}
1193			}()
1194		}
1195		ctx = templ.InitializeContext(ctx)
1196		templ_7745c5c3_Var57 := templ.GetChildren(ctx)
1197		if templ_7745c5c3_Var57 == nil {
1198			templ_7745c5c3_Var57 = templ.NopComponent
1199		}
1200		ctx = templ.ClearChildren(ctx)
1201		for _, c := range notes {
1202			templ_7745c5c3_Err = commentView(c, suffix).Render(ctx, templ_7745c5c3_Buffer)
1203			if templ_7745c5c3_Err != nil {
1204				return templ_7745c5c3_Err
1205			}
1206		}
1207		if form != nil {
1208			templ_7745c5c3_Err = commentForm(*form, suffix).Render(ctx, templ_7745c5c3_Buffer)
1209			if templ_7745c5c3_Err != nil {
1210				return templ_7745c5c3_Err
1211			}
1212		}
1213		return nil
1214	})
1215}
1216
1217// commentView is a note: a ruled block, under its line in the diff or in the
1218// list of comments. Body comes only from the safe Markdown renderer.
1219func commentView(c CommentView, suffix string) templ.Component {
1220	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1221		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1222		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1223			return templ_7745c5c3_CtxErr
1224		}
1225		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1226		if !templ_7745c5c3_IsBuffer {
1227			defer func() {
1228				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1229				if templ_7745c5c3_Err == nil {
1230					templ_7745c5c3_Err = templ_7745c5c3_BufErr
1231				}
1232			}()
1233		}
1234		ctx = templ.InitializeContext(ctx)
1235		templ_7745c5c3_Var58 := templ.GetChildren(ctx)
1236		if templ_7745c5c3_Var58 == nil {
1237			templ_7745c5c3_Var58 = templ.NopComponent
1238		}
1239		ctx = templ.ClearChildren(ctx)
1240		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 109, "<div class=\"cmt\" id=\"")
1241		if templ_7745c5c3_Err != nil {
1242			return templ_7745c5c3_Err
1243		}
1244		var templ_7745c5c3_Var59 string
1245		templ_7745c5c3_Var59, templ_7745c5c3_Err = templ.ResolveAttributeValue("c" + c.ID + suffix)
1246		if templ_7745c5c3_Err != nil {
1247			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 234, Col: 42}
1248		}
1249		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var59)
1250		if templ_7745c5c3_Err != nil {
1251			return templ_7745c5c3_Err
1252		}
1253		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 110, "\" data-resolved=\"")
1254		if templ_7745c5c3_Err != nil {
1255			return templ_7745c5c3_Err
1256		}
1257		var templ_7745c5c3_Var60 string
1258		templ_7745c5c3_Var60, templ_7745c5c3_Err = templ.ResolveAttributeValue(boolText(c.Resolved))
1259		if templ_7745c5c3_Err != nil {
1260			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 234, Col: 81}
1261		}
1262		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var60)
1263		if templ_7745c5c3_Err != nil {
1264			return templ_7745c5c3_Err
1265		}
1266		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 111, "\"")
1267		if templ_7745c5c3_Err != nil {
1268			return templ_7745c5c3_Err
1269		}
1270		if c.Reply != nil {
1271			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 112, " data-thread")
1272			if templ_7745c5c3_Err != nil {
1273				return templ_7745c5c3_Err
1274			}
1275		}
1276		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 113, "><p class=\"c-head\"><span class=\"c-who\">")
1277		if templ_7745c5c3_Err != nil {
1278			return templ_7745c5c3_Err
1279		}
1280		var templ_7745c5c3_Var61 string
1281		templ_7745c5c3_Var61, templ_7745c5c3_Err = templ.JoinStringErrs(c.Author)
1282		if templ_7745c5c3_Err != nil {
1283			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 236, Col: 33}
1284		}
1285		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var61))
1286		if templ_7745c5c3_Err != nil {
1287			return templ_7745c5c3_Err
1288		}
1289		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 114, "</span> ")
1290		if templ_7745c5c3_Err != nil {
1291			return templ_7745c5c3_Err
1292		}
1293		if c.WhenAt != "" {
1294			var templ_7745c5c3_Var62 string
1295			templ_7745c5c3_Var62, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
1296			if templ_7745c5c3_Err != nil {
1297				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 238, Col: 9}
1298			}
1299			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var62))
1300			if templ_7745c5c3_Err != nil {
1301				return templ_7745c5c3_Err
1302			}
1303			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 115, "<time class=\"mute\" datetime=\"")
1304			if templ_7745c5c3_Err != nil {
1305				return templ_7745c5c3_Err
1306			}
1307			var templ_7745c5c3_Var63 string
1308			templ_7745c5c3_Var63, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.WhenAt)
1309			if templ_7745c5c3_Err != nil {
1310				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 238, Col: 49}
1311			}
1312			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var63)
1313			if templ_7745c5c3_Err != nil {
1314				return templ_7745c5c3_Err
1315			}
1316			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 116, "\" title=\"")
1317			if templ_7745c5c3_Err != nil {
1318				return templ_7745c5c3_Err
1319			}
1320			var templ_7745c5c3_Var64 string
1321			templ_7745c5c3_Var64, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.Abs)
1322			if templ_7745c5c3_Err != nil {
1323				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 238, Col: 65}
1324			}
1325			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var64)
1326			if templ_7745c5c3_Err != nil {
1327				return templ_7745c5c3_Err
1328			}
1329			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 117, "\">")
1330			if templ_7745c5c3_Err != nil {
1331				return templ_7745c5c3_Err
1332			}
1333			var templ_7745c5c3_Var65 string
1334			templ_7745c5c3_Var65, templ_7745c5c3_Err = templ.JoinStringErrs(c.When)
1335			if templ_7745c5c3_Err != nil {
1336				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 238, Col: 76}
1337			}
1338			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var65))
1339			if templ_7745c5c3_Err != nil {
1340				return templ_7745c5c3_Err
1341			}
1342			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 118, "</time> ")
1343			if templ_7745c5c3_Err != nil {
1344				return templ_7745c5c3_Err
1345			}
1346		}
1347		if c.Resolved {
1348			var templ_7745c5c3_Var66 string
1349			templ_7745c5c3_Var66, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
1350			if templ_7745c5c3_Err != nil {
1351				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 241, Col: 9}
1352			}
1353			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var66))
1354			if templ_7745c5c3_Err != nil {
1355				return templ_7745c5c3_Err
1356			}
1357			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 119, "<span class=\"c-state\">resolved</span> ")
1358			if templ_7745c5c3_Err != nil {
1359				return templ_7745c5c3_Err
1360			}
1361		}
1362		if c.Outdated {
1363			var templ_7745c5c3_Var67 string
1364			templ_7745c5c3_Var67, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
1365			if templ_7745c5c3_Err != nil {
1366				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 244, Col: 9}
1367			}
1368			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var67))
1369			if templ_7745c5c3_Err != nil {
1370				return templ_7745c5c3_Err
1371			}
1372			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 120, "<span class=\"c-state\" title=\"written on an earlier head; the line may have moved\">outdated</span> ")
1373			if templ_7745c5c3_Err != nil {
1374				return templ_7745c5c3_Err
1375			}
1376		}
1377		if c.Where != "" {
1378			var templ_7745c5c3_Var68 string
1379			templ_7745c5c3_Var68, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
1380			if templ_7745c5c3_Err != nil {
1381				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 247, Col: 9}
1382			}
1383			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var68))
1384			if templ_7745c5c3_Err != nil {
1385				return templ_7745c5c3_Err
1386			}
1387			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 121, "<span class=\"c-where mute\">")
1388			if templ_7745c5c3_Err != nil {
1389				return templ_7745c5c3_Err
1390			}
1391			var templ_7745c5c3_Var69 string
1392			templ_7745c5c3_Var69, templ_7745c5c3_Err = templ.JoinStringErrs(c.Where)
1393			if templ_7745c5c3_Err != nil {
1394				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 247, Col: 47}
1395			}
1396			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var69))
1397			if templ_7745c5c3_Err != nil {
1398				return templ_7745c5c3_Err
1399			}
1400			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 122, "</span>")
1401			if templ_7745c5c3_Err != nil {
1402				return templ_7745c5c3_Err
1403			}
1404		}
1405		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 123, "</p>")
1406		if templ_7745c5c3_Err != nil {
1407			return templ_7745c5c3_Err
1408		}
1409		if c.Deleted {
1410			if c.Verdict != "" {
1411				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 124, "<p class=\"mute\">text deleted</p>")
1412				if templ_7745c5c3_Err != nil {
1413					return templ_7745c5c3_Err
1414				}
1415			} else {
1416				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 125, "<p class=\"mute\">deleted note</p>")
1417				if templ_7745c5c3_Err != nil {
1418					return templ_7745c5c3_Err
1419				}
1420			}
1421		} else {
1422			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 126, "<div class=\"c-body prose\">")
1423			if templ_7745c5c3_Err != nil {
1424				return templ_7745c5c3_Err
1425			}
1426			if suffix == "-s" {
1427				templ_7745c5c3_Err = templ.Raw(string(c.BodySplit)).Render(ctx, templ_7745c5c3_Buffer)
1428				if templ_7745c5c3_Err != nil {
1429					return templ_7745c5c3_Err
1430				}
1431			} else {
1432				templ_7745c5c3_Err = templ.Raw(string(c.Body)).Render(ctx, templ_7745c5c3_Buffer)
1433				if templ_7745c5c3_Err != nil {
1434					return templ_7745c5c3_Err
1435				}
1436			}
1437			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 127, "</div>")
1438			if templ_7745c5c3_Err != nil {
1439				return templ_7745c5c3_Err
1440			}
1441		}
1442		if c.Edited {
1443			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 128, "<span class=\"mute\">edited</span> ")
1444			if templ_7745c5c3_Err != nil {
1445				return templ_7745c5c3_Err
1446			}
1447		}
1448		if c.Verdict != "" {
1449			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 129, "<span class=\"c-state\">")
1450			if templ_7745c5c3_Err != nil {
1451				return templ_7745c5c3_Err
1452			}
1453			var templ_7745c5c3_Var70 string
1454			templ_7745c5c3_Var70, templ_7745c5c3_Err = templ.JoinStringErrs(c.Verdict)
1455			if templ_7745c5c3_Err != nil {
1456				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 269, Col: 36}
1457			}
1458			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var70))
1459			if templ_7745c5c3_Err != nil {
1460				return templ_7745c5c3_Err
1461			}
1462			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 130, "</span> ")
1463			if templ_7745c5c3_Err != nil {
1464				return templ_7745c5c3_Err
1465			}
1466		}
1467		if c.Range != "" {
1468			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 131, "<span class=\"mute\">")
1469			if templ_7745c5c3_Err != nil {
1470				return templ_7745c5c3_Err
1471			}
1472			var templ_7745c5c3_Var71 string
1473			templ_7745c5c3_Var71, templ_7745c5c3_Err = templ.JoinStringErrs(c.Range)
1474			if templ_7745c5c3_Err != nil {
1475				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 272, Col: 31}
1476			}
1477			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var71))
1478			if templ_7745c5c3_Err != nil {
1479				return templ_7745c5c3_Err
1480			}
1481			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 132, "</span> ")
1482			if templ_7745c5c3_Err != nil {
1483				return templ_7745c5c3_Err
1484			}
1485		}
1486		if c.Quote != "" {
1487			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 133, "<button type=\"button\" class=\"btn\" data-js data-quote=\"")
1488			if templ_7745c5c3_Err != nil {
1489				return templ_7745c5c3_Err
1490			}
1491			var templ_7745c5c3_Var72 string
1492			templ_7745c5c3_Var72, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.Quote)
1493			if templ_7745c5c3_Err != nil {
1494				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 275, Col: 65}
1495			}
1496			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var72)
1497			if templ_7745c5c3_Err != nil {
1498				return templ_7745c5c3_Err
1499			}
1500			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 134, "\">Quote</button> ")
1501			if templ_7745c5c3_Err != nil {
1502				return templ_7745c5c3_Err
1503			}
1504		}
1505		if c.Edit != nil {
1506			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 135, "<details><summary>Edit</summary><form method=\"post\" action=\"")
1507			if templ_7745c5c3_Err != nil {
1508				return templ_7745c5c3_Err
1509			}
1510			var templ_7745c5c3_Var73 templ.SafeURL
1511			templ_7745c5c3_Var73, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Edit.Action))
1512			if templ_7745c5c3_Err != nil {
1513				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 278, Col: 92}
1514			}
1515			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var73))
1516			if templ_7745c5c3_Err != nil {
1517				return templ_7745c5c3_Err
1518			}
1519			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 136, "\"><input type=\"hidden\" name=\"from\" value=\"")
1520			if templ_7745c5c3_Err != nil {
1521				return templ_7745c5c3_Err
1522			}
1523			var templ_7745c5c3_Var74 string
1524			templ_7745c5c3_Var74, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(c.Edit.From))
1525			if templ_7745c5c3_Err != nil {
1526				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 278, Col: 153}
1527			}
1528			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var74)
1529			if templ_7745c5c3_Err != nil {
1530				return templ_7745c5c3_Err
1531			}
1532			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 137, "\"><textarea name=\"text\" maxlength=\"8000\">")
1533			if templ_7745c5c3_Err != nil {
1534				return templ_7745c5c3_Err
1535			}
1536			var templ_7745c5c3_Var75 string
1537			templ_7745c5c3_Var75, templ_7745c5c3_Err = templ.JoinStringErrs(c.Edit.Text)
1538			if templ_7745c5c3_Err != nil {
1539				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 278, Col: 209}
1540			}
1541			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var75))
1542			if templ_7745c5c3_Err != nil {
1543				return templ_7745c5c3_Err
1544			}
1545			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 138, "</textarea><button class=\"btn\" type=\"submit\">Save</button></form></details> ")
1546			if templ_7745c5c3_Err != nil {
1547				return templ_7745c5c3_Err
1548			}
1549		}
1550		if c.Delete != nil {
1551			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 139, "<details><summary>Delete</summary><form method=\"post\" action=\"")
1552			if templ_7745c5c3_Err != nil {
1553				return templ_7745c5c3_Err
1554			}
1555			var templ_7745c5c3_Var76 templ.SafeURL
1556			templ_7745c5c3_Var76, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Delete.Action))
1557			if templ_7745c5c3_Err != nil {
1558				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 281, Col: 96}
1559			}
1560			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var76))
1561			if templ_7745c5c3_Err != nil {
1562				return templ_7745c5c3_Err
1563			}
1564			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 140, "\"><input type=\"hidden\" name=\"from\" value=\"")
1565			if templ_7745c5c3_Err != nil {
1566				return templ_7745c5c3_Err
1567			}
1568			var templ_7745c5c3_Var77 string
1569			templ_7745c5c3_Var77, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(c.Delete.From))
1570			if templ_7745c5c3_Err != nil {
1571				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 281, Col: 159}
1572			}
1573			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var77)
1574			if templ_7745c5c3_Err != nil {
1575				return templ_7745c5c3_Err
1576			}
1577			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 141, "\"><p>Delete this note?</p><button class=\"btn\" type=\"submit\">Confirm delete</button></form></details> ")
1578			if templ_7745c5c3_Err != nil {
1579				return templ_7745c5c3_Err
1580			}
1581		}
1582		for _, reply := range c.Replies {
1583			templ_7745c5c3_Err = commentView(reply, suffix).Render(ctx, templ_7745c5c3_Buffer)
1584			if templ_7745c5c3_Err != nil {
1585				return templ_7745c5c3_Err
1586			}
1587		}
1588		if c.Reply != nil {
1589			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 142, "<details data-reply><summary>Reply</summary>")
1590			if templ_7745c5c3_Err != nil {
1591				return templ_7745c5c3_Err
1592			}
1593			templ_7745c5c3_Err = commentForm(*c.Reply, suffix).Render(ctx, templ_7745c5c3_Buffer)
1594			if templ_7745c5c3_Err != nil {
1595				return templ_7745c5c3_Err
1596			}
1597			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 143, "</details> ")
1598			if templ_7745c5c3_Err != nil {
1599				return templ_7745c5c3_Err
1600			}
1601		}
1602		if c.Resolve != nil {
1603			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 144, "<form class=\"c-act\" method=\"post\" action=\"")
1604			if templ_7745c5c3_Err != nil {
1605				return templ_7745c5c3_Err
1606			}
1607			var templ_7745c5c3_Var78 templ.SafeURL
1608			templ_7745c5c3_Var78, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Resolve.Action))
1609			if templ_7745c5c3_Err != nil {
1610				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 292, Col: 77}
1611			}
1612			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var78))
1613			if templ_7745c5c3_Err != nil {
1614				return templ_7745c5c3_Err
1615			}
1616			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 145, "\"><input type=\"hidden\" name=\"resolved\" value=\"")
1617			if templ_7745c5c3_Err != nil {
1618				return templ_7745c5c3_Err
1619			}
1620			var templ_7745c5c3_Var79 string
1621			templ_7745c5c3_Var79, templ_7745c5c3_Err = templ.ResolveAttributeValue(boolText(c.Resolve.Value))
1622			if templ_7745c5c3_Err != nil {
1623				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 293, Col: 74}
1624			}
1625			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var79)
1626			if templ_7745c5c3_Err != nil {
1627				return templ_7745c5c3_Err
1628			}
1629			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 146, "\"> ")
1630			if templ_7745c5c3_Err != nil {
1631				return templ_7745c5c3_Err
1632			}
1633			if c.Resolve.From > 0 {
1634				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 147, "<input type=\"hidden\" name=\"from\" value=\"")
1635				if templ_7745c5c3_Err != nil {
1636					return templ_7745c5c3_Err
1637				}
1638				var templ_7745c5c3_Var80 string
1639				templ_7745c5c3_Var80, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(c.Resolve.From))
1640				if templ_7745c5c3_Err != nil {
1641					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 295, Col: 66}
1642				}
1643				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var80)
1644				if templ_7745c5c3_Err != nil {
1645					return templ_7745c5c3_Err
1646				}
1647				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 148, "\"> ")
1648				if templ_7745c5c3_Err != nil {
1649					return templ_7745c5c3_Err
1650				}
1651			}
1652			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 149, "<button type=\"submit\" class=\"btn\">")
1653			if templ_7745c5c3_Err != nil {
1654				return templ_7745c5c3_Err
1655			}
1656			var templ_7745c5c3_Var81 string
1657			templ_7745c5c3_Var81, templ_7745c5c3_Err = templ.JoinStringErrs(c.Resolve.Label)
1658			if templ_7745c5c3_Err != nil {
1659				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 297, Col: 55}
1660			}
1661			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var81))
1662			if templ_7745c5c3_Err != nil {
1663				return templ_7745c5c3_Err
1664			}
1665			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 150, "</button></form>")
1666			if templ_7745c5c3_Err != nil {
1667				return templ_7745c5c3_Err
1668			}
1669		}
1670		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 151, "</div>")
1671		if templ_7745c5c3_Err != nil {
1672			return templ_7745c5c3_Err
1673		}
1674		return nil
1675	})
1676}
1677
1678func boolText(b bool) string {
1679	if b {
1680		return "true"
1681	}
1682	return "false"
1683}
1684
1685// commentForm writes a comment, general or on a line.
1686func commentForm(f CommentForm, suffix string) templ.Component {
1687	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1688		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1689		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1690			return templ_7745c5c3_CtxErr
1691		}
1692		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1693		if !templ_7745c5c3_IsBuffer {
1694			defer func() {
1695				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1696				if templ_7745c5c3_Err == nil {
1697					templ_7745c5c3_Err = templ_7745c5c3_BufErr
1698				}
1699			}()
1700		}
1701		ctx = templ.InitializeContext(ctx)
1702		templ_7745c5c3_Var82 := templ.GetChildren(ctx)
1703		if templ_7745c5c3_Var82 == nil {
1704			templ_7745c5c3_Var82 = templ.NopComponent
1705		}
1706		ctx = templ.ClearChildren(ctx)
1707		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 152, "<form class=\"cform\" method=\"post\" action=\"")
1708		if templ_7745c5c3_Err != nil {
1709			return templ_7745c5c3_Err
1710		}
1711		var templ_7745c5c3_Var83 templ.SafeURL
1712		templ_7745c5c3_Var83, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(f.Action))
1713		if templ_7745c5c3_Err != nil {
1714			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 312, Col: 67}
1715		}
1716		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var83))
1717		if templ_7745c5c3_Err != nil {
1718			return templ_7745c5c3_Err
1719		}
1720		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 153, "\"><label for=\"")
1721		if templ_7745c5c3_Err != nil {
1722			return templ_7745c5c3_Err
1723		}
1724		var templ_7745c5c3_Var84 string
1725		templ_7745c5c3_Var84, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.ID + suffix)
1726		if templ_7745c5c3_Err != nil {
1727			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 313, Col: 28}
1728		}
1729		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var84)
1730		if templ_7745c5c3_Err != nil {
1731			return templ_7745c5c3_Err
1732		}
1733		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 154, "\">")
1734		if templ_7745c5c3_Err != nil {
1735			return templ_7745c5c3_Err
1736		}
1737		var templ_7745c5c3_Var85 string
1738		templ_7745c5c3_Var85, templ_7745c5c3_Err = templ.JoinStringErrs(f.Title)
1739		if templ_7745c5c3_Err != nil {
1740			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 313, Col: 40}
1741		}
1742		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var85))
1743		if templ_7745c5c3_Err != nil {
1744			return templ_7745c5c3_Err
1745		}
1746		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 155, "</label> <textarea id=\"")
1747		if templ_7745c5c3_Err != nil {
1748			return templ_7745c5c3_Err
1749		}
1750		var templ_7745c5c3_Var86 string
1751		templ_7745c5c3_Var86, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.ID + suffix)
1752		if templ_7745c5c3_Err != nil {
1753			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 315, Col: 21}
1754		}
1755		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var86)
1756		if templ_7745c5c3_Err != nil {
1757			return templ_7745c5c3_Err
1758		}
1759		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 156, "\" name=\"text\" rows=\"3\" maxlength=\"8000\" placeholder=\"Markdown, 8000 characters at most\"")
1760		if templ_7745c5c3_Err != nil {
1761			return templ_7745c5c3_Err
1762		}
1763		if f.Focus {
1764			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 157, " autofocus")
1765			if templ_7745c5c3_Err != nil {
1766				return templ_7745c5c3_Err
1767			}
1768		}
1769		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 158, "></textarea> ")
1770		if templ_7745c5c3_Err != nil {
1771			return templ_7745c5c3_Err
1772		}
1773		if f.Path != "" {
1774			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 159, "<input type=\"hidden\" name=\"path\" value=\"")
1775			if templ_7745c5c3_Err != nil {
1776				return templ_7745c5c3_Err
1777			}
1778			var templ_7745c5c3_Var87 string
1779			templ_7745c5c3_Var87, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.Path)
1780			if templ_7745c5c3_Err != nil {
1781				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 325, Col: 50}
1782			}
1783			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var87)
1784			if templ_7745c5c3_Err != nil {
1785				return templ_7745c5c3_Err
1786			}
1787			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 160, "\"> <input type=\"hidden\" name=\"line\" value=\"")
1788			if templ_7745c5c3_Err != nil {
1789				return templ_7745c5c3_Err
1790			}
1791			var templ_7745c5c3_Var88 string
1792			templ_7745c5c3_Var88, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.Line)
1793			if templ_7745c5c3_Err != nil {
1794				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 326, Col: 50}
1795			}
1796			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var88)
1797			if templ_7745c5c3_Err != nil {
1798				return templ_7745c5c3_Err
1799			}
1800			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 161, "\"> <input type=\"hidden\" name=\"side\" value=\"")
1801			if templ_7745c5c3_Err != nil {
1802				return templ_7745c5c3_Err
1803			}
1804			var templ_7745c5c3_Var89 string
1805			templ_7745c5c3_Var89, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.Side)
1806			if templ_7745c5c3_Err != nil {
1807				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 327, Col: 50}
1808			}
1809			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var89)
1810			if templ_7745c5c3_Err != nil {
1811				return templ_7745c5c3_Err
1812			}
1813			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 162, "\"> <label>from line <input type=\"number\" name=\"start_line\" min=\"1\" value=\"")
1814			if templ_7745c5c3_Err != nil {
1815				return templ_7745c5c3_Err
1816			}
1817			var templ_7745c5c3_Var90 string
1818			templ_7745c5c3_Var90, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.StartLine)
1819			if templ_7745c5c3_Err != nil {
1820				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 328, Col: 86}
1821			}
1822			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var90)
1823			if templ_7745c5c3_Err != nil {
1824				return templ_7745c5c3_Err
1825			}
1826			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 163, "\"></label> ")
1827			if templ_7745c5c3_Err != nil {
1828				return templ_7745c5c3_Err
1829			}
1830		}
1831		if f.ReplyTo != "" {
1832			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 164, "<input type=\"hidden\" name=\"reply_to\" value=\"")
1833			if templ_7745c5c3_Err != nil {
1834				return templ_7745c5c3_Err
1835			}
1836			var templ_7745c5c3_Var91 string
1837			templ_7745c5c3_Var91, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.ReplyTo)
1838			if templ_7745c5c3_Err != nil {
1839				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 331, Col: 57}
1840			}
1841			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var91)
1842			if templ_7745c5c3_Err != nil {
1843				return templ_7745c5c3_Err
1844			}
1845			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 165, "\"> ")
1846			if templ_7745c5c3_Err != nil {
1847				return templ_7745c5c3_Err
1848			}
1849		}
1850		if f.Path == "" && f.ReplyTo == "" {
1851			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 166, "<fieldset><legend>Verdict</legend><label><input type=\"radio\" name=\"verdict\" value=\"\" checked>Note</label><label><input type=\"radio\" name=\"verdict\" value=\"approve\">Approve</label><label><input type=\"radio\" name=\"verdict\" value=\"changes_requested\">Request changes</label></fieldset>")
1852			if templ_7745c5c3_Err != nil {
1853				return templ_7745c5c3_Err
1854			}
1855		}
1856		if f.From > 0 {
1857			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 167, "<input type=\"hidden\" name=\"from\" value=\"")
1858			if templ_7745c5c3_Err != nil {
1859				return templ_7745c5c3_Err
1860			}
1861			var templ_7745c5c3_Var92 string
1862			templ_7745c5c3_Var92, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(f.From))
1863			if templ_7745c5c3_Err != nil {
1864				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 337, Col: 56}
1865			}
1866			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var92)
1867			if templ_7745c5c3_Err != nil {
1868				return templ_7745c5c3_Err
1869			}
1870			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 168, "\">")
1871			if templ_7745c5c3_Err != nil {
1872				return templ_7745c5c3_Err
1873			}
1874		}
1875		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 169, "<div class=\"f-btns\"><button type=\"submit\" class=\"btn primary\">Comment</button> ")
1876		if templ_7745c5c3_Err != nil {
1877			return templ_7745c5c3_Err
1878		}
1879		if f.Cancel != "" {
1880			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 170, "<a class=\"btn\" href=\"")
1881			if templ_7745c5c3_Err != nil {
1882				return templ_7745c5c3_Err
1883			}
1884			var templ_7745c5c3_Var93 templ.SafeURL
1885			templ_7745c5c3_Var93, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(f.Cancel))
1886			if templ_7745c5c3_Err != nil {
1887				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 342, Col: 49}
1888			}
1889			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var93))
1890			if templ_7745c5c3_Err != nil {
1891				return templ_7745c5c3_Err
1892			}
1893			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 171, "\">Cancel</a>")
1894			if templ_7745c5c3_Err != nil {
1895				return templ_7745c5c3_Err
1896			}
1897		}
1898		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 172, "</div></form>")
1899		if templ_7745c5c3_Err != nil {
1900			return templ_7745c5c3_Err
1901		}
1902		return nil
1903	})
1904}
1905
1906func mrRail(p MRPage) templ.Component {
1907	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1908		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1909		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1910			return templ_7745c5c3_CtxErr
1911		}
1912		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1913		if !templ_7745c5c3_IsBuffer {
1914			defer func() {
1915				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1916				if templ_7745c5c3_Err == nil {
1917					templ_7745c5c3_Err = templ_7745c5c3_BufErr
1918				}
1919			}()
1920		}
1921		ctx = templ.InitializeContext(ctx)
1922		templ_7745c5c3_Var94 := templ.GetChildren(ctx)
1923		if templ_7745c5c3_Var94 == nil {
1924			templ_7745c5c3_Var94 = templ.NopComponent
1925		}
1926		ctx = templ.ClearChildren(ctx)
1927		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 173, "<section aria-labelledby=\"r-files\" class=\"r-files\"><h2 id=\"r-files\">Files <span class=\"count\">")
1928		if templ_7745c5c3_Err != nil {
1929			return templ_7745c5c3_Err
1930		}
1931		var templ_7745c5c3_Var95 string
1932		templ_7745c5c3_Var95, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Files)))
1933		if templ_7745c5c3_Err != nil {
1934			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 351, Col: 49}
1935		}
1936		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var95))
1937		if templ_7745c5c3_Err != nil {
1938			return templ_7745c5c3_Err
1939		}
1940		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 174, "</span><kbd aria-hidden=\"true\">g f</kbd> <button type=\"button\" class=\"btn icon fold\" data-js aria-expanded=\"true\" title=\"fold the list of files\" hx-on:click=\"ermiteMR.foldFiles()\"><span class=\"ico i-chevron\" aria-hidden=\"true\"></span><span class=\"sr\">fold the list of files</span></button></h2>")
1941		if templ_7745c5c3_Err != nil {
1942			return templ_7745c5c3_Err
1943		}
1944		templ_7745c5c3_Err = FileList(p.Files).Render(ctx, templ_7745c5c3_Buffer)
1945		if templ_7745c5c3_Err != nil {
1946			return templ_7745c5c3_Err
1947		}
1948		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 175, "</section>")
1949		if templ_7745c5c3_Err != nil {
1950			return templ_7745c5c3_Err
1951		}
1952		if len(p.Verdicts) > 0 {
1953			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 176, "<section><h2>Verdicts</h2><ul>")
1954			if templ_7745c5c3_Err != nil {
1955				return templ_7745c5c3_Err
1956			}
1957			for _, v := range p.Verdicts {
1958				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 177, "<li><a href=\"")
1959				if templ_7745c5c3_Err != nil {
1960					return templ_7745c5c3_Err
1961				}
1962				var templ_7745c5c3_Var96 templ.SafeURL
1963				templ_7745c5c3_Var96, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(v.Href))
1964				if templ_7745c5c3_Err != nil {
1965					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 364, Col: 37}
1966				}
1967				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var96))
1968				if templ_7745c5c3_Err != nil {
1969					return templ_7745c5c3_Err
1970				}
1971				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 178, "\">")
1972				if templ_7745c5c3_Err != nil {
1973					return templ_7745c5c3_Err
1974				}
1975				var templ_7745c5c3_Var97 string
1976				templ_7745c5c3_Var97, templ_7745c5c3_Err = templ.JoinStringErrs(v.Author)
1977				if templ_7745c5c3_Err != nil {
1978					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 364, Col: 50}
1979				}
1980				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var97))
1981				if templ_7745c5c3_Err != nil {
1982					return templ_7745c5c3_Err
1983				}
1984				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 179, ": ")
1985				if templ_7745c5c3_Err != nil {
1986					return templ_7745c5c3_Err
1987				}
1988				var templ_7745c5c3_Var98 string
1989				templ_7745c5c3_Var98, templ_7745c5c3_Err = templ.JoinStringErrs(v.Label)
1990				if templ_7745c5c3_Err != nil {
1991					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 364, Col: 63}
1992				}
1993				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var98))
1994				if templ_7745c5c3_Err != nil {
1995					return templ_7745c5c3_Err
1996				}
1997				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 180, "</a> ")
1998				if templ_7745c5c3_Err != nil {
1999					return templ_7745c5c3_Err
2000				}
2001				if v.Stale {
2002					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 181, "<span class=\"mute\">(stale)</span>")
2003					if templ_7745c5c3_Err != nil {
2004						return templ_7745c5c3_Err
2005					}
2006				}
2007				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 182, "</li>")
2008				if templ_7745c5c3_Err != nil {
2009					return templ_7745c5c3_Err
2010				}
2011			}
2012			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 183, "</ul></section>")
2013			if templ_7745c5c3_Err != nil {
2014				return templ_7745c5c3_Err
2015			}
2016		}
2017		templ_7745c5c3_Err = MRChecks(p.Checks).Render(ctx, templ_7745c5c3_Buffer)
2018		if templ_7745c5c3_Err != nil {
2019			return templ_7745c5c3_Err
2020		}
2021		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 184, "<section aria-labelledby=\"r-commits\"><h2 id=\"r-commits\">Commits <span class=\"count\">")
2022		if templ_7745c5c3_Err != nil {
2023			return templ_7745c5c3_Err
2024		}
2025		var templ_7745c5c3_Var99 string
2026		templ_7745c5c3_Var99, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Commits)))
2027		if templ_7745c5c3_Err != nil {
2028			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 375, Col: 71}
2029		}
2030		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var99))
2031		if templ_7745c5c3_Err != nil {
2032			return templ_7745c5c3_Err
2033		}
2034		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 185, "</span></h2><ul class=\"pcommits\">")
2035		if templ_7745c5c3_Err != nil {
2036			return templ_7745c5c3_Err
2037		}
2038		for _, c := range p.Commits {
2039			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 186, "<li")
2040			if templ_7745c5c3_Err != nil {
2041				return templ_7745c5c3_Err
2042			}
2043			if c.New {
2044				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 187, " data-new")
2045				if templ_7745c5c3_Err != nil {
2046					return templ_7745c5c3_Err
2047				}
2048			}
2049			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 188, "><a href=\"")
2050			if templ_7745c5c3_Err != nil {
2051				return templ_7745c5c3_Err
2052			}
2053			var templ_7745c5c3_Var100 templ.SafeURL
2054			templ_7745c5c3_Var100, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Href))
2055			if templ_7745c5c3_Err != nil {
2056				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 379, Col: 36}
2057			}
2058			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var100))
2059			if templ_7745c5c3_Err != nil {
2060				return templ_7745c5c3_Err
2061			}
2062			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 189, "\">")
2063			if templ_7745c5c3_Err != nil {
2064				return templ_7745c5c3_Err
2065			}
2066			var templ_7745c5c3_Var101 string
2067			templ_7745c5c3_Var101, templ_7745c5c3_Err = templ.JoinStringErrs(c.Short)
2068			if templ_7745c5c3_Err != nil {
2069				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 379, Col: 48}
2070			}
2071			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var101))
2072			if templ_7745c5c3_Err != nil {
2073				return templ_7745c5c3_Err
2074			}
2075			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 190, "</a> <span class=\"s\">")
2076			if templ_7745c5c3_Err != nil {
2077				return templ_7745c5c3_Err
2078			}
2079			var templ_7745c5c3_Var102 string
2080			templ_7745c5c3_Var102, templ_7745c5c3_Err = templ.JoinStringErrs(c.Subject)
2081			if templ_7745c5c3_Err != nil {
2082				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 380, Col: 32}
2083			}
2084			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var102))
2085			if templ_7745c5c3_Err != nil {
2086				return templ_7745c5c3_Err
2087			}
2088			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 191, "</span> ")
2089			if templ_7745c5c3_Err != nil {
2090				return templ_7745c5c3_Err
2091			}
2092			if c.Sig != nil {
2093				templ_7745c5c3_Err = signaturePill(c.Sig).Render(ctx, templ_7745c5c3_Buffer)
2094				if templ_7745c5c3_Err != nil {
2095					return templ_7745c5c3_Err
2096				}
2097			}
2098			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 192, "<span class=\"mute\">")
2099			if templ_7745c5c3_Err != nil {
2100				return templ_7745c5c3_Err
2101			}
2102			var templ_7745c5c3_Var103 string
2103			templ_7745c5c3_Var103, templ_7745c5c3_Err = templ.JoinStringErrs(c.Author)
2104			if templ_7745c5c3_Err != nil {
2105				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 385, Col: 16}
2106			}
2107			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var103))
2108			if templ_7745c5c3_Err != nil {
2109				return templ_7745c5c3_Err
2110			}
2111			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 193, " ")
2112			if templ_7745c5c3_Err != nil {
2113				return templ_7745c5c3_Err
2114			}
2115			if c.WhenAt != "" {
2116				var templ_7745c5c3_Var104 string
2117				templ_7745c5c3_Var104, templ_7745c5c3_Err = templ.JoinStringErrs(" · ")
2118				if templ_7745c5c3_Err != nil {
2119					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 387, Col: 15}
2120				}
2121				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var104))
2122				if templ_7745c5c3_Err != nil {
2123					return templ_7745c5c3_Err
2124				}
2125				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 194, "<time datetime=\"")
2126				if templ_7745c5c3_Err != nil {
2127					return templ_7745c5c3_Err
2128				}
2129				var templ_7745c5c3_Var105 string
2130				templ_7745c5c3_Var105, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.WhenAt)
2131				if templ_7745c5c3_Err != nil {
2132					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 387, Col: 42}
2133				}
2134				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var105)
2135				if templ_7745c5c3_Err != nil {
2136					return templ_7745c5c3_Err
2137				}
2138				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 195, "\">")
2139				if templ_7745c5c3_Err != nil {
2140					return templ_7745c5c3_Err
2141				}
2142				var templ_7745c5c3_Var106 string
2143				templ_7745c5c3_Var106, templ_7745c5c3_Err = templ.JoinStringErrs(c.When)
2144				if templ_7745c5c3_Err != nil {
2145					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 387, Col: 53}
2146				}
2147				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var106))
2148				if templ_7745c5c3_Err != nil {
2149					return templ_7745c5c3_Err
2150				}
2151				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 196, "</time> ")
2152				if templ_7745c5c3_Err != nil {
2153					return templ_7745c5c3_Err
2154				}
2155			}
2156			if c.New {
2157				var templ_7745c5c3_Var107 string
2158				templ_7745c5c3_Var107, templ_7745c5c3_Err = templ.JoinStringErrs(" · new")
2159				if templ_7745c5c3_Err != nil {
2160					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 390, Col: 18}
2161				}
2162				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var107))
2163				if templ_7745c5c3_Err != nil {
2164					return templ_7745c5c3_Err
2165				}
2166			}
2167			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 197, "</span></li>")
2168			if templ_7745c5c3_Err != nil {
2169				return templ_7745c5c3_Err
2170			}
2171		}
2172		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 198, "</ul>")
2173		if templ_7745c5c3_Err != nil {
2174			return templ_7745c5c3_Err
2175		}
2176		if len(p.Commits) == 0 {
2177			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 199, "<p class=\"dim\">no commit to merge.</p>")
2178			if templ_7745c5c3_Err != nil {
2179				return templ_7745c5c3_Err
2180			}
2181		}
2182		if p.CommitsNote != "" {
2183			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 200, "<p class=\"note\">")
2184			if templ_7745c5c3_Err != nil {
2185				return templ_7745c5c3_Err
2186			}
2187			var templ_7745c5c3_Var108 string
2188			templ_7745c5c3_Var108, templ_7745c5c3_Err = templ.JoinStringErrs(p.CommitsNote)
2189			if templ_7745c5c3_Err != nil {
2190				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 400, Col: 34}
2191			}
2192			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var108))
2193			if templ_7745c5c3_Err != nil {
2194				return templ_7745c5c3_Err
2195			}
2196			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 201, "</p>")
2197			if templ_7745c5c3_Err != nil {
2198				return templ_7745c5c3_Err
2199			}
2200		}
2201		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 202, "</section><section aria-labelledby=\"r-settings\"><h2 id=\"r-settings\">Settings</h2><dl class=\"kv\"><dt>modes</dt><dd>")
2202		if templ_7745c5c3_Err != nil {
2203			return templ_7745c5c3_Err
2204		}
2205		var templ_7745c5c3_Var109 string
2206		templ_7745c5c3_Var109, templ_7745c5c3_Err = templ.JoinStringErrs(strings.Join(p.Modes, ", "))
2207		if templ_7745c5c3_Err != nil {
2208			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 407, Col: 36}
2209		}
2210		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var109))
2211		if templ_7745c5c3_Err != nil {
2212			return templ_7745c5c3_Err
2213		}
2214		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 203, "</dd><dt>checks</dt><dd>")
2215		if templ_7745c5c3_Err != nil {
2216			return templ_7745c5c3_Err
2217		}
2218		if p.ChecksBlock {
2219			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 204, "failing ones block the merge")
2220			if templ_7745c5c3_Err != nil {
2221				return templ_7745c5c3_Err
2222			}
2223		} else {
2224			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 205, "do not block the merge")
2225			if templ_7745c5c3_Err != nil {
2226				return templ_7745c5c3_Err
2227			}
2228		}
2229		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 206, "</dd></dl></section>")
2230		if templ_7745c5c3_Err != nil {
2231			return templ_7745c5c3_Err
2232		}
2233		return nil
2234	})
2235}
2236
2237// mrBar is the bar above the diff, which follows the review: the totals, the
2238// layout of the diff, the state of the checks and, for the owner of an open
2239// request, the merge menu and the other actions. Each menu is a <details>: it
2240// works without scripts; with them, M and the keys of the menu drive it.
2241func mrBar(p MRPage) templ.Component {
2242	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2243		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2244		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2245			return templ_7745c5c3_CtxErr
2246		}
2247		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2248		if !templ_7745c5c3_IsBuffer {
2249			defer func() {
2250				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2251				if templ_7745c5c3_Err == nil {
2252					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2253				}
2254			}()
2255		}
2256		ctx = templ.InitializeContext(ctx)
2257		templ_7745c5c3_Var110 := templ.GetChildren(ctx)
2258		if templ_7745c5c3_Var110 == nil {
2259			templ_7745c5c3_Var110 = templ.NopComponent
2260		}
2261		ctx = templ.ClearChildren(ctx)
2262		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 207, "<div class=\"diff-tools mr-bar\" role=\"group\" aria-label=\"Diff view and merge\"><span class=\"dim\">")
2263		if templ_7745c5c3_Err != nil {
2264			return templ_7745c5c3_Err
2265		}
2266		var templ_7745c5c3_Var111 string
2267		templ_7745c5c3_Var111, templ_7745c5c3_Err = templ.JoinStringErrs(plural(p.NFiles, "file", "files"))
2268		if templ_7745c5c3_Err != nil {
2269			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 426, Col: 55}
2270		}
2271		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var111))
2272		if templ_7745c5c3_Err != nil {
2273			return templ_7745c5c3_Err
2274		}
2275		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 208, " · <span class=\"plus\">+")
2276		if templ_7745c5c3_Err != nil {
2277			return templ_7745c5c3_Err
2278		}
2279		var templ_7745c5c3_Var112 string
2280		templ_7745c5c3_Var112, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Adds))
2281		if templ_7745c5c3_Err != nil {
2282			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 426, Col: 95}
2283		}
2284		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var112))
2285		if templ_7745c5c3_Err != nil {
2286			return templ_7745c5c3_Err
2287		}
2288		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 209, "</span> <span class=\"minus\">-")
2289		if templ_7745c5c3_Err != nil {
2290			return templ_7745c5c3_Err
2291		}
2292		var templ_7745c5c3_Var113 string
2293		templ_7745c5c3_Var113, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Dels))
2294		if templ_7745c5c3_Err != nil {
2295			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 426, Col: 140}
2296		}
2297		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var113))
2298		if templ_7745c5c3_Err != nil {
2299			return templ_7745c5c3_Err
2300		}
2301		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 210, "</span></span>")
2302		if templ_7745c5c3_Err != nil {
2303			return templ_7745c5c3_Err
2304		}
2305		templ_7745c5c3_Err = viewLink(p.DiffView, "unified", "Unified", "u", p.UnifiedHref).Render(ctx, templ_7745c5c3_Buffer)
2306		if templ_7745c5c3_Err != nil {
2307			return templ_7745c5c3_Err
2308		}
2309		templ_7745c5c3_Err = viewLink(p.DiffView, "split", "Split", "d", p.SplitHref).Render(ctx, templ_7745c5c3_Buffer)
2310		if templ_7745c5c3_Err != nil {
2311			return templ_7745c5c3_Err
2312		}
2313		templ_7745c5c3_Err = collapseButton().Render(ctx, templ_7745c5c3_Buffer)
2314		if templ_7745c5c3_Err != nil {
2315			return templ_7745c5c3_Err
2316		}
2317		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 211, "<span class=\"grow\"></span>")
2318		if templ_7745c5c3_Err != nil {
2319			return templ_7745c5c3_Err
2320		}
2321		templ_7745c5c3_Err = MRChecksSum(p.ChecksSum).Render(ctx, templ_7745c5c3_Buffer)
2322		if templ_7745c5c3_Err != nil {
2323			return templ_7745c5c3_Err
2324		}
2325		if p.Box != nil {
2326			templ_7745c5c3_Err = mergeMenu(p).Render(ctx, templ_7745c5c3_Buffer)
2327			if templ_7745c5c3_Err != nil {
2328				return templ_7745c5c3_Err
2329			}
2330			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 212, " ")
2331			if templ_7745c5c3_Err != nil {
2332				return templ_7745c5c3_Err
2333			}
2334			templ_7745c5c3_Err = moreMenu(p).Render(ctx, templ_7745c5c3_Buffer)
2335			if templ_7745c5c3_Err != nil {
2336				return templ_7745c5c3_Err
2337			}
2338		}
2339		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 213, "</div>")
2340		if templ_7745c5c3_Err != nil {
2341			return templ_7745c5c3_Err
2342		}
2343		return nil
2344	})
2345}
2346
2347// mergeMenu is the merge of an open request, for the owner: the form (it
2348// carries the head that was read), or "Ready for review" for a draft. The
2349// mode and the branch deletion have keys (1-3, D) while it is open.
2350func mergeMenu(p MRPage) templ.Component {
2351	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2352		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2353		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2354			return templ_7745c5c3_CtxErr
2355		}
2356		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2357		if !templ_7745c5c3_IsBuffer {
2358			defer func() {
2359				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2360				if templ_7745c5c3_Err == nil {
2361					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2362				}
2363			}()
2364		}
2365		ctx = templ.InitializeContext(ctx)
2366		templ_7745c5c3_Var114 := templ.GetChildren(ctx)
2367		if templ_7745c5c3_Var114 == nil {
2368			templ_7745c5c3_Var114 = templ.NopComponent
2369		}
2370		ctx = templ.ClearChildren(ctx)
2371		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 214, "<details class=\"menu mmenu\" id=\"merge-menu\" data-state=\"open\"><summary class=\"btn primary\" aria-keyshortcuts=\"Shift+M\">")
2372		if templ_7745c5c3_Err != nil {
2373			return templ_7745c5c3_Err
2374		}
2375		if p.Box.ReadyAction != "" {
2376			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 215, "Draft ")
2377			if templ_7745c5c3_Err != nil {
2378				return templ_7745c5c3_Err
2379			}
2380		} else {
2381			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 216, "Merge ")
2382			if templ_7745c5c3_Err != nil {
2383				return templ_7745c5c3_Err
2384			}
2385		}
2386		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 217, "<kbd aria-hidden=\"true\">M</kbd></summary><div class=\"menu-pop\" role=\"group\" aria-label=\"Merge\"><dl class=\"kv\"><dt>head</dt><dd>")
2387		if templ_7745c5c3_Err != nil {
2388			return templ_7745c5c3_Err
2389		}
2390		if p.Box.HeadGone {
2391			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 218, "gone: the source branch was deleted")
2392			if templ_7745c5c3_Err != nil {
2393				return templ_7745c5c3_Err
2394			}
2395		} else {
2396			var templ_7745c5c3_Var115 string
2397			templ_7745c5c3_Var115, templ_7745c5c3_Err = templ.JoinStringErrs(p.HeadShort)
2398			if templ_7745c5c3_Err != nil {
2399				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 459, Col: 19}
2400			}
2401			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var115))
2402			if templ_7745c5c3_Err != nil {
2403				return templ_7745c5c3_Err
2404			}
2405		}
2406		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 219, "</dd><dt>into</dt><dd>")
2407		if templ_7745c5c3_Err != nil {
2408			return templ_7745c5c3_Err
2409		}
2410		var templ_7745c5c3_Var116 string
2411		templ_7745c5c3_Var116, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
2412		if templ_7745c5c3_Err != nil {
2413			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 463, Col: 18}
2414		}
2415		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var116))
2416		if templ_7745c5c3_Err != nil {
2417			return templ_7745c5c3_Err
2418		}
2419		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 220, "</dd></dl>")
2420		if templ_7745c5c3_Err != nil {
2421			return templ_7745c5c3_Err
2422		}
2423		if p.Box.ReadyAction != "" {
2424			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 221, "<p class=\"d-draft\">this is a draft: it cannot be merged until it is ready for review.</p><form class=\"d-btns\" method=\"post\" action=\"")
2425			if templ_7745c5c3_Err != nil {
2426				return templ_7745c5c3_Err
2427			}
2428			var templ_7745c5c3_Var117 templ.SafeURL
2429			templ_7745c5c3_Var117, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.ReadyAction))
2430			if templ_7745c5c3_Err != nil {
2431				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 467, Col: 80}
2432			}
2433			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var117))
2434			if templ_7745c5c3_Err != nil {
2435				return templ_7745c5c3_Err
2436			}
2437			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 222, "\"><button type=\"submit\" class=\"btn primary\" data-default title=\"remove the draft prefix from the title\">Ready for review</button></form>")
2438			if templ_7745c5c3_Err != nil {
2439				return templ_7745c5c3_Err
2440			}
2441		} else if !p.Box.HeadGone {
2442			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 223, "<form class=\"d-acts\" method=\"post\" action=\"")
2443			if templ_7745c5c3_Err != nil {
2444				return templ_7745c5c3_Err
2445			}
2446			var templ_7745c5c3_Var118 templ.SafeURL
2447			templ_7745c5c3_Var118, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.MergeAction))
2448			if templ_7745c5c3_Err != nil {
2449				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 471, Col: 80}
2450			}
2451			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var118))
2452			if templ_7745c5c3_Err != nil {
2453				return templ_7745c5c3_Err
2454			}
2455			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 224, "\"><input type=\"hidden\" name=\"head_id\" value=\"")
2456			if templ_7745c5c3_Err != nil {
2457				return templ_7745c5c3_Err
2458			}
2459			var templ_7745c5c3_Var119 string
2460			templ_7745c5c3_Var119, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.Head)
2461			if templ_7745c5c3_Err != nil {
2462				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 472, Col: 59}
2463			}
2464			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var119)
2465			if templ_7745c5c3_Err != nil {
2466				return templ_7745c5c3_Err
2467			}
2468			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 225, "\"><fieldset class=\"d-modes\"><legend class=\"sr\">merge mode</legend> ")
2469			if templ_7745c5c3_Err != nil {
2470				return templ_7745c5c3_Err
2471			}
2472			for i, m := range p.Box.Modes {
2473				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 226, "<label><input type=\"radio\" name=\"mode\" value=\"")
2474				if templ_7745c5c3_Err != nil {
2475					return templ_7745c5c3_Err
2476				}
2477				var templ_7745c5c3_Var120 string
2478				templ_7745c5c3_Var120, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.Value)
2479				if templ_7745c5c3_Err != nil {
2480					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 477, Col: 55}
2481				}
2482				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var120)
2483				if templ_7745c5c3_Err != nil {
2484					return templ_7745c5c3_Err
2485				}
2486				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 227, "\"")
2487				if templ_7745c5c3_Err != nil {
2488					return templ_7745c5c3_Err
2489				}
2490				if i == 0 {
2491					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 228, " checked")
2492					if templ_7745c5c3_Err != nil {
2493						return templ_7745c5c3_Err
2494					}
2495				}
2496				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 229, "> ")
2497				if templ_7745c5c3_Err != nil {
2498					return templ_7745c5c3_Err
2499				}
2500				var templ_7745c5c3_Var121 string
2501				templ_7745c5c3_Var121, templ_7745c5c3_Err = templ.JoinStringErrs(m.Label)
2502				if templ_7745c5c3_Err != nil {
2503					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 478, Col: 17}
2504				}
2505				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var121))
2506				if templ_7745c5c3_Err != nil {
2507					return templ_7745c5c3_Err
2508				}
2509				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 230, " ")
2510				if templ_7745c5c3_Err != nil {
2511					return templ_7745c5c3_Err
2512				}
2513				if i < 9 {
2514					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 231, "<kbd aria-hidden=\"true\">")
2515					if templ_7745c5c3_Err != nil {
2516						return templ_7745c5c3_Err
2517					}
2518					var templ_7745c5c3_Var122 string
2519					templ_7745c5c3_Var122, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(i + 1))
2520					if templ_7745c5c3_Err != nil {
2521						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 480, Col: 46}
2522					}
2523					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var122))
2524					if templ_7745c5c3_Err != nil {
2525						return templ_7745c5c3_Err
2526					}
2527					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 232, "</kbd>")
2528					if templ_7745c5c3_Err != nil {
2529						return templ_7745c5c3_Err
2530					}
2531				}
2532				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 233, "</label>")
2533				if templ_7745c5c3_Err != nil {
2534					return templ_7745c5c3_Err
2535				}
2536			}
2537			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 234, "</fieldset>")
2538			if templ_7745c5c3_Err != nil {
2539				return templ_7745c5c3_Err
2540			}
2541			if p.Box.CanDeleteBranch {
2542				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 235, "<label class=\"d-check\"><input type=\"checkbox\" name=\"delete_branch\" value=\"1\"> delete ")
2543				if templ_7745c5c3_Err != nil {
2544					return templ_7745c5c3_Err
2545				}
2546				var templ_7745c5c3_Var123 string
2547				templ_7745c5c3_Var123, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
2548				if templ_7745c5c3_Err != nil {
2549					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 486, Col: 102}
2550				}
2551				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var123))
2552				if templ_7745c5c3_Err != nil {
2553					return templ_7745c5c3_Err
2554				}
2555				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 236, " after the merge <kbd aria-hidden=\"true\">D</kbd></label>")
2556				if templ_7745c5c3_Err != nil {
2557					return templ_7745c5c3_Err
2558				}
2559			}
2560			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 237, "<div class=\"d-btns\"><button type=\"submit\" class=\"btn primary\" data-default>Merge into ")
2561			if templ_7745c5c3_Err != nil {
2562				return templ_7745c5c3_Err
2563			}
2564			var templ_7745c5c3_Var124 string
2565			templ_7745c5c3_Var124, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
2566			if templ_7745c5c3_Err != nil {
2567				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 489, Col: 82}
2568			}
2569			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var124))
2570			if templ_7745c5c3_Err != nil {
2571				return templ_7745c5c3_Err
2572			}
2573			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 238, "</button></div></form>")
2574			if templ_7745c5c3_Err != nil {
2575				return templ_7745c5c3_Err
2576			}
2577		}
2578		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 239, "</div></details>")
2579		if templ_7745c5c3_Err != nil {
2580			return templ_7745c5c3_Err
2581		}
2582		return nil
2583	})
2584}
2585
2586// moreMenu is what else the owner does with an open request: mark the head
2587// read, close it, merge it from a terminal.
2588func moreMenu(p MRPage) templ.Component {
2589	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2590		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2591		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2592			return templ_7745c5c3_CtxErr
2593		}
2594		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2595		if !templ_7745c5c3_IsBuffer {
2596			defer func() {
2597				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2598				if templ_7745c5c3_Err == nil {
2599					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2600				}
2601			}()
2602		}
2603		ctx = templ.InitializeContext(ctx)
2604		templ_7745c5c3_Var125 := templ.GetChildren(ctx)
2605		if templ_7745c5c3_Var125 == nil {
2606			templ_7745c5c3_Var125 = templ.NopComponent
2607		}
2608		ctx = templ.ClearChildren(ctx)
2609		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 240, "<details class=\"menu omenu\"><summary class=\"btn icon\" aria-label=\"More actions\" title=\"more actions\">⋯</summary><div class=\"menu-pop\" role=\"group\" aria-label=\"More actions\">")
2610		if templ_7745c5c3_Err != nil {
2611			return templ_7745c5c3_Err
2612		}
2613		if p.Box.CanMarkRead {
2614			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 241, "<form method=\"post\" action=\"")
2615			if templ_7745c5c3_Err != nil {
2616				return templ_7745c5c3_Err
2617			}
2618			var templ_7745c5c3_Var126 templ.SafeURL
2619			templ_7745c5c3_Var126, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.ReadAction))
2620			if templ_7745c5c3_Err != nil {
2621				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 504, Col: 64}
2622			}
2623			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var126))
2624			if templ_7745c5c3_Err != nil {
2625				return templ_7745c5c3_Err
2626			}
2627			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 242, "\"><input type=\"hidden\" name=\"head_id\" value=\"")
2628			if templ_7745c5c3_Err != nil {
2629				return templ_7745c5c3_Err
2630			}
2631			var templ_7745c5c3_Var127 string
2632			templ_7745c5c3_Var127, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.Head)
2633			if templ_7745c5c3_Err != nil {
2634				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 505, Col: 59}
2635			}
2636			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var127)
2637			if templ_7745c5c3_Err != nil {
2638				return templ_7745c5c3_Err
2639			}
2640			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 243, "\"> <button type=\"submit\" title=\"the next visit can show only what changed after this head\" class=\"btn\" aria-keyshortcuts=\"Shift+R\" data-read>Mark read <kbd aria-hidden=\"true\">R</kbd></button></form>")
2641			if templ_7745c5c3_Err != nil {
2642				return templ_7745c5c3_Err
2643			}
2644		}
2645		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 244, "<form method=\"post\" action=\"")
2646		if templ_7745c5c3_Err != nil {
2647			return templ_7745c5c3_Err
2648		}
2649		var templ_7745c5c3_Var128 templ.SafeURL
2650		templ_7745c5c3_Var128, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.CloseAction))
2651		if templ_7745c5c3_Err != nil {
2652			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 509, Col: 64}
2653		}
2654		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var128))
2655		if templ_7745c5c3_Err != nil {
2656			return templ_7745c5c3_Err
2657		}
2658		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 245, "\"><button type=\"submit\" title=\"close without merging; the branch is kept\" class=\"btn danger\">Close</button></form>")
2659		if templ_7745c5c3_Err != nil {
2660			return templ_7745c5c3_Err
2661		}
2662		if !p.Box.HeadGone && p.Box.ReadyAction == "" {
2663			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 246, "<details class=\"d-or\"><summary class=\"mute\">or from a terminal</summary>")
2664			if templ_7745c5c3_Err != nil {
2665				return templ_7745c5c3_Err
2666			}
2667			templ_7745c5c3_Err = CloneBlock(p.Box.CLI).Render(ctx, templ_7745c5c3_Buffer)
2668			if templ_7745c5c3_Err != nil {
2669				return templ_7745c5c3_Err
2670			}
2671			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 247, "</details>")
2672			if templ_7745c5c3_Err != nil {
2673				return templ_7745c5c3_Err
2674			}
2675		}
2676		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 248, "</div></details>")
2677		if templ_7745c5c3_Err != nil {
2678			return templ_7745c5c3_Err
2679		}
2680		return nil
2681	})
2682}
2683
2684func Compare(l Layout, p ComparePage) templ.Component {
2685	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2686		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2687		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2688			return templ_7745c5c3_CtxErr
2689		}
2690		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2691		if !templ_7745c5c3_IsBuffer {
2692			defer func() {
2693				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2694				if templ_7745c5c3_Err == nil {
2695					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2696				}
2697			}()
2698		}
2699		ctx = templ.InitializeContext(ctx)
2700		templ_7745c5c3_Var129 := templ.GetChildren(ctx)
2701		if templ_7745c5c3_Var129 == nil {
2702			templ_7745c5c3_Var129 = templ.NopComponent
2703		}
2704		ctx = templ.ClearChildren(ctx)
2705		templ_7745c5c3_Var130 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2706			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2707			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2708			if !templ_7745c5c3_IsBuffer {
2709				defer func() {
2710					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2711					if templ_7745c5c3_Err == nil {
2712						templ_7745c5c3_Err = templ_7745c5c3_BufErr
2713					}
2714				}()
2715			}
2716			ctx = templ.InitializeContext(ctx)
2717			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 249, "<header class=\"show mr-h\"><h1>")
2718			if templ_7745c5c3_Err != nil {
2719				return templ_7745c5c3_Err
2720			}
2721			var templ_7745c5c3_Var131 string
2722			templ_7745c5c3_Var131, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
2723			if templ_7745c5c3_Err != nil {
2724				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 525, Col: 17}
2725			}
2726			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var131))
2727			if templ_7745c5c3_Err != nil {
2728				return templ_7745c5c3_Err
2729			}
2730			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 250, " → ")
2731			if templ_7745c5c3_Err != nil {
2732				return templ_7745c5c3_Err
2733			}
2734			var templ_7745c5c3_Var132 string
2735			templ_7745c5c3_Var132, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
2736			if templ_7745c5c3_Err != nil {
2737				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 525, Col: 34}
2738			}
2739			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var132))
2740			if templ_7745c5c3_Err != nil {
2741				return templ_7745c5c3_Err
2742			}
2743			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 251, "</h1><dl class=\"kv show-kv\"><dt>branch</dt><dd><a href=\"")
2744			if templ_7745c5c3_Err != nil {
2745				return templ_7745c5c3_Err
2746			}
2747			var templ_7745c5c3_Var133 templ.SafeURL
2748			templ_7745c5c3_Var133, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.SourceHref))
2749			if templ_7745c5c3_Err != nil {
2750				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 528, Col: 45}
2751			}
2752			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var133))
2753			if templ_7745c5c3_Err != nil {
2754				return templ_7745c5c3_Err
2755			}
2756			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 252, "\">")
2757			if templ_7745c5c3_Err != nil {
2758				return templ_7745c5c3_Err
2759			}
2760			var templ_7745c5c3_Var134 string
2761			templ_7745c5c3_Var134, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
2762			if templ_7745c5c3_Err != nil {
2763				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 528, Col: 58}
2764			}
2765			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var134))
2766			if templ_7745c5c3_Err != nil {
2767				return templ_7745c5c3_Err
2768			}
2769			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 253, "</a></dd><dt>target</dt><dd><a href=\"")
2770			if templ_7745c5c3_Err != nil {
2771				return templ_7745c5c3_Err
2772			}
2773			var templ_7745c5c3_Var135 templ.SafeURL
2774			templ_7745c5c3_Var135, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.TargetHref))
2775			if templ_7745c5c3_Err != nil {
2776				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 530, Col: 45}
2777			}
2778			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var135))
2779			if templ_7745c5c3_Err != nil {
2780				return templ_7745c5c3_Err
2781			}
2782			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 254, "\">")
2783			if templ_7745c5c3_Err != nil {
2784				return templ_7745c5c3_Err
2785			}
2786			var templ_7745c5c3_Var136 string
2787			templ_7745c5c3_Var136, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
2788			if templ_7745c5c3_Err != nil {
2789				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 530, Col: 58}
2790			}
2791			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var136))
2792			if templ_7745c5c3_Err != nil {
2793				return templ_7745c5c3_Err
2794			}
2795			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 255, "</a></dd><dt>ahead</dt><dd>")
2796			if templ_7745c5c3_Err != nil {
2797				return templ_7745c5c3_Err
2798			}
2799			var templ_7745c5c3_Var137 string
2800			templ_7745c5c3_Var137, templ_7745c5c3_Err = templ.JoinStringErrs(p.AheadText)
2801			if templ_7745c5c3_Err != nil {
2802				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 532, Col: 21}
2803			}
2804			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var137))
2805			if templ_7745c5c3_Err != nil {
2806				return templ_7745c5c3_Err
2807			}
2808			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 256, "</dd></dl></header>")
2809			if templ_7745c5c3_Err != nil {
2810				return templ_7745c5c3_Err
2811			}
2812			if p.Note != "" {
2813				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 257, "<p class=\"notice\">")
2814				if templ_7745c5c3_Err != nil {
2815					return templ_7745c5c3_Err
2816				}
2817				var templ_7745c5c3_Var138 string
2818				templ_7745c5c3_Var138, templ_7745c5c3_Err = templ.JoinStringErrs(p.Note)
2819				if templ_7745c5c3_Err != nil {
2820					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 536, Col: 29}
2821				}
2822				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var138))
2823				if templ_7745c5c3_Err != nil {
2824					return templ_7745c5c3_Err
2825				}
2826				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 258, "</p>")
2827				if templ_7745c5c3_Err != nil {
2828					return templ_7745c5c3_Err
2829				}
2830			}
2831			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 259, " ")
2832			if templ_7745c5c3_Err != nil {
2833				return templ_7745c5c3_Err
2834			}
2835			if p.Existing != nil {
2836				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 260, "<p class=\"notice\">an open merge request already covers these branches: <a href=\"")
2837				if templ_7745c5c3_Err != nil {
2838					return templ_7745c5c3_Err
2839				}
2840				var templ_7745c5c3_Var139 templ.SafeURL
2841				templ_7745c5c3_Var139, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Existing.Href))
2842				if templ_7745c5c3_Err != nil {
2843					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 539, Col: 114}
2844				}
2845				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var139))
2846				if templ_7745c5c3_Err != nil {
2847					return templ_7745c5c3_Err
2848				}
2849				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 261, "\">")
2850				if templ_7745c5c3_Err != nil {
2851					return templ_7745c5c3_Err
2852				}
2853				var templ_7745c5c3_Var140 string
2854				templ_7745c5c3_Var140, templ_7745c5c3_Err = templ.JoinStringErrs(p.Existing.Label)
2855				if templ_7745c5c3_Err != nil {
2856					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 539, Col: 135}
2857				}
2858				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var140))
2859				if templ_7745c5c3_Err != nil {
2860					return templ_7745c5c3_Err
2861				}
2862				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 262, "</a></p>")
2863				if templ_7745c5c3_Err != nil {
2864					return templ_7745c5c3_Err
2865				}
2866			}
2867			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 263, " ")
2868			if templ_7745c5c3_Err != nil {
2869				return templ_7745c5c3_Err
2870			}
2871			if p.Create != nil {
2872				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 264, "<form class=\"cform create\" method=\"post\" action=\"")
2873				if templ_7745c5c3_Err != nil {
2874					return templ_7745c5c3_Err
2875				}
2876				var templ_7745c5c3_Var141 templ.SafeURL
2877				templ_7745c5c3_Var141, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Create.Action))
2878				if templ_7745c5c3_Err != nil {
2879					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 542, Col: 83}
2880				}
2881				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var141))
2882				if templ_7745c5c3_Err != nil {
2883					return templ_7745c5c3_Err
2884				}
2885				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 265, "\"><input type=\"hidden\" name=\"source\" value=\"")
2886				if templ_7745c5c3_Err != nil {
2887					return templ_7745c5c3_Err
2888				}
2889				var templ_7745c5c3_Var142 string
2890				templ_7745c5c3_Var142, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Source)
2891				if templ_7745c5c3_Err != nil {
2892					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 543, Col: 62}
2893				}
2894				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var142)
2895				if templ_7745c5c3_Err != nil {
2896					return templ_7745c5c3_Err
2897				}
2898				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 266, "\"> <input type=\"hidden\" name=\"target\" value=\"")
2899				if templ_7745c5c3_Err != nil {
2900					return templ_7745c5c3_Err
2901				}
2902				var templ_7745c5c3_Var143 string
2903				templ_7745c5c3_Var143, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Target)
2904				if templ_7745c5c3_Err != nil {
2905					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 544, Col: 62}
2906				}
2907				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var143)
2908				if templ_7745c5c3_Err != nil {
2909					return templ_7745c5c3_Err
2910				}
2911				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 267, "\"> <label for=\"mr-title\">title</label> <input id=\"mr-title\" name=\"title\" type=\"text\" maxlength=\"120\" required value=\"")
2912				if templ_7745c5c3_Err != nil {
2913					return templ_7745c5c3_Err
2914				}
2915				var templ_7745c5c3_Var144 string
2916				templ_7745c5c3_Var144, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Title)
2917				if templ_7745c5c3_Err != nil {
2918					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 546, Col: 97}
2919				}
2920				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var144)
2921				if templ_7745c5c3_Err != nil {
2922					return templ_7745c5c3_Err
2923				}
2924				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 268, "\" autocomplete=\"off\"> <label for=\"mr-desc\">description</label> <textarea id=\"mr-desc\" name=\"description\" rows=\"4\" maxlength=\"8000\" placeholder=\"Markdown, optional\"></textarea><div class=\"f-btns\"><button type=\"submit\" class=\"btn primary\">Create merge request</button></div></form>")
2925				if templ_7745c5c3_Err != nil {
2926					return templ_7745c5c3_Err
2927				}
2928			}
2929			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 269, " ")
2930			if templ_7745c5c3_Err != nil {
2931				return templ_7745c5c3_Err
2932			}
2933			if p.HasDiff {
2934				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 270, "<div class=\"diff-tools\" role=\"group\" aria-label=\"Diff view\"><span class=\"dim\">")
2935				if templ_7745c5c3_Err != nil {
2936					return templ_7745c5c3_Err
2937				}
2938				var templ_7745c5c3_Var145 string
2939				templ_7745c5c3_Var145, templ_7745c5c3_Err = templ.JoinStringErrs(plural(p.NFiles, "file", "files"))
2940				if templ_7745c5c3_Err != nil {
2941					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 556, Col: 57}
2942				}
2943				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var145))
2944				if templ_7745c5c3_Err != nil {
2945					return templ_7745c5c3_Err
2946				}
2947				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 271, " · <span class=\"plus\">+")
2948				if templ_7745c5c3_Err != nil {
2949					return templ_7745c5c3_Err
2950				}
2951				var templ_7745c5c3_Var146 string
2952				templ_7745c5c3_Var146, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Adds))
2953				if templ_7745c5c3_Err != nil {
2954					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 556, Col: 97}
2955				}
2956				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var146))
2957				if templ_7745c5c3_Err != nil {
2958					return templ_7745c5c3_Err
2959				}
2960				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 272, "</span> <span class=\"minus\">-")
2961				if templ_7745c5c3_Err != nil {
2962					return templ_7745c5c3_Err
2963				}
2964				var templ_7745c5c3_Var147 string
2965				templ_7745c5c3_Var147, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Dels))
2966				if templ_7745c5c3_Err != nil {
2967					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 556, Col: 142}
2968				}
2969				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var147))
2970				if templ_7745c5c3_Err != nil {
2971					return templ_7745c5c3_Err
2972				}
2973				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 273, "</span></span> <span class=\"grow\"></span>")
2974				if templ_7745c5c3_Err != nil {
2975					return templ_7745c5c3_Err
2976				}
2977				templ_7745c5c3_Err = viewLink(p.DiffView, "unified", "Unified", "u", p.UnifiedHref).Render(ctx, templ_7745c5c3_Buffer)
2978				if templ_7745c5c3_Err != nil {
2979					return templ_7745c5c3_Err
2980				}
2981				templ_7745c5c3_Err = viewLink(p.DiffView, "split", "Split", "d", p.SplitHref).Render(ctx, templ_7745c5c3_Buffer)
2982				if templ_7745c5c3_Err != nil {
2983					return templ_7745c5c3_Err
2984				}
2985				templ_7745c5c3_Err = collapseButton().Render(ctx, templ_7745c5c3_Buffer)
2986				if templ_7745c5c3_Err != nil {
2987					return templ_7745c5c3_Err
2988				}
2989				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 274, "</div>")
2990				if templ_7745c5c3_Err != nil {
2991					return templ_7745c5c3_Err
2992				}
2993				if p.Invisible {
2994					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 275, "<p class=\"notice\">this diff holds invisible characters (direction controls, zero-width characters). They are shown as <span class=\"inv\">&lt;U+XXXX&gt;</span> markers, never applied.</p>")
2995					if templ_7745c5c3_Err != nil {
2996						return templ_7745c5c3_Err
2997					}
2998				}
2999				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 276, " <div id=\"diffs\"")
3000				if templ_7745c5c3_Err != nil {
3001					return templ_7745c5c3_Err
3002				}
3003				if p.Both {
3004					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 277, " data-diff=\"")
3005					if templ_7745c5c3_Err != nil {
3006						return templ_7745c5c3_Err
3007					}
3008					var templ_7745c5c3_Var148 string
3009					templ_7745c5c3_Var148, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
3010					if templ_7745c5c3_Err != nil {
3011						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 571, Col: 23}
3012					}
3013					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var148)
3014					if templ_7745c5c3_Err != nil {
3015						return templ_7745c5c3_Err
3016					}
3017					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 278, "\"")
3018					if templ_7745c5c3_Err != nil {
3019						return templ_7745c5c3_Err
3020					}
3021				} else {
3022					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 279, " data-view=\"")
3023					if templ_7745c5c3_Err != nil {
3024						return templ_7745c5c3_Err
3025					}
3026					var templ_7745c5c3_Var149 string
3027					templ_7745c5c3_Var149, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
3028					if templ_7745c5c3_Err != nil {
3029						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 573, Col: 23}
3030					}
3031					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var149)
3032					if templ_7745c5c3_Err != nil {
3033						return templ_7745c5c3_Err
3034					}
3035					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 280, "\"")
3036					if templ_7745c5c3_Err != nil {
3037						return templ_7745c5c3_Err
3038					}
3039				}
3040				if p.Both && !p.Pinned {
3041					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 281, " hx-live=\"this.dataset.diff = sessionStorage.getItem('diff') || this.dataset.diff\"")
3042					if templ_7745c5c3_Err != nil {
3043						return templ_7745c5c3_Err
3044					}
3045				}
3046				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 282, ">")
3047				if templ_7745c5c3_Err != nil {
3048					return templ_7745c5c3_Err
3049				}
3050				for _, f := range p.Files {
3051					templ_7745c5c3_Err = DiffFileView(f, p.DiffView).Render(ctx, templ_7745c5c3_Buffer)
3052					if templ_7745c5c3_Err != nil {
3053						return templ_7745c5c3_Err
3054					}
3055				}
3056				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 283, "</div>")
3057				if templ_7745c5c3_Err != nil {
3058					return templ_7745c5c3_Err
3059				}
3060			}
3061			return nil
3062		})
3063		templ_7745c5c3_Err = Shell(l, compareRail(p)).Render(templ.WithChildren(ctx, templ_7745c5c3_Var130), templ_7745c5c3_Buffer)
3064		if templ_7745c5c3_Err != nil {
3065			return templ_7745c5c3_Err
3066		}
3067		return nil
3068	})
3069}
3070
3071func compareRail(p ComparePage) templ.Component {
3072	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3073		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3074		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3075			return templ_7745c5c3_CtxErr
3076		}
3077		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3078		if !templ_7745c5c3_IsBuffer {
3079			defer func() {
3080				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3081				if templ_7745c5c3_Err == nil {
3082					templ_7745c5c3_Err = templ_7745c5c3_BufErr
3083				}
3084			}()
3085		}
3086		ctx = templ.InitializeContext(ctx)
3087		templ_7745c5c3_Var150 := templ.GetChildren(ctx)
3088		if templ_7745c5c3_Var150 == nil {
3089			templ_7745c5c3_Var150 = templ.NopComponent
3090		}
3091		ctx = templ.ClearChildren(ctx)
3092		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 284, "<section aria-labelledby=\"r-ahead\"><h2 id=\"r-ahead\">Commits <span class=\"count\">")
3093		if templ_7745c5c3_Err != nil {
3094			return templ_7745c5c3_Err
3095		}
3096		var templ_7745c5c3_Var151 string
3097		templ_7745c5c3_Var151, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Ahead)))
3098		if templ_7745c5c3_Err != nil {
3099			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 589, Col: 67}
3100		}
3101		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var151))
3102		if templ_7745c5c3_Err != nil {
3103			return templ_7745c5c3_Err
3104		}
3105		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 285, "</span></h2><ul class=\"pcommits\">")
3106		if templ_7745c5c3_Err != nil {
3107			return templ_7745c5c3_Err
3108		}
3109		for _, c := range p.Ahead {
3110			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 286, "<li><a href=\"")
3111			if templ_7745c5c3_Err != nil {
3112				return templ_7745c5c3_Err
3113			}
3114			var templ_7745c5c3_Var152 templ.SafeURL
3115			templ_7745c5c3_Var152, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.CHref))
3116			if templ_7745c5c3_Err != nil {
3117				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 593, Col: 37}
3118			}
3119			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var152))
3120			if templ_7745c5c3_Err != nil {
3121				return templ_7745c5c3_Err
3122			}
3123			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 287, "\">")
3124			if templ_7745c5c3_Err != nil {
3125				return templ_7745c5c3_Err
3126			}
3127			var templ_7745c5c3_Var153 string
3128			templ_7745c5c3_Var153, templ_7745c5c3_Err = templ.JoinStringErrs(c.Short)
3129			if templ_7745c5c3_Err != nil {
3130				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 593, Col: 49}
3131			}
3132			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var153))
3133			if templ_7745c5c3_Err != nil {
3134				return templ_7745c5c3_Err
3135			}
3136			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 288, "</a> <span class=\"s\">")
3137			if templ_7745c5c3_Err != nil {
3138				return templ_7745c5c3_Err
3139			}
3140			var templ_7745c5c3_Var154 string
3141			templ_7745c5c3_Var154, templ_7745c5c3_Err = templ.JoinStringErrs(c.Subject)
3142			if templ_7745c5c3_Err != nil {
3143				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 594, Col: 32}
3144			}
3145			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var154))
3146			if templ_7745c5c3_Err != nil {
3147				return templ_7745c5c3_Err
3148			}
3149			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 289, "</span> <span class=\"mute\">")
3150			if templ_7745c5c3_Err != nil {
3151				return templ_7745c5c3_Err
3152			}
3153			var templ_7745c5c3_Var155 string
3154			templ_7745c5c3_Var155, templ_7745c5c3_Err = templ.JoinStringErrs(c.Author)
3155			if templ_7745c5c3_Err != nil {
3156				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 596, Col: 16}
3157			}
3158			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var155))
3159			if templ_7745c5c3_Err != nil {
3160				return templ_7745c5c3_Err
3161			}
3162			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 290, " ")
3163			if templ_7745c5c3_Err != nil {
3164				return templ_7745c5c3_Err
3165			}
3166			if c.WhenAt != "" {
3167				var templ_7745c5c3_Var156 string
3168				templ_7745c5c3_Var156, templ_7745c5c3_Err = templ.JoinStringErrs(" · ")
3169				if templ_7745c5c3_Err != nil {
3170					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 598, Col: 15}
3171				}
3172				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var156))
3173				if templ_7745c5c3_Err != nil {
3174					return templ_7745c5c3_Err
3175				}
3176				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 291, "<time datetime=\"")
3177				if templ_7745c5c3_Err != nil {
3178					return templ_7745c5c3_Err
3179				}
3180				var templ_7745c5c3_Var157 string
3181				templ_7745c5c3_Var157, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.WhenAt)
3182				if templ_7745c5c3_Err != nil {
3183					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 598, Col: 42}
3184				}
3185				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var157)
3186				if templ_7745c5c3_Err != nil {
3187					return templ_7745c5c3_Err
3188				}
3189				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 292, "\">")
3190				if templ_7745c5c3_Err != nil {
3191					return templ_7745c5c3_Err
3192				}
3193				var templ_7745c5c3_Var158 string
3194				templ_7745c5c3_Var158, templ_7745c5c3_Err = templ.JoinStringErrs(c.When)
3195				if templ_7745c5c3_Err != nil {
3196					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 598, Col: 53}
3197				}
3198				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var158))
3199				if templ_7745c5c3_Err != nil {
3200					return templ_7745c5c3_Err
3201				}
3202				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 293, "</time>")
3203				if templ_7745c5c3_Err != nil {
3204					return templ_7745c5c3_Err
3205				}
3206			}
3207			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 294, "</span></li>")
3208			if templ_7745c5c3_Err != nil {
3209				return templ_7745c5c3_Err
3210			}
3211		}
3212		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 295, "</ul>")
3213		if templ_7745c5c3_Err != nil {
3214			return templ_7745c5c3_Err
3215		}
3216		if len(p.Ahead) == 0 {
3217			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 296, "<p class=\"dim\">no commit ahead of ")
3218			if templ_7745c5c3_Err != nil {
3219				return templ_7745c5c3_Err
3220			}
3221			var templ_7745c5c3_Var159 string
3222			templ_7745c5c3_Var159, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
3223			if templ_7745c5c3_Err != nil {
3224				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 605, Col: 47}
3225			}
3226			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var159))
3227			if templ_7745c5c3_Err != nil {
3228				return templ_7745c5c3_Err
3229			}
3230			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 297, ".</p>")
3231			if templ_7745c5c3_Err != nil {
3232				return templ_7745c5c3_Err
3233			}
3234		}
3235		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 298, "</section>")
3236		if templ_7745c5c3_Err != nil {
3237			return templ_7745c5c3_Err
3238		}
3239		if p.HasDiff {
3240			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 299, "<section aria-labelledby=\"r-files\"><h2 id=\"r-files\">Files <span class=\"count\">")
3241			if templ_7745c5c3_Err != nil {
3242				return templ_7745c5c3_Err
3243			}
3244			var templ_7745c5c3_Var160 string
3245			templ_7745c5c3_Var160, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Files)))
3246			if templ_7745c5c3_Err != nil {
3247				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 610, Col: 66}
3248			}
3249			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var160))
3250			if templ_7745c5c3_Err != nil {
3251				return templ_7745c5c3_Err
3252			}
3253			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 300, "</span></h2>")
3254			if templ_7745c5c3_Err != nil {
3255				return templ_7745c5c3_Err
3256			}
3257			templ_7745c5c3_Err = FileList(p.Files).Render(ctx, templ_7745c5c3_Buffer)
3258			if templ_7745c5c3_Err != nil {
3259				return templ_7745c5c3_Err
3260			}
3261			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 301, "</section>")
3262			if templ_7745c5c3_Err != nil {
3263				return templ_7745c5c3_Err
3264			}
3265		}
3266		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 302, "<section aria-labelledby=\"r-cli\"><h2 id=\"r-cli\">From a terminal</h2>")
3267		if templ_7745c5c3_Err != nil {
3268			return templ_7745c5c3_Err
3269		}
3270		templ_7745c5c3_Err = CloneBlock(p.CLI).Render(ctx, templ_7745c5c3_Buffer)
3271		if templ_7745c5c3_Err != nil {
3272			return templ_7745c5c3_Err
3273		}
3274		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 303, "</section>")
3275		if templ_7745c5c3_Err != nil {
3276			return templ_7745c5c3_Err
3277		}
3278		return nil
3279	})
3280}
3281
3282var _ = 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