detached cab7cdc

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

Keyboard shortcuts

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

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

Branches 4

Tags 45

↑↓ moveenter openesc close