detached 388d3be

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, "<section class=\"mr-card\"><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: 114, Col: 37}
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: 114, Col: 56}
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: 117, Col: 46}
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: 118, Col: 15}
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: 120, Col: 15}
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: 120, Col: 54}
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: 120, Col: 72}
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: 120, Col: 100}
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: 126, Col: 15}
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: 131, Col: 21}
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: 133, Col: 15}
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: 133, Col: 49}
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: 133, Col: 72}
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: 133, Col: 90}
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: 138, Col: 38}
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: 138, Col: 52}
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			if p.Desc != "" {
795				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "<article class=\"mr-desc prose\" aria-label=\"description\" hx-ignore>")
796				if templ_7745c5c3_Err != nil {
797					return templ_7745c5c3_Err
798				}
799				templ_7745c5c3_Err = templ.Raw(string(p.Desc)).Render(ctx, templ_7745c5c3_Buffer)
800				if templ_7745c5c3_Err != nil {
801					return templ_7745c5c3_Err
802				}
803				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, "</article>")
804				if templ_7745c5c3_Err != nil {
805					return templ_7745c5c3_Err
806				}
807			}
808			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "</section>")
809			if templ_7745c5c3_Err != nil {
810				return templ_7745c5c3_Err
811			}
812			templ_7745c5c3_Err = LiveSlot("mr-notice").Render(ctx, templ_7745c5c3_Buffer)
813			if templ_7745c5c3_Err != nil {
814				return templ_7745c5c3_Err
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: 152, 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: 156, 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: 158, 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: 162, 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: 162, 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: 166, 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: 176, 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: 182, 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: 184, 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: 197, 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: 197, 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: 215, 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: 215, 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: 217, 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: 236, 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: 236, 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: 238, 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: 240, 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: 240, 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: 240, 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: 240, 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: 243, 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: 246, 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: 249, 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: 249, 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 len(c.Parts) > 0 {
1410			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 124, "<p class=\"c-text\">")
1411			if templ_7745c5c3_Err != nil {
1412				return templ_7745c5c3_Err
1413			}
1414			templ_7745c5c3_Err = userText(c.Parts).Render(ctx, templ_7745c5c3_Buffer)
1415			if templ_7745c5c3_Err != nil {
1416				return templ_7745c5c3_Err
1417			}
1418			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 125, "</p>")
1419			if templ_7745c5c3_Err != nil {
1420				return templ_7745c5c3_Err
1421			}
1422		} else if c.Deleted {
1423			if c.Verdict != "" {
1424				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 126, "<p class=\"mute\">text deleted</p>")
1425				if templ_7745c5c3_Err != nil {
1426					return templ_7745c5c3_Err
1427				}
1428			} else {
1429				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 127, "<p class=\"mute\">deleted note</p>")
1430				if templ_7745c5c3_Err != nil {
1431					return templ_7745c5c3_Err
1432				}
1433			}
1434		} else {
1435			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 128, "<div class=\"c-body prose\">")
1436			if templ_7745c5c3_Err != nil {
1437				return templ_7745c5c3_Err
1438			}
1439			if suffix == "-s" {
1440				templ_7745c5c3_Err = templ.Raw(string(c.BodySplit)).Render(ctx, templ_7745c5c3_Buffer)
1441				if templ_7745c5c3_Err != nil {
1442					return templ_7745c5c3_Err
1443				}
1444			} else {
1445				templ_7745c5c3_Err = templ.Raw(string(c.Body)).Render(ctx, templ_7745c5c3_Buffer)
1446				if templ_7745c5c3_Err != nil {
1447					return templ_7745c5c3_Err
1448				}
1449			}
1450			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 129, "</div>")
1451			if templ_7745c5c3_Err != nil {
1452				return templ_7745c5c3_Err
1453			}
1454		}
1455		if c.Edited {
1456			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 130, "<span class=\"mute\">edited</span> ")
1457			if templ_7745c5c3_Err != nil {
1458				return templ_7745c5c3_Err
1459			}
1460		}
1461		if c.Verdict != "" {
1462			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 131, "<span class=\"c-state\">")
1463			if templ_7745c5c3_Err != nil {
1464				return templ_7745c5c3_Err
1465			}
1466			var templ_7745c5c3_Var70 string
1467			templ_7745c5c3_Var70, templ_7745c5c3_Err = templ.JoinStringErrs(c.Verdict)
1468			if templ_7745c5c3_Err != nil {
1469				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 273, Col: 36}
1470			}
1471			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var70))
1472			if templ_7745c5c3_Err != nil {
1473				return templ_7745c5c3_Err
1474			}
1475			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 132, "</span> ")
1476			if templ_7745c5c3_Err != nil {
1477				return templ_7745c5c3_Err
1478			}
1479		}
1480		if c.Range != "" {
1481			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 133, "<span class=\"mute\">")
1482			if templ_7745c5c3_Err != nil {
1483				return templ_7745c5c3_Err
1484			}
1485			var templ_7745c5c3_Var71 string
1486			templ_7745c5c3_Var71, templ_7745c5c3_Err = templ.JoinStringErrs(c.Range)
1487			if templ_7745c5c3_Err != nil {
1488				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 276, Col: 31}
1489			}
1490			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var71))
1491			if templ_7745c5c3_Err != nil {
1492				return templ_7745c5c3_Err
1493			}
1494			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 134, "</span> ")
1495			if templ_7745c5c3_Err != nil {
1496				return templ_7745c5c3_Err
1497			}
1498		}
1499		if c.Quote != "" {
1500			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 135, "<button type=\"button\" class=\"btn\" data-js data-quote=\"")
1501			if templ_7745c5c3_Err != nil {
1502				return templ_7745c5c3_Err
1503			}
1504			var templ_7745c5c3_Var72 string
1505			templ_7745c5c3_Var72, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.Quote)
1506			if templ_7745c5c3_Err != nil {
1507				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 279, Col: 65}
1508			}
1509			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var72)
1510			if templ_7745c5c3_Err != nil {
1511				return templ_7745c5c3_Err
1512			}
1513			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 136, "\">Quote</button> ")
1514			if templ_7745c5c3_Err != nil {
1515				return templ_7745c5c3_Err
1516			}
1517		}
1518		if c.Edit != nil {
1519			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 137, "<details><summary>Edit</summary><form method=\"post\" action=\"")
1520			if templ_7745c5c3_Err != nil {
1521				return templ_7745c5c3_Err
1522			}
1523			var templ_7745c5c3_Var73 templ.SafeURL
1524			templ_7745c5c3_Var73, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Edit.Action))
1525			if templ_7745c5c3_Err != nil {
1526				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 282, Col: 92}
1527			}
1528			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var73))
1529			if templ_7745c5c3_Err != nil {
1530				return templ_7745c5c3_Err
1531			}
1532			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 138, "\"><input type=\"hidden\" name=\"from\" value=\"")
1533			if templ_7745c5c3_Err != nil {
1534				return templ_7745c5c3_Err
1535			}
1536			var templ_7745c5c3_Var74 string
1537			templ_7745c5c3_Var74, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(c.Edit.From))
1538			if templ_7745c5c3_Err != nil {
1539				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 282, Col: 153}
1540			}
1541			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var74)
1542			if templ_7745c5c3_Err != nil {
1543				return templ_7745c5c3_Err
1544			}
1545			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 139, "\"><textarea name=\"text\" maxlength=\"8000\">")
1546			if templ_7745c5c3_Err != nil {
1547				return templ_7745c5c3_Err
1548			}
1549			var templ_7745c5c3_Var75 string
1550			templ_7745c5c3_Var75, templ_7745c5c3_Err = templ.JoinStringErrs(c.Edit.Text)
1551			if templ_7745c5c3_Err != nil {
1552				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 282, Col: 209}
1553			}
1554			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var75))
1555			if templ_7745c5c3_Err != nil {
1556				return templ_7745c5c3_Err
1557			}
1558			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 140, "</textarea><button class=\"btn\" type=\"submit\">Save</button></form></details> ")
1559			if templ_7745c5c3_Err != nil {
1560				return templ_7745c5c3_Err
1561			}
1562		}
1563		if c.Delete != nil {
1564			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 141, "<details><summary>Delete</summary><form method=\"post\" action=\"")
1565			if templ_7745c5c3_Err != nil {
1566				return templ_7745c5c3_Err
1567			}
1568			var templ_7745c5c3_Var76 templ.SafeURL
1569			templ_7745c5c3_Var76, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Delete.Action))
1570			if templ_7745c5c3_Err != nil {
1571				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 285, Col: 96}
1572			}
1573			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var76))
1574			if templ_7745c5c3_Err != nil {
1575				return templ_7745c5c3_Err
1576			}
1577			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 142, "\"><input type=\"hidden\" name=\"from\" value=\"")
1578			if templ_7745c5c3_Err != nil {
1579				return templ_7745c5c3_Err
1580			}
1581			var templ_7745c5c3_Var77 string
1582			templ_7745c5c3_Var77, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(c.Delete.From))
1583			if templ_7745c5c3_Err != nil {
1584				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 285, Col: 159}
1585			}
1586			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var77)
1587			if templ_7745c5c3_Err != nil {
1588				return templ_7745c5c3_Err
1589			}
1590			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 143, "\"><p>Delete this note?</p><button class=\"btn\" type=\"submit\">Confirm delete</button></form></details> ")
1591			if templ_7745c5c3_Err != nil {
1592				return templ_7745c5c3_Err
1593			}
1594		}
1595		for _, reply := range c.Replies {
1596			templ_7745c5c3_Err = commentView(reply, suffix).Render(ctx, templ_7745c5c3_Buffer)
1597			if templ_7745c5c3_Err != nil {
1598				return templ_7745c5c3_Err
1599			}
1600		}
1601		if c.Reply != nil {
1602			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 144, "<details data-reply><summary>Reply</summary>")
1603			if templ_7745c5c3_Err != nil {
1604				return templ_7745c5c3_Err
1605			}
1606			templ_7745c5c3_Err = commentForm(*c.Reply, suffix).Render(ctx, templ_7745c5c3_Buffer)
1607			if templ_7745c5c3_Err != nil {
1608				return templ_7745c5c3_Err
1609			}
1610			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 145, "</details> ")
1611			if templ_7745c5c3_Err != nil {
1612				return templ_7745c5c3_Err
1613			}
1614		}
1615		if c.Resolve != nil {
1616			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 146, "<form class=\"c-act\" method=\"post\" action=\"")
1617			if templ_7745c5c3_Err != nil {
1618				return templ_7745c5c3_Err
1619			}
1620			var templ_7745c5c3_Var78 templ.SafeURL
1621			templ_7745c5c3_Var78, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Resolve.Action))
1622			if templ_7745c5c3_Err != nil {
1623				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 296, Col: 77}
1624			}
1625			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var78))
1626			if templ_7745c5c3_Err != nil {
1627				return templ_7745c5c3_Err
1628			}
1629			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 147, "\"><input type=\"hidden\" name=\"resolved\" value=\"")
1630			if templ_7745c5c3_Err != nil {
1631				return templ_7745c5c3_Err
1632			}
1633			var templ_7745c5c3_Var79 string
1634			templ_7745c5c3_Var79, templ_7745c5c3_Err = templ.ResolveAttributeValue(boolText(c.Resolve.Value))
1635			if templ_7745c5c3_Err != nil {
1636				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 297, Col: 74}
1637			}
1638			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var79)
1639			if templ_7745c5c3_Err != nil {
1640				return templ_7745c5c3_Err
1641			}
1642			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 148, "\"> ")
1643			if templ_7745c5c3_Err != nil {
1644				return templ_7745c5c3_Err
1645			}
1646			if c.Resolve.From > 0 {
1647				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 149, "<input type=\"hidden\" name=\"from\" value=\"")
1648				if templ_7745c5c3_Err != nil {
1649					return templ_7745c5c3_Err
1650				}
1651				var templ_7745c5c3_Var80 string
1652				templ_7745c5c3_Var80, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(c.Resolve.From))
1653				if templ_7745c5c3_Err != nil {
1654					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 299, Col: 66}
1655				}
1656				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var80)
1657				if templ_7745c5c3_Err != nil {
1658					return templ_7745c5c3_Err
1659				}
1660				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 150, "\"> ")
1661				if templ_7745c5c3_Err != nil {
1662					return templ_7745c5c3_Err
1663				}
1664			}
1665			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 151, "<button type=\"submit\" class=\"btn\">")
1666			if templ_7745c5c3_Err != nil {
1667				return templ_7745c5c3_Err
1668			}
1669			var templ_7745c5c3_Var81 string
1670			templ_7745c5c3_Var81, templ_7745c5c3_Err = templ.JoinStringErrs(c.Resolve.Label)
1671			if templ_7745c5c3_Err != nil {
1672				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 301, Col: 55}
1673			}
1674			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var81))
1675			if templ_7745c5c3_Err != nil {
1676				return templ_7745c5c3_Err
1677			}
1678			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 152, "</button></form>")
1679			if templ_7745c5c3_Err != nil {
1680				return templ_7745c5c3_Err
1681			}
1682		}
1683		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 153, "</div>")
1684		if templ_7745c5c3_Err != nil {
1685			return templ_7745c5c3_Err
1686		}
1687		return nil
1688	})
1689}
1690
1691func boolText(b bool) string {
1692	if b {
1693		return "true"
1694	}
1695	return "false"
1696}
1697
1698// commentForm writes a comment, general or on a line.
1699func commentForm(f CommentForm, suffix string) templ.Component {
1700	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1701		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1702		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1703			return templ_7745c5c3_CtxErr
1704		}
1705		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1706		if !templ_7745c5c3_IsBuffer {
1707			defer func() {
1708				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1709				if templ_7745c5c3_Err == nil {
1710					templ_7745c5c3_Err = templ_7745c5c3_BufErr
1711				}
1712			}()
1713		}
1714		ctx = templ.InitializeContext(ctx)
1715		templ_7745c5c3_Var82 := templ.GetChildren(ctx)
1716		if templ_7745c5c3_Var82 == nil {
1717			templ_7745c5c3_Var82 = templ.NopComponent
1718		}
1719		ctx = templ.ClearChildren(ctx)
1720		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 154, "<form class=\"cform\" method=\"post\" action=\"")
1721		if templ_7745c5c3_Err != nil {
1722			return templ_7745c5c3_Err
1723		}
1724		var templ_7745c5c3_Var83 templ.SafeURL
1725		templ_7745c5c3_Var83, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(f.Action))
1726		if templ_7745c5c3_Err != nil {
1727			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 316, Col: 67}
1728		}
1729		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var83))
1730		if templ_7745c5c3_Err != nil {
1731			return templ_7745c5c3_Err
1732		}
1733		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 155, "\"><label for=\"")
1734		if templ_7745c5c3_Err != nil {
1735			return templ_7745c5c3_Err
1736		}
1737		var templ_7745c5c3_Var84 string
1738		templ_7745c5c3_Var84, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.ID + suffix)
1739		if templ_7745c5c3_Err != nil {
1740			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 317, Col: 28}
1741		}
1742		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var84)
1743		if templ_7745c5c3_Err != nil {
1744			return templ_7745c5c3_Err
1745		}
1746		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 156, "\">")
1747		if templ_7745c5c3_Err != nil {
1748			return templ_7745c5c3_Err
1749		}
1750		var templ_7745c5c3_Var85 string
1751		templ_7745c5c3_Var85, templ_7745c5c3_Err = templ.JoinStringErrs(f.Title)
1752		if templ_7745c5c3_Err != nil {
1753			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 317, Col: 40}
1754		}
1755		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var85))
1756		if templ_7745c5c3_Err != nil {
1757			return templ_7745c5c3_Err
1758		}
1759		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 157, "</label> <textarea id=\"")
1760		if templ_7745c5c3_Err != nil {
1761			return templ_7745c5c3_Err
1762		}
1763		var templ_7745c5c3_Var86 string
1764		templ_7745c5c3_Var86, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.ID + suffix)
1765		if templ_7745c5c3_Err != nil {
1766			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 319, Col: 21}
1767		}
1768		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var86)
1769		if templ_7745c5c3_Err != nil {
1770			return templ_7745c5c3_Err
1771		}
1772		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 158, "\" name=\"text\" rows=\"3\" maxlength=\"8000\"")
1773		if templ_7745c5c3_Err != nil {
1774			return templ_7745c5c3_Err
1775		}
1776		if f.Plain {
1777			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 159, " required placeholder=\"plain text, 8000 characters at most\"")
1778			if templ_7745c5c3_Err != nil {
1779				return templ_7745c5c3_Err
1780			}
1781		} else {
1782			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 160, " placeholder=\"Markdown, 8000 characters at most\"")
1783			if templ_7745c5c3_Err != nil {
1784				return templ_7745c5c3_Err
1785			}
1786		}
1787		if f.Focus {
1788			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 161, " autofocus")
1789			if templ_7745c5c3_Err != nil {
1790				return templ_7745c5c3_Err
1791			}
1792		}
1793		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 162, "></textarea> ")
1794		if templ_7745c5c3_Err != nil {
1795			return templ_7745c5c3_Err
1796		}
1797		if f.Path != "" {
1798			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 163, "<input type=\"hidden\" name=\"path\" value=\"")
1799			if templ_7745c5c3_Err != nil {
1800				return templ_7745c5c3_Err
1801			}
1802			var templ_7745c5c3_Var87 string
1803			templ_7745c5c3_Var87, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.Path)
1804			if templ_7745c5c3_Err != nil {
1805				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 334, Col: 50}
1806			}
1807			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var87)
1808			if templ_7745c5c3_Err != nil {
1809				return templ_7745c5c3_Err
1810			}
1811			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 164, "\"> <input type=\"hidden\" name=\"line\" value=\"")
1812			if templ_7745c5c3_Err != nil {
1813				return templ_7745c5c3_Err
1814			}
1815			var templ_7745c5c3_Var88 string
1816			templ_7745c5c3_Var88, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.Line)
1817			if templ_7745c5c3_Err != nil {
1818				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 335, Col: 50}
1819			}
1820			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var88)
1821			if templ_7745c5c3_Err != nil {
1822				return templ_7745c5c3_Err
1823			}
1824			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 165, "\"> <input type=\"hidden\" name=\"side\" value=\"")
1825			if templ_7745c5c3_Err != nil {
1826				return templ_7745c5c3_Err
1827			}
1828			var templ_7745c5c3_Var89 string
1829			templ_7745c5c3_Var89, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.Side)
1830			if templ_7745c5c3_Err != nil {
1831				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 336, Col: 50}
1832			}
1833			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var89)
1834			if templ_7745c5c3_Err != nil {
1835				return templ_7745c5c3_Err
1836			}
1837			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 166, "\"> <label>from line <input type=\"number\" name=\"start_line\" min=\"1\" value=\"")
1838			if templ_7745c5c3_Err != nil {
1839				return templ_7745c5c3_Err
1840			}
1841			var templ_7745c5c3_Var90 string
1842			templ_7745c5c3_Var90, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.StartLine)
1843			if templ_7745c5c3_Err != nil {
1844				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 337, Col: 86}
1845			}
1846			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var90)
1847			if templ_7745c5c3_Err != nil {
1848				return templ_7745c5c3_Err
1849			}
1850			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 167, "\"></label> ")
1851			if templ_7745c5c3_Err != nil {
1852				return templ_7745c5c3_Err
1853			}
1854		}
1855		if f.ReplyTo != "" {
1856			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 168, "<input type=\"hidden\" name=\"reply_to\" value=\"")
1857			if templ_7745c5c3_Err != nil {
1858				return templ_7745c5c3_Err
1859			}
1860			var templ_7745c5c3_Var91 string
1861			templ_7745c5c3_Var91, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.ReplyTo)
1862			if templ_7745c5c3_Err != nil {
1863				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 340, Col: 57}
1864			}
1865			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var91)
1866			if templ_7745c5c3_Err != nil {
1867				return templ_7745c5c3_Err
1868			}
1869			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 169, "\"> ")
1870			if templ_7745c5c3_Err != nil {
1871				return templ_7745c5c3_Err
1872			}
1873		}
1874		if f.Path == "" && f.ReplyTo == "" && !f.Plain {
1875			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 170, "<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>")
1876			if templ_7745c5c3_Err != nil {
1877				return templ_7745c5c3_Err
1878			}
1879		}
1880		if f.From > 0 {
1881			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 171, "<input type=\"hidden\" name=\"from\" value=\"")
1882			if templ_7745c5c3_Err != nil {
1883				return templ_7745c5c3_Err
1884			}
1885			var templ_7745c5c3_Var92 string
1886			templ_7745c5c3_Var92, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(f.From))
1887			if templ_7745c5c3_Err != nil {
1888				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 346, Col: 56}
1889			}
1890			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var92)
1891			if templ_7745c5c3_Err != nil {
1892				return templ_7745c5c3_Err
1893			}
1894			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 172, "\">")
1895			if templ_7745c5c3_Err != nil {
1896				return templ_7745c5c3_Err
1897			}
1898		}
1899		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 173, "<div class=\"f-btns\"><button type=\"submit\" class=\"btn primary\">Comment</button> ")
1900		if templ_7745c5c3_Err != nil {
1901			return templ_7745c5c3_Err
1902		}
1903		if f.Cancel != "" {
1904			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 174, "<a class=\"btn\" href=\"")
1905			if templ_7745c5c3_Err != nil {
1906				return templ_7745c5c3_Err
1907			}
1908			var templ_7745c5c3_Var93 templ.SafeURL
1909			templ_7745c5c3_Var93, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(f.Cancel))
1910			if templ_7745c5c3_Err != nil {
1911				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 351, Col: 49}
1912			}
1913			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var93))
1914			if templ_7745c5c3_Err != nil {
1915				return templ_7745c5c3_Err
1916			}
1917			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 175, "\">Cancel</a>")
1918			if templ_7745c5c3_Err != nil {
1919				return templ_7745c5c3_Err
1920			}
1921		}
1922		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 176, "</div></form>")
1923		if templ_7745c5c3_Err != nil {
1924			return templ_7745c5c3_Err
1925		}
1926		return nil
1927	})
1928}
1929
1930func mrRail(p MRPage) templ.Component {
1931	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1932		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1933		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1934			return templ_7745c5c3_CtxErr
1935		}
1936		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1937		if !templ_7745c5c3_IsBuffer {
1938			defer func() {
1939				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1940				if templ_7745c5c3_Err == nil {
1941					templ_7745c5c3_Err = templ_7745c5c3_BufErr
1942				}
1943			}()
1944		}
1945		ctx = templ.InitializeContext(ctx)
1946		templ_7745c5c3_Var94 := templ.GetChildren(ctx)
1947		if templ_7745c5c3_Var94 == nil {
1948			templ_7745c5c3_Var94 = templ.NopComponent
1949		}
1950		ctx = templ.ClearChildren(ctx)
1951		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 177, "<section aria-labelledby=\"r-files\" class=\"r-files\"><h2 id=\"r-files\">Files <span class=\"count\">")
1952		if templ_7745c5c3_Err != nil {
1953			return templ_7745c5c3_Err
1954		}
1955		var templ_7745c5c3_Var95 string
1956		templ_7745c5c3_Var95, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Files)))
1957		if templ_7745c5c3_Err != nil {
1958			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 360, Col: 49}
1959		}
1960		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var95))
1961		if templ_7745c5c3_Err != nil {
1962			return templ_7745c5c3_Err
1963		}
1964		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 178, "</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>")
1965		if templ_7745c5c3_Err != nil {
1966			return templ_7745c5c3_Err
1967		}
1968		templ_7745c5c3_Err = FileList(p.Files).Render(ctx, templ_7745c5c3_Buffer)
1969		if templ_7745c5c3_Err != nil {
1970			return templ_7745c5c3_Err
1971		}
1972		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 179, "</section>")
1973		if templ_7745c5c3_Err != nil {
1974			return templ_7745c5c3_Err
1975		}
1976		if len(p.Verdicts) > 0 {
1977			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 180, "<section><h2>Verdicts</h2><ul>")
1978			if templ_7745c5c3_Err != nil {
1979				return templ_7745c5c3_Err
1980			}
1981			for _, v := range p.Verdicts {
1982				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 181, "<li><a href=\"")
1983				if templ_7745c5c3_Err != nil {
1984					return templ_7745c5c3_Err
1985				}
1986				var templ_7745c5c3_Var96 templ.SafeURL
1987				templ_7745c5c3_Var96, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(v.Href))
1988				if templ_7745c5c3_Err != nil {
1989					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 373, Col: 37}
1990				}
1991				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var96))
1992				if templ_7745c5c3_Err != nil {
1993					return templ_7745c5c3_Err
1994				}
1995				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 182, "\">")
1996				if templ_7745c5c3_Err != nil {
1997					return templ_7745c5c3_Err
1998				}
1999				var templ_7745c5c3_Var97 string
2000				templ_7745c5c3_Var97, templ_7745c5c3_Err = templ.JoinStringErrs(v.Author)
2001				if templ_7745c5c3_Err != nil {
2002					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 373, Col: 50}
2003				}
2004				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var97))
2005				if templ_7745c5c3_Err != nil {
2006					return templ_7745c5c3_Err
2007				}
2008				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 183, ": ")
2009				if templ_7745c5c3_Err != nil {
2010					return templ_7745c5c3_Err
2011				}
2012				var templ_7745c5c3_Var98 string
2013				templ_7745c5c3_Var98, templ_7745c5c3_Err = templ.JoinStringErrs(v.Label)
2014				if templ_7745c5c3_Err != nil {
2015					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 373, Col: 63}
2016				}
2017				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var98))
2018				if templ_7745c5c3_Err != nil {
2019					return templ_7745c5c3_Err
2020				}
2021				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 184, "</a> ")
2022				if templ_7745c5c3_Err != nil {
2023					return templ_7745c5c3_Err
2024				}
2025				if v.Stale {
2026					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 185, "<span class=\"mute\">(stale)</span>")
2027					if templ_7745c5c3_Err != nil {
2028						return templ_7745c5c3_Err
2029					}
2030				}
2031				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 186, "</li>")
2032				if templ_7745c5c3_Err != nil {
2033					return templ_7745c5c3_Err
2034				}
2035			}
2036			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 187, "</ul></section>")
2037			if templ_7745c5c3_Err != nil {
2038				return templ_7745c5c3_Err
2039			}
2040		}
2041		templ_7745c5c3_Err = MRChecks(p.Checks).Render(ctx, templ_7745c5c3_Buffer)
2042		if templ_7745c5c3_Err != nil {
2043			return templ_7745c5c3_Err
2044		}
2045		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 188, "<section aria-labelledby=\"r-commits\"><h2 id=\"r-commits\">Commits <span class=\"count\">")
2046		if templ_7745c5c3_Err != nil {
2047			return templ_7745c5c3_Err
2048		}
2049		var templ_7745c5c3_Var99 string
2050		templ_7745c5c3_Var99, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Commits)))
2051		if templ_7745c5c3_Err != nil {
2052			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 384, Col: 71}
2053		}
2054		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var99))
2055		if templ_7745c5c3_Err != nil {
2056			return templ_7745c5c3_Err
2057		}
2058		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 189, "</span></h2><ul class=\"pcommits\">")
2059		if templ_7745c5c3_Err != nil {
2060			return templ_7745c5c3_Err
2061		}
2062		for _, c := range p.Commits {
2063			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 190, "<li")
2064			if templ_7745c5c3_Err != nil {
2065				return templ_7745c5c3_Err
2066			}
2067			if c.New {
2068				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 191, " data-new")
2069				if templ_7745c5c3_Err != nil {
2070					return templ_7745c5c3_Err
2071				}
2072			}
2073			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 192, "><a href=\"")
2074			if templ_7745c5c3_Err != nil {
2075				return templ_7745c5c3_Err
2076			}
2077			var templ_7745c5c3_Var100 templ.SafeURL
2078			templ_7745c5c3_Var100, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Href))
2079			if templ_7745c5c3_Err != nil {
2080				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 388, Col: 36}
2081			}
2082			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var100))
2083			if templ_7745c5c3_Err != nil {
2084				return templ_7745c5c3_Err
2085			}
2086			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 193, "\">")
2087			if templ_7745c5c3_Err != nil {
2088				return templ_7745c5c3_Err
2089			}
2090			var templ_7745c5c3_Var101 string
2091			templ_7745c5c3_Var101, templ_7745c5c3_Err = templ.JoinStringErrs(c.Short)
2092			if templ_7745c5c3_Err != nil {
2093				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 388, Col: 48}
2094			}
2095			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var101))
2096			if templ_7745c5c3_Err != nil {
2097				return templ_7745c5c3_Err
2098			}
2099			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 194, "</a> <span class=\"s\">")
2100			if templ_7745c5c3_Err != nil {
2101				return templ_7745c5c3_Err
2102			}
2103			var templ_7745c5c3_Var102 string
2104			templ_7745c5c3_Var102, templ_7745c5c3_Err = templ.JoinStringErrs(c.Subject)
2105			if templ_7745c5c3_Err != nil {
2106				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 389, Col: 32}
2107			}
2108			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var102))
2109			if templ_7745c5c3_Err != nil {
2110				return templ_7745c5c3_Err
2111			}
2112			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 195, "</span> ")
2113			if templ_7745c5c3_Err != nil {
2114				return templ_7745c5c3_Err
2115			}
2116			if c.Sig != nil {
2117				templ_7745c5c3_Err = signaturePill(c.Sig).Render(ctx, templ_7745c5c3_Buffer)
2118				if templ_7745c5c3_Err != nil {
2119					return templ_7745c5c3_Err
2120				}
2121			}
2122			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 196, "<span class=\"mute\">")
2123			if templ_7745c5c3_Err != nil {
2124				return templ_7745c5c3_Err
2125			}
2126			var templ_7745c5c3_Var103 string
2127			templ_7745c5c3_Var103, templ_7745c5c3_Err = templ.JoinStringErrs(c.Author)
2128			if templ_7745c5c3_Err != nil {
2129				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 394, Col: 16}
2130			}
2131			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var103))
2132			if templ_7745c5c3_Err != nil {
2133				return templ_7745c5c3_Err
2134			}
2135			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 197, " ")
2136			if templ_7745c5c3_Err != nil {
2137				return templ_7745c5c3_Err
2138			}
2139			if c.WhenAt != "" {
2140				var templ_7745c5c3_Var104 string
2141				templ_7745c5c3_Var104, templ_7745c5c3_Err = templ.JoinStringErrs(" · ")
2142				if templ_7745c5c3_Err != nil {
2143					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 396, Col: 15}
2144				}
2145				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var104))
2146				if templ_7745c5c3_Err != nil {
2147					return templ_7745c5c3_Err
2148				}
2149				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 198, "<time datetime=\"")
2150				if templ_7745c5c3_Err != nil {
2151					return templ_7745c5c3_Err
2152				}
2153				var templ_7745c5c3_Var105 string
2154				templ_7745c5c3_Var105, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.WhenAt)
2155				if templ_7745c5c3_Err != nil {
2156					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 396, Col: 42}
2157				}
2158				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var105)
2159				if templ_7745c5c3_Err != nil {
2160					return templ_7745c5c3_Err
2161				}
2162				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 199, "\">")
2163				if templ_7745c5c3_Err != nil {
2164					return templ_7745c5c3_Err
2165				}
2166				var templ_7745c5c3_Var106 string
2167				templ_7745c5c3_Var106, templ_7745c5c3_Err = templ.JoinStringErrs(c.When)
2168				if templ_7745c5c3_Err != nil {
2169					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 396, Col: 53}
2170				}
2171				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var106))
2172				if templ_7745c5c3_Err != nil {
2173					return templ_7745c5c3_Err
2174				}
2175				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 200, "</time> ")
2176				if templ_7745c5c3_Err != nil {
2177					return templ_7745c5c3_Err
2178				}
2179			}
2180			if c.New {
2181				var templ_7745c5c3_Var107 string
2182				templ_7745c5c3_Var107, templ_7745c5c3_Err = templ.JoinStringErrs(" · new")
2183				if templ_7745c5c3_Err != nil {
2184					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 399, Col: 18}
2185				}
2186				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var107))
2187				if templ_7745c5c3_Err != nil {
2188					return templ_7745c5c3_Err
2189				}
2190			}
2191			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 201, "</span></li>")
2192			if templ_7745c5c3_Err != nil {
2193				return templ_7745c5c3_Err
2194			}
2195		}
2196		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 202, "</ul>")
2197		if templ_7745c5c3_Err != nil {
2198			return templ_7745c5c3_Err
2199		}
2200		if len(p.Commits) == 0 {
2201			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 203, "<p class=\"dim\">no commit to merge.</p>")
2202			if templ_7745c5c3_Err != nil {
2203				return templ_7745c5c3_Err
2204			}
2205		}
2206		if p.CommitsNote != "" {
2207			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 204, "<p class=\"note\">")
2208			if templ_7745c5c3_Err != nil {
2209				return templ_7745c5c3_Err
2210			}
2211			var templ_7745c5c3_Var108 string
2212			templ_7745c5c3_Var108, templ_7745c5c3_Err = templ.JoinStringErrs(p.CommitsNote)
2213			if templ_7745c5c3_Err != nil {
2214				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 409, Col: 34}
2215			}
2216			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var108))
2217			if templ_7745c5c3_Err != nil {
2218				return templ_7745c5c3_Err
2219			}
2220			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 205, "</p>")
2221			if templ_7745c5c3_Err != nil {
2222				return templ_7745c5c3_Err
2223			}
2224		}
2225		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 206, "</section><section aria-labelledby=\"r-settings\"><h2 id=\"r-settings\">Settings</h2><dl class=\"kv\"><dt>modes</dt><dd>")
2226		if templ_7745c5c3_Err != nil {
2227			return templ_7745c5c3_Err
2228		}
2229		var templ_7745c5c3_Var109 string
2230		templ_7745c5c3_Var109, templ_7745c5c3_Err = templ.JoinStringErrs(strings.Join(p.Modes, ", "))
2231		if templ_7745c5c3_Err != nil {
2232			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 416, Col: 36}
2233		}
2234		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var109))
2235		if templ_7745c5c3_Err != nil {
2236			return templ_7745c5c3_Err
2237		}
2238		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 207, "</dd><dt>checks</dt><dd>")
2239		if templ_7745c5c3_Err != nil {
2240			return templ_7745c5c3_Err
2241		}
2242		if p.ChecksBlock {
2243			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 208, "failing ones block the merge")
2244			if templ_7745c5c3_Err != nil {
2245				return templ_7745c5c3_Err
2246			}
2247		} else {
2248			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 209, "do not block the merge")
2249			if templ_7745c5c3_Err != nil {
2250				return templ_7745c5c3_Err
2251			}
2252		}
2253		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 210, "</dd></dl></section>")
2254		if templ_7745c5c3_Err != nil {
2255			return templ_7745c5c3_Err
2256		}
2257		return nil
2258	})
2259}
2260
2261// mrBar is the bar above the diff, which follows the review: the totals, the
2262// layout of the diff, the state of the checks and, for the owner of an open
2263// request, the merge menu and the other actions. Each menu is a <details>: it
2264// works without scripts; with them, M and the keys of the menu drive it.
2265func mrBar(p MRPage) templ.Component {
2266	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2267		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2268		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2269			return templ_7745c5c3_CtxErr
2270		}
2271		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2272		if !templ_7745c5c3_IsBuffer {
2273			defer func() {
2274				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2275				if templ_7745c5c3_Err == nil {
2276					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2277				}
2278			}()
2279		}
2280		ctx = templ.InitializeContext(ctx)
2281		templ_7745c5c3_Var110 := templ.GetChildren(ctx)
2282		if templ_7745c5c3_Var110 == nil {
2283			templ_7745c5c3_Var110 = templ.NopComponent
2284		}
2285		ctx = templ.ClearChildren(ctx)
2286		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 211, "<div class=\"diff-tools mr-bar\" role=\"group\" aria-label=\"Diff view and merge\"><span class=\"dim\">")
2287		if templ_7745c5c3_Err != nil {
2288			return templ_7745c5c3_Err
2289		}
2290		var templ_7745c5c3_Var111 string
2291		templ_7745c5c3_Var111, templ_7745c5c3_Err = templ.JoinStringErrs(plural(p.NFiles, "file", "files"))
2292		if templ_7745c5c3_Err != nil {
2293			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 435, Col: 55}
2294		}
2295		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var111))
2296		if templ_7745c5c3_Err != nil {
2297			return templ_7745c5c3_Err
2298		}
2299		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 212, " · <span class=\"plus\">+")
2300		if templ_7745c5c3_Err != nil {
2301			return templ_7745c5c3_Err
2302		}
2303		var templ_7745c5c3_Var112 string
2304		templ_7745c5c3_Var112, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Adds))
2305		if templ_7745c5c3_Err != nil {
2306			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 435, Col: 95}
2307		}
2308		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var112))
2309		if templ_7745c5c3_Err != nil {
2310			return templ_7745c5c3_Err
2311		}
2312		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 213, "</span> <span class=\"minus\">-")
2313		if templ_7745c5c3_Err != nil {
2314			return templ_7745c5c3_Err
2315		}
2316		var templ_7745c5c3_Var113 string
2317		templ_7745c5c3_Var113, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Dels))
2318		if templ_7745c5c3_Err != nil {
2319			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 435, Col: 140}
2320		}
2321		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var113))
2322		if templ_7745c5c3_Err != nil {
2323			return templ_7745c5c3_Err
2324		}
2325		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 214, "</span></span>")
2326		if templ_7745c5c3_Err != nil {
2327			return templ_7745c5c3_Err
2328		}
2329		templ_7745c5c3_Err = diffViewMenu(p.DiffView).Render(ctx, templ_7745c5c3_Buffer)
2330		if templ_7745c5c3_Err != nil {
2331			return templ_7745c5c3_Err
2332		}
2333		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 215, "<span class=\"grow\"></span>")
2334		if templ_7745c5c3_Err != nil {
2335			return templ_7745c5c3_Err
2336		}
2337		templ_7745c5c3_Err = MRChecksSum(p.ChecksSum).Render(ctx, templ_7745c5c3_Buffer)
2338		if templ_7745c5c3_Err != nil {
2339			return templ_7745c5c3_Err
2340		}
2341		if p.Box != nil {
2342			templ_7745c5c3_Err = mergeMenu(p).Render(ctx, templ_7745c5c3_Buffer)
2343			if templ_7745c5c3_Err != nil {
2344				return templ_7745c5c3_Err
2345			}
2346			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 216, " ")
2347			if templ_7745c5c3_Err != nil {
2348				return templ_7745c5c3_Err
2349			}
2350			templ_7745c5c3_Err = moreMenu(p).Render(ctx, templ_7745c5c3_Buffer)
2351			if templ_7745c5c3_Err != nil {
2352				return templ_7745c5c3_Err
2353			}
2354		}
2355		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 217, "</div>")
2356		if templ_7745c5c3_Err != nil {
2357			return templ_7745c5c3_Err
2358		}
2359		return nil
2360	})
2361}
2362
2363// mergeMenu is the merge of an open request, for the owner: the form (it
2364// carries the head that was read), or "Ready for review" for a draft. The
2365// mode and the branch deletion have keys (1-3, D) while it is open.
2366func mergeMenu(p MRPage) templ.Component {
2367	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2368		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2369		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2370			return templ_7745c5c3_CtxErr
2371		}
2372		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2373		if !templ_7745c5c3_IsBuffer {
2374			defer func() {
2375				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2376				if templ_7745c5c3_Err == nil {
2377					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2378				}
2379			}()
2380		}
2381		ctx = templ.InitializeContext(ctx)
2382		templ_7745c5c3_Var114 := templ.GetChildren(ctx)
2383		if templ_7745c5c3_Var114 == nil {
2384			templ_7745c5c3_Var114 = templ.NopComponent
2385		}
2386		ctx = templ.ClearChildren(ctx)
2387		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 218, "<details class=\"menu mmenu\" id=\"merge-menu\" data-state=\"open\"><summary class=\"btn primary\" aria-keyshortcuts=\"Shift+M\">")
2388		if templ_7745c5c3_Err != nil {
2389			return templ_7745c5c3_Err
2390		}
2391		if p.Box.ReadyAction != "" {
2392			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 219, "Draft ")
2393			if templ_7745c5c3_Err != nil {
2394				return templ_7745c5c3_Err
2395			}
2396		} else {
2397			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 220, "Merge ")
2398			if templ_7745c5c3_Err != nil {
2399				return templ_7745c5c3_Err
2400			}
2401		}
2402		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 221, "<kbd aria-hidden=\"true\">M</kbd></summary><div class=\"menu-pop\" role=\"group\" aria-label=\"Merge\"><dl class=\"kv\"><dt>head</dt><dd>")
2403		if templ_7745c5c3_Err != nil {
2404			return templ_7745c5c3_Err
2405		}
2406		if p.Box.HeadGone {
2407			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 222, "gone: the source branch was deleted")
2408			if templ_7745c5c3_Err != nil {
2409				return templ_7745c5c3_Err
2410			}
2411		} else {
2412			var templ_7745c5c3_Var115 string
2413			templ_7745c5c3_Var115, templ_7745c5c3_Err = templ.JoinStringErrs(p.HeadShort)
2414			if templ_7745c5c3_Err != nil {
2415				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 466, Col: 19}
2416			}
2417			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var115))
2418			if templ_7745c5c3_Err != nil {
2419				return templ_7745c5c3_Err
2420			}
2421		}
2422		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 223, "</dd><dt>into</dt><dd>")
2423		if templ_7745c5c3_Err != nil {
2424			return templ_7745c5c3_Err
2425		}
2426		var templ_7745c5c3_Var116 string
2427		templ_7745c5c3_Var116, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
2428		if templ_7745c5c3_Err != nil {
2429			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 470, Col: 18}
2430		}
2431		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var116))
2432		if templ_7745c5c3_Err != nil {
2433			return templ_7745c5c3_Err
2434		}
2435		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 224, "</dd></dl>")
2436		if templ_7745c5c3_Err != nil {
2437			return templ_7745c5c3_Err
2438		}
2439		if p.Box.ReadyAction != "" {
2440			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 225, "<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=\"")
2441			if templ_7745c5c3_Err != nil {
2442				return templ_7745c5c3_Err
2443			}
2444			var templ_7745c5c3_Var117 templ.SafeURL
2445			templ_7745c5c3_Var117, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.ReadyAction))
2446			if templ_7745c5c3_Err != nil {
2447				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 474, Col: 80}
2448			}
2449			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var117))
2450			if templ_7745c5c3_Err != nil {
2451				return templ_7745c5c3_Err
2452			}
2453			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 226, "\"><button type=\"submit\" class=\"btn primary\" data-default title=\"remove the draft prefix from the title\">Ready for review</button></form>")
2454			if templ_7745c5c3_Err != nil {
2455				return templ_7745c5c3_Err
2456			}
2457		} else if !p.Box.HeadGone {
2458			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 227, "<form class=\"d-acts\" method=\"post\" action=\"")
2459			if templ_7745c5c3_Err != nil {
2460				return templ_7745c5c3_Err
2461			}
2462			var templ_7745c5c3_Var118 templ.SafeURL
2463			templ_7745c5c3_Var118, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.MergeAction))
2464			if templ_7745c5c3_Err != nil {
2465				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 478, Col: 80}
2466			}
2467			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var118))
2468			if templ_7745c5c3_Err != nil {
2469				return templ_7745c5c3_Err
2470			}
2471			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 228, "\"><input type=\"hidden\" name=\"head_id\" value=\"")
2472			if templ_7745c5c3_Err != nil {
2473				return templ_7745c5c3_Err
2474			}
2475			var templ_7745c5c3_Var119 string
2476			templ_7745c5c3_Var119, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.Head)
2477			if templ_7745c5c3_Err != nil {
2478				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 479, Col: 59}
2479			}
2480			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var119)
2481			if templ_7745c5c3_Err != nil {
2482				return templ_7745c5c3_Err
2483			}
2484			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 229, "\"><fieldset class=\"d-modes\"><legend class=\"sr\">merge mode</legend> ")
2485			if templ_7745c5c3_Err != nil {
2486				return templ_7745c5c3_Err
2487			}
2488			for i, m := range p.Box.Modes {
2489				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 230, "<label><input type=\"radio\" name=\"mode\" value=\"")
2490				if templ_7745c5c3_Err != nil {
2491					return templ_7745c5c3_Err
2492				}
2493				var templ_7745c5c3_Var120 string
2494				templ_7745c5c3_Var120, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.Value)
2495				if templ_7745c5c3_Err != nil {
2496					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 484, Col: 55}
2497				}
2498				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var120)
2499				if templ_7745c5c3_Err != nil {
2500					return templ_7745c5c3_Err
2501				}
2502				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 231, "\"")
2503				if templ_7745c5c3_Err != nil {
2504					return templ_7745c5c3_Err
2505				}
2506				if i == 0 {
2507					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 232, " checked")
2508					if templ_7745c5c3_Err != nil {
2509						return templ_7745c5c3_Err
2510					}
2511				}
2512				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 233, "> ")
2513				if templ_7745c5c3_Err != nil {
2514					return templ_7745c5c3_Err
2515				}
2516				var templ_7745c5c3_Var121 string
2517				templ_7745c5c3_Var121, templ_7745c5c3_Err = templ.JoinStringErrs(m.Label)
2518				if templ_7745c5c3_Err != nil {
2519					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 485, Col: 17}
2520				}
2521				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var121))
2522				if templ_7745c5c3_Err != nil {
2523					return templ_7745c5c3_Err
2524				}
2525				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 234, " ")
2526				if templ_7745c5c3_Err != nil {
2527					return templ_7745c5c3_Err
2528				}
2529				if i < 9 {
2530					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 235, "<kbd aria-hidden=\"true\">")
2531					if templ_7745c5c3_Err != nil {
2532						return templ_7745c5c3_Err
2533					}
2534					var templ_7745c5c3_Var122 string
2535					templ_7745c5c3_Var122, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(i + 1))
2536					if templ_7745c5c3_Err != nil {
2537						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 487, Col: 46}
2538					}
2539					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var122))
2540					if templ_7745c5c3_Err != nil {
2541						return templ_7745c5c3_Err
2542					}
2543					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 236, "</kbd>")
2544					if templ_7745c5c3_Err != nil {
2545						return templ_7745c5c3_Err
2546					}
2547				}
2548				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 237, "</label>")
2549				if templ_7745c5c3_Err != nil {
2550					return templ_7745c5c3_Err
2551				}
2552			}
2553			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 238, "</fieldset>")
2554			if templ_7745c5c3_Err != nil {
2555				return templ_7745c5c3_Err
2556			}
2557			if p.Box.CanDeleteBranch {
2558				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 239, "<label class=\"d-check\"><input type=\"checkbox\" name=\"delete_branch\" value=\"1\"> delete ")
2559				if templ_7745c5c3_Err != nil {
2560					return templ_7745c5c3_Err
2561				}
2562				var templ_7745c5c3_Var123 string
2563				templ_7745c5c3_Var123, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
2564				if templ_7745c5c3_Err != nil {
2565					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 493, Col: 102}
2566				}
2567				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var123))
2568				if templ_7745c5c3_Err != nil {
2569					return templ_7745c5c3_Err
2570				}
2571				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 240, " after the merge <kbd aria-hidden=\"true\">D</kbd></label>")
2572				if templ_7745c5c3_Err != nil {
2573					return templ_7745c5c3_Err
2574				}
2575			}
2576			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 241, "<div class=\"d-btns\"><button type=\"submit\" class=\"btn primary\" data-default>Merge into ")
2577			if templ_7745c5c3_Err != nil {
2578				return templ_7745c5c3_Err
2579			}
2580			var templ_7745c5c3_Var124 string
2581			templ_7745c5c3_Var124, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
2582			if templ_7745c5c3_Err != nil {
2583				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 496, Col: 82}
2584			}
2585			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var124))
2586			if templ_7745c5c3_Err != nil {
2587				return templ_7745c5c3_Err
2588			}
2589			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 242, "</button></div></form>")
2590			if templ_7745c5c3_Err != nil {
2591				return templ_7745c5c3_Err
2592			}
2593		}
2594		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 243, "</div></details>")
2595		if templ_7745c5c3_Err != nil {
2596			return templ_7745c5c3_Err
2597		}
2598		return nil
2599	})
2600}
2601
2602// moreMenu is what else the owner does with an open request: mark the head
2603// read, close it, merge it from a terminal.
2604func moreMenu(p MRPage) templ.Component {
2605	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2606		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2607		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2608			return templ_7745c5c3_CtxErr
2609		}
2610		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2611		if !templ_7745c5c3_IsBuffer {
2612			defer func() {
2613				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2614				if templ_7745c5c3_Err == nil {
2615					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2616				}
2617			}()
2618		}
2619		ctx = templ.InitializeContext(ctx)
2620		templ_7745c5c3_Var125 := templ.GetChildren(ctx)
2621		if templ_7745c5c3_Var125 == nil {
2622			templ_7745c5c3_Var125 = templ.NopComponent
2623		}
2624		ctx = templ.ClearChildren(ctx)
2625		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 244, "<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\">")
2626		if templ_7745c5c3_Err != nil {
2627			return templ_7745c5c3_Err
2628		}
2629		if p.Box.CanMarkRead {
2630			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 245, "<form method=\"post\" action=\"")
2631			if templ_7745c5c3_Err != nil {
2632				return templ_7745c5c3_Err
2633			}
2634			var templ_7745c5c3_Var126 templ.SafeURL
2635			templ_7745c5c3_Var126, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.ReadAction))
2636			if templ_7745c5c3_Err != nil {
2637				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 511, Col: 64}
2638			}
2639			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var126))
2640			if templ_7745c5c3_Err != nil {
2641				return templ_7745c5c3_Err
2642			}
2643			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 246, "\"><input type=\"hidden\" name=\"head_id\" value=\"")
2644			if templ_7745c5c3_Err != nil {
2645				return templ_7745c5c3_Err
2646			}
2647			var templ_7745c5c3_Var127 string
2648			templ_7745c5c3_Var127, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.Head)
2649			if templ_7745c5c3_Err != nil {
2650				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 512, Col: 59}
2651			}
2652			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var127)
2653			if templ_7745c5c3_Err != nil {
2654				return templ_7745c5c3_Err
2655			}
2656			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 247, "\"> <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>")
2657			if templ_7745c5c3_Err != nil {
2658				return templ_7745c5c3_Err
2659			}
2660		}
2661		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 248, "<form method=\"post\" action=\"")
2662		if templ_7745c5c3_Err != nil {
2663			return templ_7745c5c3_Err
2664		}
2665		var templ_7745c5c3_Var128 templ.SafeURL
2666		templ_7745c5c3_Var128, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.CloseAction))
2667		if templ_7745c5c3_Err != nil {
2668			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 516, Col: 64}
2669		}
2670		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var128))
2671		if templ_7745c5c3_Err != nil {
2672			return templ_7745c5c3_Err
2673		}
2674		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 249, "\"><button type=\"submit\" title=\"close without merging; the branch is kept\" class=\"btn danger\">Close</button></form>")
2675		if templ_7745c5c3_Err != nil {
2676			return templ_7745c5c3_Err
2677		}
2678		if !p.Box.HeadGone && p.Box.ReadyAction == "" {
2679			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 250, "<details class=\"d-or\"><summary class=\"mute\">or from a terminal</summary>")
2680			if templ_7745c5c3_Err != nil {
2681				return templ_7745c5c3_Err
2682			}
2683			templ_7745c5c3_Err = CloneBlock(p.Box.CLI).Render(ctx, templ_7745c5c3_Buffer)
2684			if templ_7745c5c3_Err != nil {
2685				return templ_7745c5c3_Err
2686			}
2687			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 251, "</details>")
2688			if templ_7745c5c3_Err != nil {
2689				return templ_7745c5c3_Err
2690			}
2691		}
2692		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 252, "</div></details>")
2693		if templ_7745c5c3_Err != nil {
2694			return templ_7745c5c3_Err
2695		}
2696		return nil
2697	})
2698}
2699
2700func Compare(l Layout, p ComparePage) templ.Component {
2701	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2702		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2703		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2704			return templ_7745c5c3_CtxErr
2705		}
2706		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2707		if !templ_7745c5c3_IsBuffer {
2708			defer func() {
2709				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2710				if templ_7745c5c3_Err == nil {
2711					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2712				}
2713			}()
2714		}
2715		ctx = templ.InitializeContext(ctx)
2716		templ_7745c5c3_Var129 := templ.GetChildren(ctx)
2717		if templ_7745c5c3_Var129 == nil {
2718			templ_7745c5c3_Var129 = templ.NopComponent
2719		}
2720		ctx = templ.ClearChildren(ctx)
2721		templ_7745c5c3_Var130 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2722			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2723			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2724			if !templ_7745c5c3_IsBuffer {
2725				defer func() {
2726					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2727					if templ_7745c5c3_Err == nil {
2728						templ_7745c5c3_Err = templ_7745c5c3_BufErr
2729					}
2730				}()
2731			}
2732			ctx = templ.InitializeContext(ctx)
2733			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 253, "<header class=\"show mr-h\"><h1>")
2734			if templ_7745c5c3_Err != nil {
2735				return templ_7745c5c3_Err
2736			}
2737			var templ_7745c5c3_Var131 string
2738			templ_7745c5c3_Var131, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
2739			if templ_7745c5c3_Err != nil {
2740				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 532, Col: 17}
2741			}
2742			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var131))
2743			if templ_7745c5c3_Err != nil {
2744				return templ_7745c5c3_Err
2745			}
2746			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 254, " → ")
2747			if templ_7745c5c3_Err != nil {
2748				return templ_7745c5c3_Err
2749			}
2750			var templ_7745c5c3_Var132 string
2751			templ_7745c5c3_Var132, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
2752			if templ_7745c5c3_Err != nil {
2753				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 532, Col: 34}
2754			}
2755			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var132))
2756			if templ_7745c5c3_Err != nil {
2757				return templ_7745c5c3_Err
2758			}
2759			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 255, "</h1><dl class=\"kv show-kv\"><dt>branch</dt><dd><a href=\"")
2760			if templ_7745c5c3_Err != nil {
2761				return templ_7745c5c3_Err
2762			}
2763			var templ_7745c5c3_Var133 templ.SafeURL
2764			templ_7745c5c3_Var133, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.SourceHref))
2765			if templ_7745c5c3_Err != nil {
2766				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 535, Col: 45}
2767			}
2768			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var133))
2769			if templ_7745c5c3_Err != nil {
2770				return templ_7745c5c3_Err
2771			}
2772			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 256, "\">")
2773			if templ_7745c5c3_Err != nil {
2774				return templ_7745c5c3_Err
2775			}
2776			var templ_7745c5c3_Var134 string
2777			templ_7745c5c3_Var134, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
2778			if templ_7745c5c3_Err != nil {
2779				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 535, Col: 58}
2780			}
2781			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var134))
2782			if templ_7745c5c3_Err != nil {
2783				return templ_7745c5c3_Err
2784			}
2785			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 257, "</a></dd><dt>target</dt><dd><a href=\"")
2786			if templ_7745c5c3_Err != nil {
2787				return templ_7745c5c3_Err
2788			}
2789			var templ_7745c5c3_Var135 templ.SafeURL
2790			templ_7745c5c3_Var135, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.TargetHref))
2791			if templ_7745c5c3_Err != nil {
2792				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 537, Col: 45}
2793			}
2794			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var135))
2795			if templ_7745c5c3_Err != nil {
2796				return templ_7745c5c3_Err
2797			}
2798			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 258, "\">")
2799			if templ_7745c5c3_Err != nil {
2800				return templ_7745c5c3_Err
2801			}
2802			var templ_7745c5c3_Var136 string
2803			templ_7745c5c3_Var136, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
2804			if templ_7745c5c3_Err != nil {
2805				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 537, Col: 58}
2806			}
2807			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var136))
2808			if templ_7745c5c3_Err != nil {
2809				return templ_7745c5c3_Err
2810			}
2811			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 259, "</a></dd><dt>ahead</dt><dd>")
2812			if templ_7745c5c3_Err != nil {
2813				return templ_7745c5c3_Err
2814			}
2815			var templ_7745c5c3_Var137 string
2816			templ_7745c5c3_Var137, templ_7745c5c3_Err = templ.JoinStringErrs(p.AheadText)
2817			if templ_7745c5c3_Err != nil {
2818				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 539, Col: 21}
2819			}
2820			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var137))
2821			if templ_7745c5c3_Err != nil {
2822				return templ_7745c5c3_Err
2823			}
2824			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 260, "</dd></dl></header>")
2825			if templ_7745c5c3_Err != nil {
2826				return templ_7745c5c3_Err
2827			}
2828			if p.Note != "" {
2829				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 261, "<p class=\"notice\">")
2830				if templ_7745c5c3_Err != nil {
2831					return templ_7745c5c3_Err
2832				}
2833				var templ_7745c5c3_Var138 string
2834				templ_7745c5c3_Var138, templ_7745c5c3_Err = templ.JoinStringErrs(p.Note)
2835				if templ_7745c5c3_Err != nil {
2836					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 543, Col: 29}
2837				}
2838				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var138))
2839				if templ_7745c5c3_Err != nil {
2840					return templ_7745c5c3_Err
2841				}
2842				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 262, "</p>")
2843				if templ_7745c5c3_Err != nil {
2844					return templ_7745c5c3_Err
2845				}
2846			}
2847			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 263, " ")
2848			if templ_7745c5c3_Err != nil {
2849				return templ_7745c5c3_Err
2850			}
2851			if p.Existing != nil {
2852				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 264, "<p class=\"notice\">an open merge request already covers these branches: <a href=\"")
2853				if templ_7745c5c3_Err != nil {
2854					return templ_7745c5c3_Err
2855				}
2856				var templ_7745c5c3_Var139 templ.SafeURL
2857				templ_7745c5c3_Var139, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Existing.Href))
2858				if templ_7745c5c3_Err != nil {
2859					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 546, Col: 114}
2860				}
2861				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var139))
2862				if templ_7745c5c3_Err != nil {
2863					return templ_7745c5c3_Err
2864				}
2865				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 265, "\">")
2866				if templ_7745c5c3_Err != nil {
2867					return templ_7745c5c3_Err
2868				}
2869				var templ_7745c5c3_Var140 string
2870				templ_7745c5c3_Var140, templ_7745c5c3_Err = templ.JoinStringErrs(p.Existing.Label)
2871				if templ_7745c5c3_Err != nil {
2872					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 546, Col: 135}
2873				}
2874				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var140))
2875				if templ_7745c5c3_Err != nil {
2876					return templ_7745c5c3_Err
2877				}
2878				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 266, "</a></p>")
2879				if templ_7745c5c3_Err != nil {
2880					return templ_7745c5c3_Err
2881				}
2882			}
2883			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 267, " ")
2884			if templ_7745c5c3_Err != nil {
2885				return templ_7745c5c3_Err
2886			}
2887			if p.Create != nil {
2888				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 268, "<form class=\"cform create\" method=\"post\" action=\"")
2889				if templ_7745c5c3_Err != nil {
2890					return templ_7745c5c3_Err
2891				}
2892				var templ_7745c5c3_Var141 templ.SafeURL
2893				templ_7745c5c3_Var141, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Create.Action))
2894				if templ_7745c5c3_Err != nil {
2895					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 549, Col: 83}
2896				}
2897				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var141))
2898				if templ_7745c5c3_Err != nil {
2899					return templ_7745c5c3_Err
2900				}
2901				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 269, "\"><input type=\"hidden\" name=\"source\" value=\"")
2902				if templ_7745c5c3_Err != nil {
2903					return templ_7745c5c3_Err
2904				}
2905				var templ_7745c5c3_Var142 string
2906				templ_7745c5c3_Var142, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Source)
2907				if templ_7745c5c3_Err != nil {
2908					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 550, Col: 62}
2909				}
2910				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var142)
2911				if templ_7745c5c3_Err != nil {
2912					return templ_7745c5c3_Err
2913				}
2914				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 270, "\"> <input type=\"hidden\" name=\"target\" value=\"")
2915				if templ_7745c5c3_Err != nil {
2916					return templ_7745c5c3_Err
2917				}
2918				var templ_7745c5c3_Var143 string
2919				templ_7745c5c3_Var143, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Target)
2920				if templ_7745c5c3_Err != nil {
2921					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 551, Col: 62}
2922				}
2923				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var143)
2924				if templ_7745c5c3_Err != nil {
2925					return templ_7745c5c3_Err
2926				}
2927				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 271, "\"> <label for=\"mr-title\">title</label> <input id=\"mr-title\" name=\"title\" type=\"text\" maxlength=\"120\" required value=\"")
2928				if templ_7745c5c3_Err != nil {
2929					return templ_7745c5c3_Err
2930				}
2931				var templ_7745c5c3_Var144 string
2932				templ_7745c5c3_Var144, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Title)
2933				if templ_7745c5c3_Err != nil {
2934					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 553, Col: 97}
2935				}
2936				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var144)
2937				if templ_7745c5c3_Err != nil {
2938					return templ_7745c5c3_Err
2939				}
2940				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 272, "\" 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>")
2941				if templ_7745c5c3_Err != nil {
2942					return templ_7745c5c3_Err
2943				}
2944			}
2945			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 273, " ")
2946			if templ_7745c5c3_Err != nil {
2947				return templ_7745c5c3_Err
2948			}
2949			if p.HasDiff {
2950				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 274, "<div class=\"diff-tools\" role=\"group\" aria-label=\"Diff view\"><span class=\"dim\">")
2951				if templ_7745c5c3_Err != nil {
2952					return templ_7745c5c3_Err
2953				}
2954				var templ_7745c5c3_Var145 string
2955				templ_7745c5c3_Var145, templ_7745c5c3_Err = templ.JoinStringErrs(plural(p.NFiles, "file", "files"))
2956				if templ_7745c5c3_Err != nil {
2957					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 563, Col: 57}
2958				}
2959				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var145))
2960				if templ_7745c5c3_Err != nil {
2961					return templ_7745c5c3_Err
2962				}
2963				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 275, " · <span class=\"plus\">+")
2964				if templ_7745c5c3_Err != nil {
2965					return templ_7745c5c3_Err
2966				}
2967				var templ_7745c5c3_Var146 string
2968				templ_7745c5c3_Var146, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Adds))
2969				if templ_7745c5c3_Err != nil {
2970					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 563, Col: 97}
2971				}
2972				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var146))
2973				if templ_7745c5c3_Err != nil {
2974					return templ_7745c5c3_Err
2975				}
2976				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 276, "</span> <span class=\"minus\">-")
2977				if templ_7745c5c3_Err != nil {
2978					return templ_7745c5c3_Err
2979				}
2980				var templ_7745c5c3_Var147 string
2981				templ_7745c5c3_Var147, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Dels))
2982				if templ_7745c5c3_Err != nil {
2983					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 563, Col: 142}
2984				}
2985				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var147))
2986				if templ_7745c5c3_Err != nil {
2987					return templ_7745c5c3_Err
2988				}
2989				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 277, "</span></span> <span class=\"grow\"></span>")
2990				if templ_7745c5c3_Err != nil {
2991					return templ_7745c5c3_Err
2992				}
2993				templ_7745c5c3_Err = diffViewMenu(p.DiffView).Render(ctx, templ_7745c5c3_Buffer)
2994				if templ_7745c5c3_Err != nil {
2995					return templ_7745c5c3_Err
2996				}
2997				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 278, "</div>")
2998				if templ_7745c5c3_Err != nil {
2999					return templ_7745c5c3_Err
3000				}
3001				if p.Invisible {
3002					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 279, "<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>")
3003					if templ_7745c5c3_Err != nil {
3004						return templ_7745c5c3_Err
3005					}
3006				}
3007				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 280, " <div id=\"diffs\"")
3008				if templ_7745c5c3_Err != nil {
3009					return templ_7745c5c3_Err
3010				}
3011				if p.Both {
3012					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 281, " data-diff=\"")
3013					if templ_7745c5c3_Err != nil {
3014						return templ_7745c5c3_Err
3015					}
3016					var templ_7745c5c3_Var148 string
3017					templ_7745c5c3_Var148, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
3018					if templ_7745c5c3_Err != nil {
3019						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 576, Col: 23}
3020					}
3021					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var148)
3022					if templ_7745c5c3_Err != nil {
3023						return templ_7745c5c3_Err
3024					}
3025					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 282, "\"")
3026					if templ_7745c5c3_Err != nil {
3027						return templ_7745c5c3_Err
3028					}
3029				} else {
3030					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 283, " data-view=\"")
3031					if templ_7745c5c3_Err != nil {
3032						return templ_7745c5c3_Err
3033					}
3034					var templ_7745c5c3_Var149 string
3035					templ_7745c5c3_Var149, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
3036					if templ_7745c5c3_Err != nil {
3037						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 578, Col: 23}
3038					}
3039					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var149)
3040					if templ_7745c5c3_Err != nil {
3041						return templ_7745c5c3_Err
3042					}
3043					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 284, "\"")
3044					if templ_7745c5c3_Err != nil {
3045						return templ_7745c5c3_Err
3046					}
3047				}
3048				if p.Both && !p.Pinned {
3049					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 285, " hx-live=\"this.dataset.diff = sessionStorage.getItem('diff') || this.dataset.diff\"")
3050					if templ_7745c5c3_Err != nil {
3051						return templ_7745c5c3_Err
3052					}
3053				}
3054				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 286, ">")
3055				if templ_7745c5c3_Err != nil {
3056					return templ_7745c5c3_Err
3057				}
3058				for _, f := range p.Files {
3059					templ_7745c5c3_Err = DiffFileView(f, p.DiffView).Render(ctx, templ_7745c5c3_Buffer)
3060					if templ_7745c5c3_Err != nil {
3061						return templ_7745c5c3_Err
3062					}
3063				}
3064				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 287, "</div>")
3065				if templ_7745c5c3_Err != nil {
3066					return templ_7745c5c3_Err
3067				}
3068			}
3069			return nil
3070		})
3071		templ_7745c5c3_Err = Shell(l, compareRail(p)).Render(templ.WithChildren(ctx, templ_7745c5c3_Var130), templ_7745c5c3_Buffer)
3072		if templ_7745c5c3_Err != nil {
3073			return templ_7745c5c3_Err
3074		}
3075		return nil
3076	})
3077}
3078
3079func compareRail(p ComparePage) templ.Component {
3080	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3081		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3082		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3083			return templ_7745c5c3_CtxErr
3084		}
3085		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3086		if !templ_7745c5c3_IsBuffer {
3087			defer func() {
3088				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3089				if templ_7745c5c3_Err == nil {
3090					templ_7745c5c3_Err = templ_7745c5c3_BufErr
3091				}
3092			}()
3093		}
3094		ctx = templ.InitializeContext(ctx)
3095		templ_7745c5c3_Var150 := templ.GetChildren(ctx)
3096		if templ_7745c5c3_Var150 == nil {
3097			templ_7745c5c3_Var150 = templ.NopComponent
3098		}
3099		ctx = templ.ClearChildren(ctx)
3100		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 288, "<section aria-labelledby=\"r-ahead\"><h2 id=\"r-ahead\">Commits <span class=\"count\">")
3101		if templ_7745c5c3_Err != nil {
3102			return templ_7745c5c3_Err
3103		}
3104		var templ_7745c5c3_Var151 string
3105		templ_7745c5c3_Var151, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Ahead)))
3106		if templ_7745c5c3_Err != nil {
3107			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 594, Col: 67}
3108		}
3109		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var151))
3110		if templ_7745c5c3_Err != nil {
3111			return templ_7745c5c3_Err
3112		}
3113		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 289, "</span></h2><ul class=\"pcommits\">")
3114		if templ_7745c5c3_Err != nil {
3115			return templ_7745c5c3_Err
3116		}
3117		for _, c := range p.Ahead {
3118			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 290, "<li><a href=\"")
3119			if templ_7745c5c3_Err != nil {
3120				return templ_7745c5c3_Err
3121			}
3122			var templ_7745c5c3_Var152 templ.SafeURL
3123			templ_7745c5c3_Var152, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.CHref))
3124			if templ_7745c5c3_Err != nil {
3125				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 598, Col: 37}
3126			}
3127			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var152))
3128			if templ_7745c5c3_Err != nil {
3129				return templ_7745c5c3_Err
3130			}
3131			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 291, "\">")
3132			if templ_7745c5c3_Err != nil {
3133				return templ_7745c5c3_Err
3134			}
3135			var templ_7745c5c3_Var153 string
3136			templ_7745c5c3_Var153, templ_7745c5c3_Err = templ.JoinStringErrs(c.Short)
3137			if templ_7745c5c3_Err != nil {
3138				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 598, Col: 49}
3139			}
3140			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var153))
3141			if templ_7745c5c3_Err != nil {
3142				return templ_7745c5c3_Err
3143			}
3144			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 292, "</a> <span class=\"s\">")
3145			if templ_7745c5c3_Err != nil {
3146				return templ_7745c5c3_Err
3147			}
3148			var templ_7745c5c3_Var154 string
3149			templ_7745c5c3_Var154, templ_7745c5c3_Err = templ.JoinStringErrs(c.Subject)
3150			if templ_7745c5c3_Err != nil {
3151				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 599, Col: 32}
3152			}
3153			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var154))
3154			if templ_7745c5c3_Err != nil {
3155				return templ_7745c5c3_Err
3156			}
3157			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 293, "</span> <span class=\"mute\">")
3158			if templ_7745c5c3_Err != nil {
3159				return templ_7745c5c3_Err
3160			}
3161			var templ_7745c5c3_Var155 string
3162			templ_7745c5c3_Var155, templ_7745c5c3_Err = templ.JoinStringErrs(c.Author)
3163			if templ_7745c5c3_Err != nil {
3164				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 601, Col: 16}
3165			}
3166			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var155))
3167			if templ_7745c5c3_Err != nil {
3168				return templ_7745c5c3_Err
3169			}
3170			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 294, " ")
3171			if templ_7745c5c3_Err != nil {
3172				return templ_7745c5c3_Err
3173			}
3174			if c.WhenAt != "" {
3175				var templ_7745c5c3_Var156 string
3176				templ_7745c5c3_Var156, templ_7745c5c3_Err = templ.JoinStringErrs(" · ")
3177				if templ_7745c5c3_Err != nil {
3178					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 603, Col: 15}
3179				}
3180				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var156))
3181				if templ_7745c5c3_Err != nil {
3182					return templ_7745c5c3_Err
3183				}
3184				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 295, "<time datetime=\"")
3185				if templ_7745c5c3_Err != nil {
3186					return templ_7745c5c3_Err
3187				}
3188				var templ_7745c5c3_Var157 string
3189				templ_7745c5c3_Var157, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.WhenAt)
3190				if templ_7745c5c3_Err != nil {
3191					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 603, Col: 42}
3192				}
3193				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var157)
3194				if templ_7745c5c3_Err != nil {
3195					return templ_7745c5c3_Err
3196				}
3197				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 296, "\">")
3198				if templ_7745c5c3_Err != nil {
3199					return templ_7745c5c3_Err
3200				}
3201				var templ_7745c5c3_Var158 string
3202				templ_7745c5c3_Var158, templ_7745c5c3_Err = templ.JoinStringErrs(c.When)
3203				if templ_7745c5c3_Err != nil {
3204					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 603, Col: 53}
3205				}
3206				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var158))
3207				if templ_7745c5c3_Err != nil {
3208					return templ_7745c5c3_Err
3209				}
3210				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 297, "</time>")
3211				if templ_7745c5c3_Err != nil {
3212					return templ_7745c5c3_Err
3213				}
3214			}
3215			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 298, "</span></li>")
3216			if templ_7745c5c3_Err != nil {
3217				return templ_7745c5c3_Err
3218			}
3219		}
3220		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 299, "</ul>")
3221		if templ_7745c5c3_Err != nil {
3222			return templ_7745c5c3_Err
3223		}
3224		if len(p.Ahead) == 0 {
3225			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 300, "<p class=\"dim\">no commit ahead of ")
3226			if templ_7745c5c3_Err != nil {
3227				return templ_7745c5c3_Err
3228			}
3229			var templ_7745c5c3_Var159 string
3230			templ_7745c5c3_Var159, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
3231			if templ_7745c5c3_Err != nil {
3232				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 610, Col: 47}
3233			}
3234			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var159))
3235			if templ_7745c5c3_Err != nil {
3236				return templ_7745c5c3_Err
3237			}
3238			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 301, ".</p>")
3239			if templ_7745c5c3_Err != nil {
3240				return templ_7745c5c3_Err
3241			}
3242		}
3243		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 302, "</section>")
3244		if templ_7745c5c3_Err != nil {
3245			return templ_7745c5c3_Err
3246		}
3247		if p.HasDiff {
3248			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 303, "<section aria-labelledby=\"r-files\"><h2 id=\"r-files\">Files <span class=\"count\">")
3249			if templ_7745c5c3_Err != nil {
3250				return templ_7745c5c3_Err
3251			}
3252			var templ_7745c5c3_Var160 string
3253			templ_7745c5c3_Var160, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Files)))
3254			if templ_7745c5c3_Err != nil {
3255				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 615, Col: 66}
3256			}
3257			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var160))
3258			if templ_7745c5c3_Err != nil {
3259				return templ_7745c5c3_Err
3260			}
3261			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 304, "</span></h2>")
3262			if templ_7745c5c3_Err != nil {
3263				return templ_7745c5c3_Err
3264			}
3265			templ_7745c5c3_Err = FileList(p.Files).Render(ctx, templ_7745c5c3_Buffer)
3266			if templ_7745c5c3_Err != nil {
3267				return templ_7745c5c3_Err
3268			}
3269			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 305, "</section>")
3270			if templ_7745c5c3_Err != nil {
3271				return templ_7745c5c3_Err
3272			}
3273		}
3274		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 306, "<section aria-labelledby=\"r-cli\"><h2 id=\"r-cli\">From a terminal</h2>")
3275		if templ_7745c5c3_Err != nil {
3276			return templ_7745c5c3_Err
3277		}
3278		templ_7745c5c3_Err = CloneBlock(p.CLI).Render(ctx, templ_7745c5c3_Buffer)
3279		if templ_7745c5c3_Err != nil {
3280			return templ_7745c5c3_Err
3281		}
3282		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 307, "</section>")
3283		if templ_7745c5c3_Err != nil {
3284			return templ_7745c5c3_Err
3285		}
3286		return nil
3287	})
3288}
3289
3290var _ = 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