v0.26.0 df1db36

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> ")
1792			if templ_7745c5c3_Err != nil {
1793				return templ_7745c5c3_Err
1794			}
1795			if c.Sig != nil {
1796				templ_7745c5c3_Err = signaturePill(c.Sig).Render(ctx, templ_7745c5c3_Buffer)
1797				if templ_7745c5c3_Err != nil {
1798					return templ_7745c5c3_Err
1799				}
1800			}
1801			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 159, "<span class=\"mute\">")
1802			if templ_7745c5c3_Err != nil {
1803				return templ_7745c5c3_Err
1804			}
1805			var templ_7745c5c3_Var90 string
1806			templ_7745c5c3_Var90, templ_7745c5c3_Err = templ.JoinStringErrs(c.Author)
1807			if templ_7745c5c3_Err != nil {
1808				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 325, Col: 16}
1809			}
1810			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var90))
1811			if templ_7745c5c3_Err != nil {
1812				return templ_7745c5c3_Err
1813			}
1814			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 160, " ")
1815			if templ_7745c5c3_Err != nil {
1816				return templ_7745c5c3_Err
1817			}
1818			if c.WhenAt != "" {
1819				var templ_7745c5c3_Var91 string
1820				templ_7745c5c3_Var91, templ_7745c5c3_Err = templ.JoinStringErrs(" · ")
1821				if templ_7745c5c3_Err != nil {
1822					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 327, Col: 15}
1823				}
1824				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var91))
1825				if templ_7745c5c3_Err != nil {
1826					return templ_7745c5c3_Err
1827				}
1828				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 161, "<time datetime=\"")
1829				if templ_7745c5c3_Err != nil {
1830					return templ_7745c5c3_Err
1831				}
1832				var templ_7745c5c3_Var92 string
1833				templ_7745c5c3_Var92, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.WhenAt)
1834				if templ_7745c5c3_Err != nil {
1835					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 327, Col: 42}
1836				}
1837				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var92)
1838				if templ_7745c5c3_Err != nil {
1839					return templ_7745c5c3_Err
1840				}
1841				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 162, "\">")
1842				if templ_7745c5c3_Err != nil {
1843					return templ_7745c5c3_Err
1844				}
1845				var templ_7745c5c3_Var93 string
1846				templ_7745c5c3_Var93, templ_7745c5c3_Err = templ.JoinStringErrs(c.When)
1847				if templ_7745c5c3_Err != nil {
1848					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 327, Col: 53}
1849				}
1850				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var93))
1851				if templ_7745c5c3_Err != nil {
1852					return templ_7745c5c3_Err
1853				}
1854				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 163, "</time> ")
1855				if templ_7745c5c3_Err != nil {
1856					return templ_7745c5c3_Err
1857				}
1858			}
1859			if c.New {
1860				var templ_7745c5c3_Var94 string
1861				templ_7745c5c3_Var94, templ_7745c5c3_Err = templ.JoinStringErrs(" · new")
1862				if templ_7745c5c3_Err != nil {
1863					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 330, Col: 18}
1864				}
1865				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var94))
1866				if templ_7745c5c3_Err != nil {
1867					return templ_7745c5c3_Err
1868				}
1869			}
1870			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 164, "</span></li>")
1871			if templ_7745c5c3_Err != nil {
1872				return templ_7745c5c3_Err
1873			}
1874		}
1875		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 165, "</ul>")
1876		if templ_7745c5c3_Err != nil {
1877			return templ_7745c5c3_Err
1878		}
1879		if len(p.Commits) == 0 {
1880			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 166, "<p class=\"dim\">no commit to merge.</p>")
1881			if templ_7745c5c3_Err != nil {
1882				return templ_7745c5c3_Err
1883			}
1884		}
1885		if p.CommitsNote != "" {
1886			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 167, "<p class=\"note\">")
1887			if templ_7745c5c3_Err != nil {
1888				return templ_7745c5c3_Err
1889			}
1890			var templ_7745c5c3_Var95 string
1891			templ_7745c5c3_Var95, templ_7745c5c3_Err = templ.JoinStringErrs(p.CommitsNote)
1892			if templ_7745c5c3_Err != nil {
1893				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 340, Col: 34}
1894			}
1895			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var95))
1896			if templ_7745c5c3_Err != nil {
1897				return templ_7745c5c3_Err
1898			}
1899			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 168, "</p>")
1900			if templ_7745c5c3_Err != nil {
1901				return templ_7745c5c3_Err
1902			}
1903		}
1904		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 169, "</section><section aria-labelledby=\"r-settings\"><h2 id=\"r-settings\">Settings</h2><dl class=\"kv\"><dt>modes</dt><dd>")
1905		if templ_7745c5c3_Err != nil {
1906			return templ_7745c5c3_Err
1907		}
1908		var templ_7745c5c3_Var96 string
1909		templ_7745c5c3_Var96, templ_7745c5c3_Err = templ.JoinStringErrs(strings.Join(p.Modes, ", "))
1910		if templ_7745c5c3_Err != nil {
1911			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 347, Col: 36}
1912		}
1913		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var96))
1914		if templ_7745c5c3_Err != nil {
1915			return templ_7745c5c3_Err
1916		}
1917		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 170, "</dd><dt>checks</dt><dd>")
1918		if templ_7745c5c3_Err != nil {
1919			return templ_7745c5c3_Err
1920		}
1921		if p.ChecksBlock {
1922			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 171, "failing ones block the merge")
1923			if templ_7745c5c3_Err != nil {
1924				return templ_7745c5c3_Err
1925			}
1926		} else {
1927			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 172, "do not block the merge")
1928			if templ_7745c5c3_Err != nil {
1929				return templ_7745c5c3_Err
1930			}
1931		}
1932		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 173, "</dd></dl></section>")
1933		if templ_7745c5c3_Err != nil {
1934			return templ_7745c5c3_Err
1935		}
1936		return nil
1937	})
1938}
1939
1940// mrBar is the bar above the diff, which follows the review: the totals, the
1941// layout of the diff, the state of the checks and, for the owner of an open
1942// request, the merge menu and the other actions. Each menu is a <details>: it
1943// works without scripts; with them, M and the keys of the menu drive it.
1944func mrBar(p MRPage) templ.Component {
1945	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1946		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1947		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1948			return templ_7745c5c3_CtxErr
1949		}
1950		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1951		if !templ_7745c5c3_IsBuffer {
1952			defer func() {
1953				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1954				if templ_7745c5c3_Err == nil {
1955					templ_7745c5c3_Err = templ_7745c5c3_BufErr
1956				}
1957			}()
1958		}
1959		ctx = templ.InitializeContext(ctx)
1960		templ_7745c5c3_Var97 := templ.GetChildren(ctx)
1961		if templ_7745c5c3_Var97 == nil {
1962			templ_7745c5c3_Var97 = templ.NopComponent
1963		}
1964		ctx = templ.ClearChildren(ctx)
1965		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 174, "<div class=\"diff-tools mr-bar\" role=\"group\" aria-label=\"Diff view and merge\"><span class=\"dim\">")
1966		if templ_7745c5c3_Err != nil {
1967			return templ_7745c5c3_Err
1968		}
1969		var templ_7745c5c3_Var98 string
1970		templ_7745c5c3_Var98, templ_7745c5c3_Err = templ.JoinStringErrs(plural(p.NFiles, "file", "files"))
1971		if templ_7745c5c3_Err != nil {
1972			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 366, Col: 55}
1973		}
1974		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var98))
1975		if templ_7745c5c3_Err != nil {
1976			return templ_7745c5c3_Err
1977		}
1978		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 175, " · <span class=\"plus\">+")
1979		if templ_7745c5c3_Err != nil {
1980			return templ_7745c5c3_Err
1981		}
1982		var templ_7745c5c3_Var99 string
1983		templ_7745c5c3_Var99, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Adds))
1984		if templ_7745c5c3_Err != nil {
1985			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 366, Col: 95}
1986		}
1987		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var99))
1988		if templ_7745c5c3_Err != nil {
1989			return templ_7745c5c3_Err
1990		}
1991		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 176, "</span> <span class=\"minus\">-")
1992		if templ_7745c5c3_Err != nil {
1993			return templ_7745c5c3_Err
1994		}
1995		var templ_7745c5c3_Var100 string
1996		templ_7745c5c3_Var100, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Dels))
1997		if templ_7745c5c3_Err != nil {
1998			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 366, Col: 140}
1999		}
2000		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var100))
2001		if templ_7745c5c3_Err != nil {
2002			return templ_7745c5c3_Err
2003		}
2004		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 177, "</span></span>")
2005		if templ_7745c5c3_Err != nil {
2006			return templ_7745c5c3_Err
2007		}
2008		templ_7745c5c3_Err = viewLink(p.DiffView, "unified", "Unified", "u", p.UnifiedHref).Render(ctx, templ_7745c5c3_Buffer)
2009		if templ_7745c5c3_Err != nil {
2010			return templ_7745c5c3_Err
2011		}
2012		templ_7745c5c3_Err = viewLink(p.DiffView, "split", "Split", "d", p.SplitHref).Render(ctx, templ_7745c5c3_Buffer)
2013		if templ_7745c5c3_Err != nil {
2014			return templ_7745c5c3_Err
2015		}
2016		templ_7745c5c3_Err = collapseButton().Render(ctx, templ_7745c5c3_Buffer)
2017		if templ_7745c5c3_Err != nil {
2018			return templ_7745c5c3_Err
2019		}
2020		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 178, "<span class=\"grow\"></span>")
2021		if templ_7745c5c3_Err != nil {
2022			return templ_7745c5c3_Err
2023		}
2024		templ_7745c5c3_Err = MRChecksSum(p.ChecksSum).Render(ctx, templ_7745c5c3_Buffer)
2025		if templ_7745c5c3_Err != nil {
2026			return templ_7745c5c3_Err
2027		}
2028		if p.Box != nil {
2029			templ_7745c5c3_Err = mergeMenu(p).Render(ctx, templ_7745c5c3_Buffer)
2030			if templ_7745c5c3_Err != nil {
2031				return templ_7745c5c3_Err
2032			}
2033			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 179, " ")
2034			if templ_7745c5c3_Err != nil {
2035				return templ_7745c5c3_Err
2036			}
2037			templ_7745c5c3_Err = moreMenu(p).Render(ctx, templ_7745c5c3_Buffer)
2038			if templ_7745c5c3_Err != nil {
2039				return templ_7745c5c3_Err
2040			}
2041		}
2042		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 180, "</div>")
2043		if templ_7745c5c3_Err != nil {
2044			return templ_7745c5c3_Err
2045		}
2046		return nil
2047	})
2048}
2049
2050// mergeMenu is the merge of an open request, for the owner: the form (it
2051// carries the head that was read), or "Ready for review" for a draft. The
2052// mode and the branch deletion have keys (1-3, D) while it is open.
2053func mergeMenu(p MRPage) templ.Component {
2054	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2055		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2056		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2057			return templ_7745c5c3_CtxErr
2058		}
2059		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2060		if !templ_7745c5c3_IsBuffer {
2061			defer func() {
2062				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2063				if templ_7745c5c3_Err == nil {
2064					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2065				}
2066			}()
2067		}
2068		ctx = templ.InitializeContext(ctx)
2069		templ_7745c5c3_Var101 := templ.GetChildren(ctx)
2070		if templ_7745c5c3_Var101 == nil {
2071			templ_7745c5c3_Var101 = templ.NopComponent
2072		}
2073		ctx = templ.ClearChildren(ctx)
2074		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 181, "<details class=\"menu mmenu\" id=\"merge-menu\" data-state=\"open\"><summary class=\"btn primary\" aria-keyshortcuts=\"Shift+M\">")
2075		if templ_7745c5c3_Err != nil {
2076			return templ_7745c5c3_Err
2077		}
2078		if p.Box.ReadyAction != "" {
2079			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 182, "Draft ")
2080			if templ_7745c5c3_Err != nil {
2081				return templ_7745c5c3_Err
2082			}
2083		} else {
2084			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 183, "Merge ")
2085			if templ_7745c5c3_Err != nil {
2086				return templ_7745c5c3_Err
2087			}
2088		}
2089		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 184, "<kbd aria-hidden=\"true\">M</kbd></summary><div class=\"menu-pop\" role=\"group\" aria-label=\"Merge\"><dl class=\"kv\"><dt>head</dt><dd>")
2090		if templ_7745c5c3_Err != nil {
2091			return templ_7745c5c3_Err
2092		}
2093		if p.Box.HeadGone {
2094			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 185, "gone: the source branch was deleted")
2095			if templ_7745c5c3_Err != nil {
2096				return templ_7745c5c3_Err
2097			}
2098		} else {
2099			var templ_7745c5c3_Var102 string
2100			templ_7745c5c3_Var102, templ_7745c5c3_Err = templ.JoinStringErrs(p.HeadShort)
2101			if templ_7745c5c3_Err != nil {
2102				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 399, Col: 19}
2103			}
2104			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var102))
2105			if templ_7745c5c3_Err != nil {
2106				return templ_7745c5c3_Err
2107			}
2108		}
2109		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 186, "</dd><dt>into</dt><dd>")
2110		if templ_7745c5c3_Err != nil {
2111			return templ_7745c5c3_Err
2112		}
2113		var templ_7745c5c3_Var103 string
2114		templ_7745c5c3_Var103, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
2115		if templ_7745c5c3_Err != nil {
2116			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 403, Col: 18}
2117		}
2118		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var103))
2119		if templ_7745c5c3_Err != nil {
2120			return templ_7745c5c3_Err
2121		}
2122		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 187, "</dd></dl>")
2123		if templ_7745c5c3_Err != nil {
2124			return templ_7745c5c3_Err
2125		}
2126		if p.Box.ReadyAction != "" {
2127			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 188, "<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=\"")
2128			if templ_7745c5c3_Err != nil {
2129				return templ_7745c5c3_Err
2130			}
2131			var templ_7745c5c3_Var104 templ.SafeURL
2132			templ_7745c5c3_Var104, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.ReadyAction))
2133			if templ_7745c5c3_Err != nil {
2134				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 407, Col: 80}
2135			}
2136			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var104))
2137			if templ_7745c5c3_Err != nil {
2138				return templ_7745c5c3_Err
2139			}
2140			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 189, "\"><button type=\"submit\" class=\"btn primary\" data-default title=\"remove the draft prefix from the title\">Ready for review</button></form>")
2141			if templ_7745c5c3_Err != nil {
2142				return templ_7745c5c3_Err
2143			}
2144		} else if !p.Box.HeadGone {
2145			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 190, "<form class=\"d-acts\" method=\"post\" action=\"")
2146			if templ_7745c5c3_Err != nil {
2147				return templ_7745c5c3_Err
2148			}
2149			var templ_7745c5c3_Var105 templ.SafeURL
2150			templ_7745c5c3_Var105, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.MergeAction))
2151			if templ_7745c5c3_Err != nil {
2152				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 411, Col: 80}
2153			}
2154			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var105))
2155			if templ_7745c5c3_Err != nil {
2156				return templ_7745c5c3_Err
2157			}
2158			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 191, "\"><input type=\"hidden\" name=\"head_id\" value=\"")
2159			if templ_7745c5c3_Err != nil {
2160				return templ_7745c5c3_Err
2161			}
2162			var templ_7745c5c3_Var106 string
2163			templ_7745c5c3_Var106, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.Head)
2164			if templ_7745c5c3_Err != nil {
2165				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 412, Col: 59}
2166			}
2167			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var106)
2168			if templ_7745c5c3_Err != nil {
2169				return templ_7745c5c3_Err
2170			}
2171			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 192, "\"><fieldset class=\"d-modes\"><legend class=\"sr\">merge mode</legend> ")
2172			if templ_7745c5c3_Err != nil {
2173				return templ_7745c5c3_Err
2174			}
2175			for i, m := range p.Box.Modes {
2176				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 193, "<label><input type=\"radio\" name=\"mode\" value=\"")
2177				if templ_7745c5c3_Err != nil {
2178					return templ_7745c5c3_Err
2179				}
2180				var templ_7745c5c3_Var107 string
2181				templ_7745c5c3_Var107, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.Value)
2182				if templ_7745c5c3_Err != nil {
2183					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 417, Col: 55}
2184				}
2185				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var107)
2186				if templ_7745c5c3_Err != nil {
2187					return templ_7745c5c3_Err
2188				}
2189				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 194, "\"")
2190				if templ_7745c5c3_Err != nil {
2191					return templ_7745c5c3_Err
2192				}
2193				if i == 0 {
2194					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 195, " checked")
2195					if templ_7745c5c3_Err != nil {
2196						return templ_7745c5c3_Err
2197					}
2198				}
2199				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 196, "> ")
2200				if templ_7745c5c3_Err != nil {
2201					return templ_7745c5c3_Err
2202				}
2203				var templ_7745c5c3_Var108 string
2204				templ_7745c5c3_Var108, templ_7745c5c3_Err = templ.JoinStringErrs(m.Label)
2205				if templ_7745c5c3_Err != nil {
2206					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 418, Col: 17}
2207				}
2208				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var108))
2209				if templ_7745c5c3_Err != nil {
2210					return templ_7745c5c3_Err
2211				}
2212				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 197, " ")
2213				if templ_7745c5c3_Err != nil {
2214					return templ_7745c5c3_Err
2215				}
2216				if i < 9 {
2217					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 198, "<kbd aria-hidden=\"true\">")
2218					if templ_7745c5c3_Err != nil {
2219						return templ_7745c5c3_Err
2220					}
2221					var templ_7745c5c3_Var109 string
2222					templ_7745c5c3_Var109, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(i + 1))
2223					if templ_7745c5c3_Err != nil {
2224						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 420, Col: 46}
2225					}
2226					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var109))
2227					if templ_7745c5c3_Err != nil {
2228						return templ_7745c5c3_Err
2229					}
2230					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 199, "</kbd>")
2231					if templ_7745c5c3_Err != nil {
2232						return templ_7745c5c3_Err
2233					}
2234				}
2235				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 200, "</label>")
2236				if templ_7745c5c3_Err != nil {
2237					return templ_7745c5c3_Err
2238				}
2239			}
2240			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 201, "</fieldset>")
2241			if templ_7745c5c3_Err != nil {
2242				return templ_7745c5c3_Err
2243			}
2244			if p.Box.CanDeleteBranch {
2245				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 202, "<label class=\"d-check\"><input type=\"checkbox\" name=\"delete_branch\" value=\"1\"> delete ")
2246				if templ_7745c5c3_Err != nil {
2247					return templ_7745c5c3_Err
2248				}
2249				var templ_7745c5c3_Var110 string
2250				templ_7745c5c3_Var110, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
2251				if templ_7745c5c3_Err != nil {
2252					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 426, Col: 102}
2253				}
2254				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var110))
2255				if templ_7745c5c3_Err != nil {
2256					return templ_7745c5c3_Err
2257				}
2258				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 203, " after the merge <kbd aria-hidden=\"true\">D</kbd></label>")
2259				if templ_7745c5c3_Err != nil {
2260					return templ_7745c5c3_Err
2261				}
2262			}
2263			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 204, "<div class=\"d-btns\"><button type=\"submit\" class=\"btn primary\" data-default>Merge into ")
2264			if templ_7745c5c3_Err != nil {
2265				return templ_7745c5c3_Err
2266			}
2267			var templ_7745c5c3_Var111 string
2268			templ_7745c5c3_Var111, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
2269			if templ_7745c5c3_Err != nil {
2270				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 429, Col: 82}
2271			}
2272			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var111))
2273			if templ_7745c5c3_Err != nil {
2274				return templ_7745c5c3_Err
2275			}
2276			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 205, "</button></div></form>")
2277			if templ_7745c5c3_Err != nil {
2278				return templ_7745c5c3_Err
2279			}
2280		}
2281		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 206, "</div></details>")
2282		if templ_7745c5c3_Err != nil {
2283			return templ_7745c5c3_Err
2284		}
2285		return nil
2286	})
2287}
2288
2289// moreMenu is what else the owner does with an open request: mark the head
2290// read, close it, merge it from a terminal.
2291func moreMenu(p MRPage) templ.Component {
2292	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2293		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2294		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2295			return templ_7745c5c3_CtxErr
2296		}
2297		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2298		if !templ_7745c5c3_IsBuffer {
2299			defer func() {
2300				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2301				if templ_7745c5c3_Err == nil {
2302					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2303				}
2304			}()
2305		}
2306		ctx = templ.InitializeContext(ctx)
2307		templ_7745c5c3_Var112 := templ.GetChildren(ctx)
2308		if templ_7745c5c3_Var112 == nil {
2309			templ_7745c5c3_Var112 = templ.NopComponent
2310		}
2311		ctx = templ.ClearChildren(ctx)
2312		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 207, "<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\">")
2313		if templ_7745c5c3_Err != nil {
2314			return templ_7745c5c3_Err
2315		}
2316		if p.Box.CanMarkRead {
2317			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 208, "<form method=\"post\" action=\"")
2318			if templ_7745c5c3_Err != nil {
2319				return templ_7745c5c3_Err
2320			}
2321			var templ_7745c5c3_Var113 templ.SafeURL
2322			templ_7745c5c3_Var113, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.ReadAction))
2323			if templ_7745c5c3_Err != nil {
2324				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 444, Col: 64}
2325			}
2326			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var113))
2327			if templ_7745c5c3_Err != nil {
2328				return templ_7745c5c3_Err
2329			}
2330			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 209, "\"><input type=\"hidden\" name=\"head_id\" value=\"")
2331			if templ_7745c5c3_Err != nil {
2332				return templ_7745c5c3_Err
2333			}
2334			var templ_7745c5c3_Var114 string
2335			templ_7745c5c3_Var114, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.Head)
2336			if templ_7745c5c3_Err != nil {
2337				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 445, Col: 59}
2338			}
2339			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var114)
2340			if templ_7745c5c3_Err != nil {
2341				return templ_7745c5c3_Err
2342			}
2343			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 210, "\"> <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>")
2344			if templ_7745c5c3_Err != nil {
2345				return templ_7745c5c3_Err
2346			}
2347		}
2348		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 211, "<form method=\"post\" action=\"")
2349		if templ_7745c5c3_Err != nil {
2350			return templ_7745c5c3_Err
2351		}
2352		var templ_7745c5c3_Var115 templ.SafeURL
2353		templ_7745c5c3_Var115, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.CloseAction))
2354		if templ_7745c5c3_Err != nil {
2355			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 449, Col: 64}
2356		}
2357		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var115))
2358		if templ_7745c5c3_Err != nil {
2359			return templ_7745c5c3_Err
2360		}
2361		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 212, "\"><button type=\"submit\" title=\"close without merging; the branch is kept\" class=\"btn danger\">Close</button></form>")
2362		if templ_7745c5c3_Err != nil {
2363			return templ_7745c5c3_Err
2364		}
2365		if !p.Box.HeadGone && p.Box.ReadyAction == "" {
2366			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 213, "<details class=\"d-or\"><summary class=\"mute\">or from a terminal</summary>")
2367			if templ_7745c5c3_Err != nil {
2368				return templ_7745c5c3_Err
2369			}
2370			templ_7745c5c3_Err = CloneBlock(p.Box.CLI).Render(ctx, templ_7745c5c3_Buffer)
2371			if templ_7745c5c3_Err != nil {
2372				return templ_7745c5c3_Err
2373			}
2374			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 214, "</details>")
2375			if templ_7745c5c3_Err != nil {
2376				return templ_7745c5c3_Err
2377			}
2378		}
2379		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 215, "</div></details>")
2380		if templ_7745c5c3_Err != nil {
2381			return templ_7745c5c3_Err
2382		}
2383		return nil
2384	})
2385}
2386
2387func Compare(l Layout, p ComparePage) templ.Component {
2388	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2389		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2390		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2391			return templ_7745c5c3_CtxErr
2392		}
2393		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2394		if !templ_7745c5c3_IsBuffer {
2395			defer func() {
2396				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2397				if templ_7745c5c3_Err == nil {
2398					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2399				}
2400			}()
2401		}
2402		ctx = templ.InitializeContext(ctx)
2403		templ_7745c5c3_Var116 := templ.GetChildren(ctx)
2404		if templ_7745c5c3_Var116 == nil {
2405			templ_7745c5c3_Var116 = templ.NopComponent
2406		}
2407		ctx = templ.ClearChildren(ctx)
2408		templ_7745c5c3_Var117 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2409			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2410			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2411			if !templ_7745c5c3_IsBuffer {
2412				defer func() {
2413					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2414					if templ_7745c5c3_Err == nil {
2415						templ_7745c5c3_Err = templ_7745c5c3_BufErr
2416					}
2417				}()
2418			}
2419			ctx = templ.InitializeContext(ctx)
2420			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 216, "<header class=\"show mr-h\"><h1>")
2421			if templ_7745c5c3_Err != nil {
2422				return templ_7745c5c3_Err
2423			}
2424			var templ_7745c5c3_Var118 string
2425			templ_7745c5c3_Var118, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
2426			if templ_7745c5c3_Err != nil {
2427				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 465, Col: 17}
2428			}
2429			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var118))
2430			if templ_7745c5c3_Err != nil {
2431				return templ_7745c5c3_Err
2432			}
2433			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 217, " → ")
2434			if templ_7745c5c3_Err != nil {
2435				return templ_7745c5c3_Err
2436			}
2437			var templ_7745c5c3_Var119 string
2438			templ_7745c5c3_Var119, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
2439			if templ_7745c5c3_Err != nil {
2440				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 465, Col: 34}
2441			}
2442			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var119))
2443			if templ_7745c5c3_Err != nil {
2444				return templ_7745c5c3_Err
2445			}
2446			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 218, "</h1><dl class=\"kv show-kv\"><dt>branch</dt><dd><a href=\"")
2447			if templ_7745c5c3_Err != nil {
2448				return templ_7745c5c3_Err
2449			}
2450			var templ_7745c5c3_Var120 templ.SafeURL
2451			templ_7745c5c3_Var120, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.SourceHref))
2452			if templ_7745c5c3_Err != nil {
2453				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 468, Col: 45}
2454			}
2455			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var120))
2456			if templ_7745c5c3_Err != nil {
2457				return templ_7745c5c3_Err
2458			}
2459			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 219, "\">")
2460			if templ_7745c5c3_Err != nil {
2461				return templ_7745c5c3_Err
2462			}
2463			var templ_7745c5c3_Var121 string
2464			templ_7745c5c3_Var121, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
2465			if templ_7745c5c3_Err != nil {
2466				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 468, Col: 58}
2467			}
2468			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var121))
2469			if templ_7745c5c3_Err != nil {
2470				return templ_7745c5c3_Err
2471			}
2472			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 220, "</a></dd><dt>target</dt><dd><a href=\"")
2473			if templ_7745c5c3_Err != nil {
2474				return templ_7745c5c3_Err
2475			}
2476			var templ_7745c5c3_Var122 templ.SafeURL
2477			templ_7745c5c3_Var122, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.TargetHref))
2478			if templ_7745c5c3_Err != nil {
2479				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 470, Col: 45}
2480			}
2481			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var122))
2482			if templ_7745c5c3_Err != nil {
2483				return templ_7745c5c3_Err
2484			}
2485			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 221, "\">")
2486			if templ_7745c5c3_Err != nil {
2487				return templ_7745c5c3_Err
2488			}
2489			var templ_7745c5c3_Var123 string
2490			templ_7745c5c3_Var123, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
2491			if templ_7745c5c3_Err != nil {
2492				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 470, Col: 58}
2493			}
2494			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var123))
2495			if templ_7745c5c3_Err != nil {
2496				return templ_7745c5c3_Err
2497			}
2498			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 222, "</a></dd><dt>ahead</dt><dd>")
2499			if templ_7745c5c3_Err != nil {
2500				return templ_7745c5c3_Err
2501			}
2502			var templ_7745c5c3_Var124 string
2503			templ_7745c5c3_Var124, templ_7745c5c3_Err = templ.JoinStringErrs(p.AheadText)
2504			if templ_7745c5c3_Err != nil {
2505				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 472, Col: 21}
2506			}
2507			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var124))
2508			if templ_7745c5c3_Err != nil {
2509				return templ_7745c5c3_Err
2510			}
2511			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 223, "</dd></dl></header>")
2512			if templ_7745c5c3_Err != nil {
2513				return templ_7745c5c3_Err
2514			}
2515			if p.Note != "" {
2516				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 224, "<p class=\"notice\">")
2517				if templ_7745c5c3_Err != nil {
2518					return templ_7745c5c3_Err
2519				}
2520				var templ_7745c5c3_Var125 string
2521				templ_7745c5c3_Var125, templ_7745c5c3_Err = templ.JoinStringErrs(p.Note)
2522				if templ_7745c5c3_Err != nil {
2523					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 476, Col: 29}
2524				}
2525				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var125))
2526				if templ_7745c5c3_Err != nil {
2527					return templ_7745c5c3_Err
2528				}
2529				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 225, "</p>")
2530				if templ_7745c5c3_Err != nil {
2531					return templ_7745c5c3_Err
2532				}
2533			}
2534			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 226, " ")
2535			if templ_7745c5c3_Err != nil {
2536				return templ_7745c5c3_Err
2537			}
2538			if p.Existing != nil {
2539				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 227, "<p class=\"notice\">an open merge request already covers these branches: <a href=\"")
2540				if templ_7745c5c3_Err != nil {
2541					return templ_7745c5c3_Err
2542				}
2543				var templ_7745c5c3_Var126 templ.SafeURL
2544				templ_7745c5c3_Var126, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Existing.Href))
2545				if templ_7745c5c3_Err != nil {
2546					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 479, Col: 114}
2547				}
2548				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var126))
2549				if templ_7745c5c3_Err != nil {
2550					return templ_7745c5c3_Err
2551				}
2552				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 228, "\">")
2553				if templ_7745c5c3_Err != nil {
2554					return templ_7745c5c3_Err
2555				}
2556				var templ_7745c5c3_Var127 string
2557				templ_7745c5c3_Var127, templ_7745c5c3_Err = templ.JoinStringErrs(p.Existing.Label)
2558				if templ_7745c5c3_Err != nil {
2559					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 479, Col: 135}
2560				}
2561				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var127))
2562				if templ_7745c5c3_Err != nil {
2563					return templ_7745c5c3_Err
2564				}
2565				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 229, "</a></p>")
2566				if templ_7745c5c3_Err != nil {
2567					return templ_7745c5c3_Err
2568				}
2569			}
2570			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 230, " ")
2571			if templ_7745c5c3_Err != nil {
2572				return templ_7745c5c3_Err
2573			}
2574			if p.Create != nil {
2575				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 231, "<form class=\"cform create\" method=\"post\" action=\"")
2576				if templ_7745c5c3_Err != nil {
2577					return templ_7745c5c3_Err
2578				}
2579				var templ_7745c5c3_Var128 templ.SafeURL
2580				templ_7745c5c3_Var128, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Create.Action))
2581				if templ_7745c5c3_Err != nil {
2582					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 482, Col: 83}
2583				}
2584				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var128))
2585				if templ_7745c5c3_Err != nil {
2586					return templ_7745c5c3_Err
2587				}
2588				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 232, "\"><input type=\"hidden\" name=\"source\" value=\"")
2589				if templ_7745c5c3_Err != nil {
2590					return templ_7745c5c3_Err
2591				}
2592				var templ_7745c5c3_Var129 string
2593				templ_7745c5c3_Var129, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Source)
2594				if templ_7745c5c3_Err != nil {
2595					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 483, Col: 62}
2596				}
2597				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var129)
2598				if templ_7745c5c3_Err != nil {
2599					return templ_7745c5c3_Err
2600				}
2601				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 233, "\"> <input type=\"hidden\" name=\"target\" value=\"")
2602				if templ_7745c5c3_Err != nil {
2603					return templ_7745c5c3_Err
2604				}
2605				var templ_7745c5c3_Var130 string
2606				templ_7745c5c3_Var130, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Target)
2607				if templ_7745c5c3_Err != nil {
2608					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 484, Col: 62}
2609				}
2610				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var130)
2611				if templ_7745c5c3_Err != nil {
2612					return templ_7745c5c3_Err
2613				}
2614				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 234, "\"> <label for=\"mr-title\">title</label> <input id=\"mr-title\" name=\"title\" type=\"text\" maxlength=\"120\" required value=\"")
2615				if templ_7745c5c3_Err != nil {
2616					return templ_7745c5c3_Err
2617				}
2618				var templ_7745c5c3_Var131 string
2619				templ_7745c5c3_Var131, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Title)
2620				if templ_7745c5c3_Err != nil {
2621					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 486, Col: 97}
2622				}
2623				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var131)
2624				if templ_7745c5c3_Err != nil {
2625					return templ_7745c5c3_Err
2626				}
2627				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 235, "\" 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>")
2628				if templ_7745c5c3_Err != nil {
2629					return templ_7745c5c3_Err
2630				}
2631			}
2632			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 236, " ")
2633			if templ_7745c5c3_Err != nil {
2634				return templ_7745c5c3_Err
2635			}
2636			if p.HasDiff {
2637				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 237, "<div class=\"diff-tools\" role=\"group\" aria-label=\"Diff view\"><span class=\"dim\">")
2638				if templ_7745c5c3_Err != nil {
2639					return templ_7745c5c3_Err
2640				}
2641				var templ_7745c5c3_Var132 string
2642				templ_7745c5c3_Var132, templ_7745c5c3_Err = templ.JoinStringErrs(plural(p.NFiles, "file", "files"))
2643				if templ_7745c5c3_Err != nil {
2644					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 496, Col: 57}
2645				}
2646				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var132))
2647				if templ_7745c5c3_Err != nil {
2648					return templ_7745c5c3_Err
2649				}
2650				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 238, " · <span class=\"plus\">+")
2651				if templ_7745c5c3_Err != nil {
2652					return templ_7745c5c3_Err
2653				}
2654				var templ_7745c5c3_Var133 string
2655				templ_7745c5c3_Var133, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Adds))
2656				if templ_7745c5c3_Err != nil {
2657					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 496, Col: 97}
2658				}
2659				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var133))
2660				if templ_7745c5c3_Err != nil {
2661					return templ_7745c5c3_Err
2662				}
2663				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 239, "</span> <span class=\"minus\">-")
2664				if templ_7745c5c3_Err != nil {
2665					return templ_7745c5c3_Err
2666				}
2667				var templ_7745c5c3_Var134 string
2668				templ_7745c5c3_Var134, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Dels))
2669				if templ_7745c5c3_Err != nil {
2670					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 496, Col: 142}
2671				}
2672				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var134))
2673				if templ_7745c5c3_Err != nil {
2674					return templ_7745c5c3_Err
2675				}
2676				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 240, "</span></span> <span class=\"grow\"></span>")
2677				if templ_7745c5c3_Err != nil {
2678					return templ_7745c5c3_Err
2679				}
2680				templ_7745c5c3_Err = viewLink(p.DiffView, "unified", "Unified", "u", p.UnifiedHref).Render(ctx, templ_7745c5c3_Buffer)
2681				if templ_7745c5c3_Err != nil {
2682					return templ_7745c5c3_Err
2683				}
2684				templ_7745c5c3_Err = viewLink(p.DiffView, "split", "Split", "d", p.SplitHref).Render(ctx, templ_7745c5c3_Buffer)
2685				if templ_7745c5c3_Err != nil {
2686					return templ_7745c5c3_Err
2687				}
2688				templ_7745c5c3_Err = collapseButton().Render(ctx, templ_7745c5c3_Buffer)
2689				if templ_7745c5c3_Err != nil {
2690					return templ_7745c5c3_Err
2691				}
2692				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 241, "</div>")
2693				if templ_7745c5c3_Err != nil {
2694					return templ_7745c5c3_Err
2695				}
2696				if p.Invisible {
2697					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 242, "<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>")
2698					if templ_7745c5c3_Err != nil {
2699						return templ_7745c5c3_Err
2700					}
2701				}
2702				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 243, " <div id=\"diffs\"")
2703				if templ_7745c5c3_Err != nil {
2704					return templ_7745c5c3_Err
2705				}
2706				if p.Both {
2707					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 244, " data-diff=\"")
2708					if templ_7745c5c3_Err != nil {
2709						return templ_7745c5c3_Err
2710					}
2711					var templ_7745c5c3_Var135 string
2712					templ_7745c5c3_Var135, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
2713					if templ_7745c5c3_Err != nil {
2714						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 511, Col: 23}
2715					}
2716					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var135)
2717					if templ_7745c5c3_Err != nil {
2718						return templ_7745c5c3_Err
2719					}
2720					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 245, "\"")
2721					if templ_7745c5c3_Err != nil {
2722						return templ_7745c5c3_Err
2723					}
2724				} else {
2725					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 246, " data-view=\"")
2726					if templ_7745c5c3_Err != nil {
2727						return templ_7745c5c3_Err
2728					}
2729					var templ_7745c5c3_Var136 string
2730					templ_7745c5c3_Var136, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
2731					if templ_7745c5c3_Err != nil {
2732						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 513, Col: 23}
2733					}
2734					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var136)
2735					if templ_7745c5c3_Err != nil {
2736						return templ_7745c5c3_Err
2737					}
2738					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 247, "\"")
2739					if templ_7745c5c3_Err != nil {
2740						return templ_7745c5c3_Err
2741					}
2742				}
2743				if p.Both && !p.Pinned {
2744					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 248, " hx-live=\"this.dataset.diff = sessionStorage.getItem('diff') || this.dataset.diff\"")
2745					if templ_7745c5c3_Err != nil {
2746						return templ_7745c5c3_Err
2747					}
2748				}
2749				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 249, ">")
2750				if templ_7745c5c3_Err != nil {
2751					return templ_7745c5c3_Err
2752				}
2753				for _, f := range p.Files {
2754					templ_7745c5c3_Err = DiffFileView(f, p.DiffView).Render(ctx, templ_7745c5c3_Buffer)
2755					if templ_7745c5c3_Err != nil {
2756						return templ_7745c5c3_Err
2757					}
2758				}
2759				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 250, "</div>")
2760				if templ_7745c5c3_Err != nil {
2761					return templ_7745c5c3_Err
2762				}
2763			}
2764			return nil
2765		})
2766		templ_7745c5c3_Err = Shell(l, compareRail(p)).Render(templ.WithChildren(ctx, templ_7745c5c3_Var117), templ_7745c5c3_Buffer)
2767		if templ_7745c5c3_Err != nil {
2768			return templ_7745c5c3_Err
2769		}
2770		return nil
2771	})
2772}
2773
2774func compareRail(p ComparePage) templ.Component {
2775	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2776		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2777		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2778			return templ_7745c5c3_CtxErr
2779		}
2780		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2781		if !templ_7745c5c3_IsBuffer {
2782			defer func() {
2783				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2784				if templ_7745c5c3_Err == nil {
2785					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2786				}
2787			}()
2788		}
2789		ctx = templ.InitializeContext(ctx)
2790		templ_7745c5c3_Var137 := templ.GetChildren(ctx)
2791		if templ_7745c5c3_Var137 == nil {
2792			templ_7745c5c3_Var137 = templ.NopComponent
2793		}
2794		ctx = templ.ClearChildren(ctx)
2795		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 251, "<section aria-labelledby=\"r-ahead\"><h2 id=\"r-ahead\">Commits <span class=\"count\">")
2796		if templ_7745c5c3_Err != nil {
2797			return templ_7745c5c3_Err
2798		}
2799		var templ_7745c5c3_Var138 string
2800		templ_7745c5c3_Var138, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Ahead)))
2801		if templ_7745c5c3_Err != nil {
2802			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 529, Col: 67}
2803		}
2804		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var138))
2805		if templ_7745c5c3_Err != nil {
2806			return templ_7745c5c3_Err
2807		}
2808		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 252, "</span></h2><ul class=\"pcommits\">")
2809		if templ_7745c5c3_Err != nil {
2810			return templ_7745c5c3_Err
2811		}
2812		for _, c := range p.Ahead {
2813			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 253, "<li><a href=\"")
2814			if templ_7745c5c3_Err != nil {
2815				return templ_7745c5c3_Err
2816			}
2817			var templ_7745c5c3_Var139 templ.SafeURL
2818			templ_7745c5c3_Var139, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.CHref))
2819			if templ_7745c5c3_Err != nil {
2820				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 533, Col: 37}
2821			}
2822			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var139))
2823			if templ_7745c5c3_Err != nil {
2824				return templ_7745c5c3_Err
2825			}
2826			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 254, "\">")
2827			if templ_7745c5c3_Err != nil {
2828				return templ_7745c5c3_Err
2829			}
2830			var templ_7745c5c3_Var140 string
2831			templ_7745c5c3_Var140, templ_7745c5c3_Err = templ.JoinStringErrs(c.Short)
2832			if templ_7745c5c3_Err != nil {
2833				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 533, Col: 49}
2834			}
2835			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var140))
2836			if templ_7745c5c3_Err != nil {
2837				return templ_7745c5c3_Err
2838			}
2839			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 255, "</a> <span class=\"s\">")
2840			if templ_7745c5c3_Err != nil {
2841				return templ_7745c5c3_Err
2842			}
2843			var templ_7745c5c3_Var141 string
2844			templ_7745c5c3_Var141, templ_7745c5c3_Err = templ.JoinStringErrs(c.Subject)
2845			if templ_7745c5c3_Err != nil {
2846				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 534, Col: 32}
2847			}
2848			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var141))
2849			if templ_7745c5c3_Err != nil {
2850				return templ_7745c5c3_Err
2851			}
2852			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 256, "</span> <span class=\"mute\">")
2853			if templ_7745c5c3_Err != nil {
2854				return templ_7745c5c3_Err
2855			}
2856			var templ_7745c5c3_Var142 string
2857			templ_7745c5c3_Var142, templ_7745c5c3_Err = templ.JoinStringErrs(c.Author)
2858			if templ_7745c5c3_Err != nil {
2859				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 536, Col: 16}
2860			}
2861			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var142))
2862			if templ_7745c5c3_Err != nil {
2863				return templ_7745c5c3_Err
2864			}
2865			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 257, " ")
2866			if templ_7745c5c3_Err != nil {
2867				return templ_7745c5c3_Err
2868			}
2869			if c.WhenAt != "" {
2870				var templ_7745c5c3_Var143 string
2871				templ_7745c5c3_Var143, templ_7745c5c3_Err = templ.JoinStringErrs(" · ")
2872				if templ_7745c5c3_Err != nil {
2873					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 538, Col: 15}
2874				}
2875				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var143))
2876				if templ_7745c5c3_Err != nil {
2877					return templ_7745c5c3_Err
2878				}
2879				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 258, "<time datetime=\"")
2880				if templ_7745c5c3_Err != nil {
2881					return templ_7745c5c3_Err
2882				}
2883				var templ_7745c5c3_Var144 string
2884				templ_7745c5c3_Var144, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.WhenAt)
2885				if templ_7745c5c3_Err != nil {
2886					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 538, Col: 42}
2887				}
2888				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var144)
2889				if templ_7745c5c3_Err != nil {
2890					return templ_7745c5c3_Err
2891				}
2892				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 259, "\">")
2893				if templ_7745c5c3_Err != nil {
2894					return templ_7745c5c3_Err
2895				}
2896				var templ_7745c5c3_Var145 string
2897				templ_7745c5c3_Var145, templ_7745c5c3_Err = templ.JoinStringErrs(c.When)
2898				if templ_7745c5c3_Err != nil {
2899					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 538, Col: 53}
2900				}
2901				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var145))
2902				if templ_7745c5c3_Err != nil {
2903					return templ_7745c5c3_Err
2904				}
2905				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 260, "</time>")
2906				if templ_7745c5c3_Err != nil {
2907					return templ_7745c5c3_Err
2908				}
2909			}
2910			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 261, "</span></li>")
2911			if templ_7745c5c3_Err != nil {
2912				return templ_7745c5c3_Err
2913			}
2914		}
2915		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 262, "</ul>")
2916		if templ_7745c5c3_Err != nil {
2917			return templ_7745c5c3_Err
2918		}
2919		if len(p.Ahead) == 0 {
2920			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 263, "<p class=\"dim\">no commit ahead of ")
2921			if templ_7745c5c3_Err != nil {
2922				return templ_7745c5c3_Err
2923			}
2924			var templ_7745c5c3_Var146 string
2925			templ_7745c5c3_Var146, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
2926			if templ_7745c5c3_Err != nil {
2927				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 545, Col: 47}
2928			}
2929			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var146))
2930			if templ_7745c5c3_Err != nil {
2931				return templ_7745c5c3_Err
2932			}
2933			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 264, ".</p>")
2934			if templ_7745c5c3_Err != nil {
2935				return templ_7745c5c3_Err
2936			}
2937		}
2938		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 265, "</section>")
2939		if templ_7745c5c3_Err != nil {
2940			return templ_7745c5c3_Err
2941		}
2942		if p.HasDiff {
2943			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 266, "<section aria-labelledby=\"r-files\"><h2 id=\"r-files\">Files <span class=\"count\">")
2944			if templ_7745c5c3_Err != nil {
2945				return templ_7745c5c3_Err
2946			}
2947			var templ_7745c5c3_Var147 string
2948			templ_7745c5c3_Var147, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Files)))
2949			if templ_7745c5c3_Err != nil {
2950				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 550, Col: 66}
2951			}
2952			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var147))
2953			if templ_7745c5c3_Err != nil {
2954				return templ_7745c5c3_Err
2955			}
2956			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 267, "</span></h2>")
2957			if templ_7745c5c3_Err != nil {
2958				return templ_7745c5c3_Err
2959			}
2960			templ_7745c5c3_Err = FileList(p.Files).Render(ctx, templ_7745c5c3_Buffer)
2961			if templ_7745c5c3_Err != nil {
2962				return templ_7745c5c3_Err
2963			}
2964			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 268, "</section>")
2965			if templ_7745c5c3_Err != nil {
2966				return templ_7745c5c3_Err
2967			}
2968		}
2969		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 269, "<section aria-labelledby=\"r-cli\"><h2 id=\"r-cli\">From a terminal</h2>")
2970		if templ_7745c5c3_Err != nil {
2971			return templ_7745c5c3_Err
2972		}
2973		templ_7745c5c3_Err = CloneBlock(p.CLI).Render(ctx, templ_7745c5c3_Buffer)
2974		if templ_7745c5c3_Err != nil {
2975			return templ_7745c5c3_Err
2976		}
2977		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 270, "</section>")
2978		if templ_7745c5c3_Err != nil {
2979			return templ_7745c5c3_Err
2980		}
2981		return nil
2982	})
2983}
2984
2985var _ = 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