v0.24.0 166837a

mr_templ.go RawHistoryFolder

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

Tags 45

↑↓ moveenter openesc close