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\"><U+XXXX></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\"><nav data-mr-tabs aria-label=\"Branch details\"><a id=\"mr-tab-commits\" href=\"#mr-commits\">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: 88}
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></a> <a id=\"mr-tab-checks\" href=\"#mr-checks\">")
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("Checks ")
2055 if templ_7745c5c3_Err != nil {
2056 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 384, Col: 15}
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 data-checks-label>")
2063 if templ_7745c5c3_Err != nil {
2064 return templ_7745c5c3_Err
2065 }
2066 if p.ChecksSum.Total > 0 {
2067 var templ_7745c5c3_Var100 string
2068 templ_7745c5c3_Var100, templ_7745c5c3_Err = templ.JoinStringErrs(p.ChecksSum.Title)
2069 if templ_7745c5c3_Err != nil {
2070 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 387, Col: 25}
2071 }
2072 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var100))
2073 if templ_7745c5c3_Err != nil {
2074 return templ_7745c5c3_Err
2075 }
2076 } else {
2077 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 190, "no checks")
2078 if templ_7745c5c3_Err != nil {
2079 return templ_7745c5c3_Err
2080 }
2081 }
2082 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 191, "</span></a></nav><div id=\"mr-commits\" data-mr-panel role=\"region\" 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>")
2083 if templ_7745c5c3_Err != nil {
2084 return templ_7745c5c3_Err
2085 }
2086 for _, c := range p.Commits {
2087 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 192, "<tr")
2088 if templ_7745c5c3_Err != nil {
2089 return templ_7745c5c3_Err
2090 }
2091 if c.New {
2092 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 193, " data-new")
2093 if templ_7745c5c3_Err != nil {
2094 return templ_7745c5c3_Err
2095 }
2096 }
2097 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 194, "><td><a href=\"")
2098 if templ_7745c5c3_Err != nil {
2099 return templ_7745c5c3_Err
2100 }
2101 var templ_7745c5c3_Var101 templ.SafeURL
2102 templ_7745c5c3_Var101, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Href))
2103 if templ_7745c5c3_Err != nil {
2104 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 400, Col: 42}
2105 }
2106 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var101))
2107 if templ_7745c5c3_Err != nil {
2108 return templ_7745c5c3_Err
2109 }
2110 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 195, "\">")
2111 if templ_7745c5c3_Err != nil {
2112 return templ_7745c5c3_Err
2113 }
2114 var templ_7745c5c3_Var102 string
2115 templ_7745c5c3_Var102, templ_7745c5c3_Err = templ.JoinStringErrs(c.Short)
2116 if templ_7745c5c3_Err != nil {
2117 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 400, Col: 54}
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, "</a></td><td>")
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.Subject)
2129 if templ_7745c5c3_Err != nil {
2130 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 401, Col: 22}
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, "</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.Author)
2142 if templ_7745c5c3_Err != nil {
2143 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 402, Col: 21}
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 if c.WhenAt != "" {
2154 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 199, "<time datetime=\"")
2155 if templ_7745c5c3_Err != nil {
2156 return templ_7745c5c3_Err
2157 }
2158 var templ_7745c5c3_Var105 string
2159 templ_7745c5c3_Var105, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.WhenAt)
2160 if templ_7745c5c3_Err != nil {
2161 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 405, Col: 34}
2162 }
2163 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var105)
2164 if templ_7745c5c3_Err != nil {
2165 return templ_7745c5c3_Err
2166 }
2167 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 200, "\">")
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.JoinStringErrs(c.When)
2173 if templ_7745c5c3_Err != nil {
2174 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 405, Col: 45}
2175 }
2176 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(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, "</time>")
2181 if templ_7745c5c3_Err != nil {
2182 return templ_7745c5c3_Err
2183 }
2184 }
2185 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 202, "</td><td>")
2186 if templ_7745c5c3_Err != nil {
2187 return templ_7745c5c3_Err
2188 }
2189 if c.Sig != nil {
2190 templ_7745c5c3_Err = signaturePill(c.Sig).Render(ctx, templ_7745c5c3_Buffer)
2191 if templ_7745c5c3_Err != nil {
2192 return templ_7745c5c3_Err
2193 }
2194 }
2195 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 203, "</td><td>")
2196 if templ_7745c5c3_Err != nil {
2197 return templ_7745c5c3_Err
2198 }
2199 if c.New {
2200 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 204, "<span>new</span>")
2201 if templ_7745c5c3_Err != nil {
2202 return templ_7745c5c3_Err
2203 }
2204 }
2205 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 205, "</td></tr>")
2206 if templ_7745c5c3_Err != nil {
2207 return templ_7745c5c3_Err
2208 }
2209 }
2210 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 206, "</tbody></table>")
2211 if templ_7745c5c3_Err != nil {
2212 return templ_7745c5c3_Err
2213 }
2214 if len(p.Commits) == 0 {
2215 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 207, "<p class=\"dim\">no commit to merge.</p>")
2216 if templ_7745c5c3_Err != nil {
2217 return templ_7745c5c3_Err
2218 }
2219 }
2220 if p.CommitsNote != "" {
2221 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 208, "<p class=\"note\">")
2222 if templ_7745c5c3_Err != nil {
2223 return templ_7745c5c3_Err
2224 }
2225 var templ_7745c5c3_Var107 string
2226 templ_7745c5c3_Var107, templ_7745c5c3_Err = templ.JoinStringErrs(p.CommitsNote)
2227 if templ_7745c5c3_Err != nil {
2228 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 426, Col: 35}
2229 }
2230 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var107))
2231 if templ_7745c5c3_Err != nil {
2232 return templ_7745c5c3_Err
2233 }
2234 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 209, "</p>")
2235 if templ_7745c5c3_Err != nil {
2236 return templ_7745c5c3_Err
2237 }
2238 }
2239 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 210, "</div><div id=\"mr-checks-panel\" data-mr-panel role=\"region\" aria-labelledby=\"mr-tab-checks\">")
2240 if templ_7745c5c3_Err != nil {
2241 return templ_7745c5c3_Err
2242 }
2243 templ_7745c5c3_Err = MRChecks(p.Checks).Render(ctx, templ_7745c5c3_Buffer)
2244 if templ_7745c5c3_Err != nil {
2245 return templ_7745c5c3_Err
2246 }
2247 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 211, "</div></footer>")
2248 if templ_7745c5c3_Err != nil {
2249 return templ_7745c5c3_Err
2250 }
2251 return nil
2252 })
2253}
2254
2255func mrRail(p MRPage) templ.Component {
2256 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2257 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2258 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2259 return templ_7745c5c3_CtxErr
2260 }
2261 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2262 if !templ_7745c5c3_IsBuffer {
2263 defer func() {
2264 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2265 if templ_7745c5c3_Err == nil {
2266 templ_7745c5c3_Err = templ_7745c5c3_BufErr
2267 }
2268 }()
2269 }
2270 ctx = templ.InitializeContext(ctx)
2271 templ_7745c5c3_Var108 := templ.GetChildren(ctx)
2272 if templ_7745c5c3_Var108 == nil {
2273 templ_7745c5c3_Var108 = templ.NopComponent
2274 }
2275 ctx = templ.ClearChildren(ctx)
2276 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 212, "<section aria-labelledby=\"r-files\" class=\"r-files\"><h2 id=\"r-files\">Files <span class=\"count\">")
2277 if templ_7745c5c3_Err != nil {
2278 return templ_7745c5c3_Err
2279 }
2280 var templ_7745c5c3_Var109 string
2281 templ_7745c5c3_Var109, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Files)))
2282 if templ_7745c5c3_Err != nil {
2283 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 438, Col: 49}
2284 }
2285 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var109))
2286 if templ_7745c5c3_Err != nil {
2287 return templ_7745c5c3_Err
2288 }
2289 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 213, "</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>")
2290 if templ_7745c5c3_Err != nil {
2291 return templ_7745c5c3_Err
2292 }
2293 templ_7745c5c3_Err = FileList(p.Files).Render(ctx, templ_7745c5c3_Buffer)
2294 if templ_7745c5c3_Err != nil {
2295 return templ_7745c5c3_Err
2296 }
2297 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 214, "</section>")
2298 if templ_7745c5c3_Err != nil {
2299 return templ_7745c5c3_Err
2300 }
2301 if len(p.Verdicts) > 0 {
2302 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 215, "<section><h2>Verdicts</h2><ul>")
2303 if templ_7745c5c3_Err != nil {
2304 return templ_7745c5c3_Err
2305 }
2306 for _, v := range p.Verdicts {
2307 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 216, "<li><a href=\"")
2308 if templ_7745c5c3_Err != nil {
2309 return templ_7745c5c3_Err
2310 }
2311 var templ_7745c5c3_Var110 templ.SafeURL
2312 templ_7745c5c3_Var110, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(v.Href))
2313 if templ_7745c5c3_Err != nil {
2314 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 451, Col: 37}
2315 }
2316 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var110))
2317 if templ_7745c5c3_Err != nil {
2318 return templ_7745c5c3_Err
2319 }
2320 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 217, "\">")
2321 if templ_7745c5c3_Err != nil {
2322 return templ_7745c5c3_Err
2323 }
2324 var templ_7745c5c3_Var111 string
2325 templ_7745c5c3_Var111, templ_7745c5c3_Err = templ.JoinStringErrs(v.Author)
2326 if templ_7745c5c3_Err != nil {
2327 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 451, Col: 50}
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.Label)
2339 if templ_7745c5c3_Err != nil {
2340 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 451, Col: 63}
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, "</a> ")
2347 if templ_7745c5c3_Err != nil {
2348 return templ_7745c5c3_Err
2349 }
2350 if v.Stale {
2351 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 220, "<span class=\"mute\">(stale)</span>")
2352 if templ_7745c5c3_Err != nil {
2353 return templ_7745c5c3_Err
2354 }
2355 }
2356 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 221, "</li>")
2357 if templ_7745c5c3_Err != nil {
2358 return templ_7745c5c3_Err
2359 }
2360 }
2361 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 222, "</ul></section>")
2362 if templ_7745c5c3_Err != nil {
2363 return templ_7745c5c3_Err
2364 }
2365 }
2366 return nil
2367 })
2368}
2369
2370// mrBar is the bar above the diff, which follows the review: the totals, the
2371// layout of the diff, the state of the checks and, for the owner of an open
2372// request, the merge menu and the other actions. Each menu is a <details>: it
2373// works without scripts; with them, M and the keys of the menu drive it.
2374func mrBar(p MRPage) templ.Component {
2375 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2376 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2377 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2378 return templ_7745c5c3_CtxErr
2379 }
2380 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2381 if !templ_7745c5c3_IsBuffer {
2382 defer func() {
2383 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2384 if templ_7745c5c3_Err == nil {
2385 templ_7745c5c3_Err = templ_7745c5c3_BufErr
2386 }
2387 }()
2388 }
2389 ctx = templ.InitializeContext(ctx)
2390 templ_7745c5c3_Var113 := templ.GetChildren(ctx)
2391 if templ_7745c5c3_Var113 == nil {
2392 templ_7745c5c3_Var113 = templ.NopComponent
2393 }
2394 ctx = templ.ClearChildren(ctx)
2395 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 223, "<div class=\"diff-tools mr-bar\" role=\"group\" aria-label=\"Diff view and merge\"><span class=\"dim\">")
2396 if templ_7745c5c3_Err != nil {
2397 return templ_7745c5c3_Err
2398 }
2399 var templ_7745c5c3_Var114 string
2400 templ_7745c5c3_Var114, templ_7745c5c3_Err = templ.JoinStringErrs(plural(p.NFiles, "file", "files"))
2401 if templ_7745c5c3_Err != nil {
2402 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 468, Col: 55}
2403 }
2404 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var114))
2405 if templ_7745c5c3_Err != nil {
2406 return templ_7745c5c3_Err
2407 }
2408 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 224, " · <span class=\"plus\">+")
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(itoa(p.Adds))
2414 if templ_7745c5c3_Err != nil {
2415 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 468, Col: 95}
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> <span class=\"minus\">-")
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.Dels))
2427 if templ_7745c5c3_Err != nil {
2428 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 468, Col: 140}
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>")
2435 if templ_7745c5c3_Err != nil {
2436 return templ_7745c5c3_Err
2437 }
2438 templ_7745c5c3_Err = diffViewMenu(p.DiffView).Render(ctx, templ_7745c5c3_Buffer)
2439 if templ_7745c5c3_Err != nil {
2440 return templ_7745c5c3_Err
2441 }
2442 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 227, "<span class=\"grow\"></span>")
2443 if templ_7745c5c3_Err != nil {
2444 return templ_7745c5c3_Err
2445 }
2446 templ_7745c5c3_Err = MRChecksSum(p.ChecksSum).Render(ctx, templ_7745c5c3_Buffer)
2447 if templ_7745c5c3_Err != nil {
2448 return templ_7745c5c3_Err
2449 }
2450 if p.Box != nil {
2451 templ_7745c5c3_Err = mergeMenu(p).Render(ctx, templ_7745c5c3_Buffer)
2452 if templ_7745c5c3_Err != nil {
2453 return templ_7745c5c3_Err
2454 }
2455 }
2456 templ_7745c5c3_Err = moreMenu(p).Render(ctx, templ_7745c5c3_Buffer)
2457 if templ_7745c5c3_Err != nil {
2458 return templ_7745c5c3_Err
2459 }
2460 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 228, "</div>")
2461 if templ_7745c5c3_Err != nil {
2462 return templ_7745c5c3_Err
2463 }
2464 return nil
2465 })
2466}
2467
2468// mergeMenu is the merge of an open request, for the owner: the form (it
2469// carries the head that was read), or "Ready for review" for a draft. The
2470// mode and the branch deletion have keys (1-3, D) while it is open.
2471//
2472// The badge is a live slot (mr-mergeability); the modes and the button read
2473// its data-* attributes (hx-live bindings), so that they follow the slot when
2474// the stream replaces its content. The server renders the same state in the
2475// attributes, for a page without scripts.
2476func mergeMenu(p MRPage) templ.Component {
2477 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2478 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2479 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2480 return templ_7745c5c3_CtxErr
2481 }
2482 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2483 if !templ_7745c5c3_IsBuffer {
2484 defer func() {
2485 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2486 if templ_7745c5c3_Err == nil {
2487 templ_7745c5c3_Err = templ_7745c5c3_BufErr
2488 }
2489 }()
2490 }
2491 ctx = templ.InitializeContext(ctx)
2492 templ_7745c5c3_Var117 := templ.GetChildren(ctx)
2493 if templ_7745c5c3_Var117 == nil {
2494 templ_7745c5c3_Var117 = templ.NopComponent
2495 }
2496 ctx = templ.ClearChildren(ctx)
2497 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 229, "<details class=\"menu mmenu\" id=\"merge-menu\" data-state=\"open\"")
2498 if templ_7745c5c3_Err != nil {
2499 return templ_7745c5c3_Err
2500 }
2501 if p.Box.Error != "" {
2502 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 230, " open")
2503 if templ_7745c5c3_Err != nil {
2504 return templ_7745c5c3_Err
2505 }
2506 }
2507 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 231, "><summary class=\"btn primary\" aria-keyshortcuts=\"Shift+M\">")
2508 if templ_7745c5c3_Err != nil {
2509 return templ_7745c5c3_Err
2510 }
2511 if p.Box.ReadyAction != "" {
2512 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 232, "Draft ")
2513 if templ_7745c5c3_Err != nil {
2514 return templ_7745c5c3_Err
2515 }
2516 } else {
2517 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 233, "Merge ")
2518 if templ_7745c5c3_Err != nil {
2519 return templ_7745c5c3_Err
2520 }
2521 }
2522 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 234, "<kbd aria-hidden=\"true\">M</kbd></summary><div class=\"menu-pop\" role=\"group\" aria-label=\"Merge\">")
2523 if templ_7745c5c3_Err != nil {
2524 return templ_7745c5c3_Err
2525 }
2526 if p.Box.HeadGone {
2527 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 235, "<p class=\"dim\">the source branch was deleted</p>")
2528 if templ_7745c5c3_Err != nil {
2529 return templ_7745c5c3_Err
2530 }
2531 }
2532 if p.Box.Error != "" {
2533 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 236, "<p class=\"d-err\" role=\"alert\">")
2534 if templ_7745c5c3_Err != nil {
2535 return templ_7745c5c3_Err
2536 }
2537 var templ_7745c5c3_Var118 string
2538 templ_7745c5c3_Var118, templ_7745c5c3_Err = templ.JoinStringErrs(p.Box.Error)
2539 if templ_7745c5c3_Err != nil {
2540 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 502, Col: 47}
2541 }
2542 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var118))
2543 if templ_7745c5c3_Err != nil {
2544 return templ_7745c5c3_Err
2545 }
2546 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 237, "</p>")
2547 if templ_7745c5c3_Err != nil {
2548 return templ_7745c5c3_Err
2549 }
2550 }
2551 if p.Box.ReadyAction != "" {
2552 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 238, "<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=\"")
2553 if templ_7745c5c3_Err != nil {
2554 return templ_7745c5c3_Err
2555 }
2556 var templ_7745c5c3_Var119 templ.SafeURL
2557 templ_7745c5c3_Var119, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.ReadyAction))
2558 if templ_7745c5c3_Err != nil {
2559 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 506, Col: 80}
2560 }
2561 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var119))
2562 if templ_7745c5c3_Err != nil {
2563 return templ_7745c5c3_Err
2564 }
2565 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 239, "\"><button type=\"submit\" class=\"btn primary\" data-default title=\"remove the draft prefix from the title\">Ready for review</button></form>")
2566 if templ_7745c5c3_Err != nil {
2567 return templ_7745c5c3_Err
2568 }
2569 } else if !p.Box.HeadGone {
2570 templ_7745c5c3_Err = mrMergeabilitySlot(p.Box.Mergeability).Render(ctx, templ_7745c5c3_Buffer)
2571 if templ_7745c5c3_Err != nil {
2572 return templ_7745c5c3_Err
2573 }
2574 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 240, " ")
2575 if templ_7745c5c3_Err != nil {
2576 return templ_7745c5c3_Err
2577 }
2578 if p.Box.AutoMerge != nil {
2579 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 241, "<form class=\"d-acts\" method=\"post\" action=\"")
2580 if templ_7745c5c3_Err != nil {
2581 return templ_7745c5c3_Err
2582 }
2583 var templ_7745c5c3_Var120 templ.SafeURL
2584 templ_7745c5c3_Var120, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.CancelAutoAction))
2585 if templ_7745c5c3_Err != nil {
2586 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 512, Col: 86}
2587 }
2588 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var120))
2589 if templ_7745c5c3_Err != nil {
2590 return templ_7745c5c3_Err
2591 }
2592 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 242, "\"><p class=\"dim\" role=\"status\">Auto-merge: ")
2593 if templ_7745c5c3_Err != nil {
2594 return templ_7745c5c3_Err
2595 }
2596 var templ_7745c5c3_Var121 string
2597 templ_7745c5c3_Var121, templ_7745c5c3_Err = templ.JoinStringErrs(p.Box.AutoMerge.Mode)
2598 if templ_7745c5c3_Err != nil {
2599 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 514, Col: 41}
2600 }
2601 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var121))
2602 if templ_7745c5c3_Err != nil {
2603 return templ_7745c5c3_Err
2604 }
2605 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 243, " when ready, enabled by ")
2606 if templ_7745c5c3_Err != nil {
2607 return templ_7745c5c3_Err
2608 }
2609 var templ_7745c5c3_Var122 string
2610 templ_7745c5c3_Var122, templ_7745c5c3_Err = templ.JoinStringErrs(p.Box.AutoMerge.EnabledBy)
2611 if templ_7745c5c3_Err != nil {
2612 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 514, Col: 94}
2613 }
2614 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var122))
2615 if templ_7745c5c3_Err != nil {
2616 return templ_7745c5c3_Err
2617 }
2618 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 244, " ")
2619 if templ_7745c5c3_Err != nil {
2620 return templ_7745c5c3_Err
2621 }
2622 if p.Box.AutoMerge.When != "" {
2623 var templ_7745c5c3_Var123 string
2624 templ_7745c5c3_Var123, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
2625 if templ_7745c5c3_Err != nil {
2626 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 516, Col: 13}
2627 }
2628 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var123))
2629 if templ_7745c5c3_Err != nil {
2630 return templ_7745c5c3_Err
2631 }
2632 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 245, "<time datetime=\"")
2633 if templ_7745c5c3_Err != nil {
2634 return templ_7745c5c3_Err
2635 }
2636 var templ_7745c5c3_Var124 string
2637 templ_7745c5c3_Var124, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.AutoMerge.WhenAt)
2638 if templ_7745c5c3_Err != nil {
2639 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 516, Col: 54}
2640 }
2641 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var124)
2642 if templ_7745c5c3_Err != nil {
2643 return templ_7745c5c3_Err
2644 }
2645 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 246, "\">")
2646 if templ_7745c5c3_Err != nil {
2647 return templ_7745c5c3_Err
2648 }
2649 var templ_7745c5c3_Var125 string
2650 templ_7745c5c3_Var125, templ_7745c5c3_Err = templ.JoinStringErrs(p.Box.AutoMerge.When)
2651 if templ_7745c5c3_Err != nil {
2652 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 516, Col: 79}
2653 }
2654 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var125))
2655 if templ_7745c5c3_Err != nil {
2656 return templ_7745c5c3_Err
2657 }
2658 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 247, "</time> ")
2659 if templ_7745c5c3_Err != nil {
2660 return templ_7745c5c3_Err
2661 }
2662 }
2663 var templ_7745c5c3_Var126 string
2664 templ_7745c5c3_Var126, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
2665 if templ_7745c5c3_Err != nil {
2666 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 518, Col: 12}
2667 }
2668 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var126))
2669 if templ_7745c5c3_Err != nil {
2670 return templ_7745c5c3_Err
2671 }
2672 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 248, "(head ")
2673 if templ_7745c5c3_Err != nil {
2674 return templ_7745c5c3_Err
2675 }
2676 var templ_7745c5c3_Var127 string
2677 templ_7745c5c3_Var127, templ_7745c5c3_Err = templ.JoinStringErrs(p.Box.AutoMerge.HeadShort)
2678 if templ_7745c5c3_Err != nil {
2679 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 518, Col: 47}
2680 }
2681 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var127))
2682 if templ_7745c5c3_Err != nil {
2683 return templ_7745c5c3_Err
2684 }
2685 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 249, ")</p><div class=\"d-btns\"><button type=\"submit\" class=\"btn\">Cancel auto-merge</button></div></form>")
2686 if templ_7745c5c3_Err != nil {
2687 return templ_7745c5c3_Err
2688 }
2689 }
2690 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 250, " <form class=\"d-acts\" method=\"post\" action=\"")
2691 if templ_7745c5c3_Err != nil {
2692 return templ_7745c5c3_Err
2693 }
2694 var templ_7745c5c3_Var128 templ.SafeURL
2695 templ_7745c5c3_Var128, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.MergeAction))
2696 if templ_7745c5c3_Err != nil {
2697 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 525, Col: 80}
2698 }
2699 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var128))
2700 if templ_7745c5c3_Err != nil {
2701 return templ_7745c5c3_Err
2702 }
2703 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 251, "\"><input type=\"hidden\" name=\"head_id\" value=\"")
2704 if templ_7745c5c3_Err != nil {
2705 return templ_7745c5c3_Err
2706 }
2707 var templ_7745c5c3_Var129 string
2708 templ_7745c5c3_Var129, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.Head)
2709 if templ_7745c5c3_Err != nil {
2710 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 526, Col: 59}
2711 }
2712 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var129)
2713 if templ_7745c5c3_Err != nil {
2714 return templ_7745c5c3_Err
2715 }
2716 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 252, "\"><fieldset class=\"d-modes\"><legend class=\"sr\">merge mode</legend> ")
2717 if templ_7745c5c3_Err != nil {
2718 return templ_7745c5c3_Err
2719 }
2720 for i, m := range p.Box.Modes {
2721 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 253, "<label><input type=\"radio\" name=\"mode\" value=\"")
2722 if templ_7745c5c3_Err != nil {
2723 return templ_7745c5c3_Err
2724 }
2725 var templ_7745c5c3_Var130 string
2726 templ_7745c5c3_Var130, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.Value)
2727 if templ_7745c5c3_Err != nil {
2728 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 534, Col: 24}
2729 }
2730 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var130)
2731 if templ_7745c5c3_Err != nil {
2732 return templ_7745c5c3_Err
2733 }
2734 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 254, "\"")
2735 if templ_7745c5c3_Err != nil {
2736 return templ_7745c5c3_Err
2737 }
2738 if i == p.Box.Checked() {
2739 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 255, " checked")
2740 if templ_7745c5c3_Err != nil {
2741 return templ_7745c5c3_Err
2742 }
2743 }
2744 if m.Disabled {
2745 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 256, " disabled")
2746 if templ_7745c5c3_Err != nil {
2747 return templ_7745c5c3_Err
2748 }
2749 }
2750 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 257, " title=\"")
2751 if templ_7745c5c3_Err != nil {
2752 return templ_7745c5c3_Err
2753 }
2754 var templ_7745c5c3_Var131 string
2755 templ_7745c5c3_Var131, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.Reason)
2756 if templ_7745c5c3_Err != nil {
2757 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 537, Col: 25}
2758 }
2759 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var131)
2760 if templ_7745c5c3_Err != nil {
2761 return templ_7745c5c3_Err
2762 }
2763 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 258, "\" :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\"> ")
2764 if templ_7745c5c3_Err != nil {
2765 return templ_7745c5c3_Err
2766 }
2767 var templ_7745c5c3_Var132 string
2768 templ_7745c5c3_Var132, templ_7745c5c3_Err = templ.JoinStringErrs(m.Label)
2769 if templ_7745c5c3_Err != nil {
2770 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 541, Col: 17}
2771 }
2772 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var132))
2773 if templ_7745c5c3_Err != nil {
2774 return templ_7745c5c3_Err
2775 }
2776 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 259, " ")
2777 if templ_7745c5c3_Err != nil {
2778 return templ_7745c5c3_Err
2779 }
2780 if i < 9 {
2781 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 260, "<kbd aria-hidden=\"true\">")
2782 if templ_7745c5c3_Err != nil {
2783 return templ_7745c5c3_Err
2784 }
2785 var templ_7745c5c3_Var133 string
2786 templ_7745c5c3_Var133, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(i + 1))
2787 if templ_7745c5c3_Err != nil {
2788 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 543, Col: 46}
2789 }
2790 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var133))
2791 if templ_7745c5c3_Err != nil {
2792 return templ_7745c5c3_Err
2793 }
2794 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 261, "</kbd>")
2795 if templ_7745c5c3_Err != nil {
2796 return templ_7745c5c3_Err
2797 }
2798 }
2799 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 262, "</label>")
2800 if templ_7745c5c3_Err != nil {
2801 return templ_7745c5c3_Err
2802 }
2803 }
2804 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 263, "</fieldset>")
2805 if templ_7745c5c3_Err != nil {
2806 return templ_7745c5c3_Err
2807 }
2808 if p.Box.CanDeleteBranch {
2809 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 264, "<label class=\"d-check\"><input type=\"checkbox\" name=\"delete_branch\" value=\"1\"> delete ")
2810 if templ_7745c5c3_Err != nil {
2811 return templ_7745c5c3_Err
2812 }
2813 var templ_7745c5c3_Var134 string
2814 templ_7745c5c3_Var134, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
2815 if templ_7745c5c3_Err != nil {
2816 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 549, Col: 102}
2817 }
2818 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var134))
2819 if templ_7745c5c3_Err != nil {
2820 return templ_7745c5c3_Err
2821 }
2822 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 265, " after the merge <kbd aria-hidden=\"true\">D</kbd></label>")
2823 if templ_7745c5c3_Err != nil {
2824 return templ_7745c5c3_Err
2825 }
2826 }
2827 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 266, "<div class=\"d-btns\"><button type=\"submit\" class=\"btn primary\" data-default")
2828 if templ_7745c5c3_Err != nil {
2829 return templ_7745c5c3_Err
2830 }
2831 if !p.Box.CanMerge() {
2832 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 267, " disabled")
2833 if templ_7745c5c3_Err != nil {
2834 return templ_7745c5c3_Err
2835 }
2836 }
2837 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 268, " title=\"")
2838 if templ_7745c5c3_Err != nil {
2839 return templ_7745c5c3_Err
2840 }
2841 var templ_7745c5c3_Var135 string
2842 templ_7745c5c3_Var135, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.MergeTitle())
2843 if templ_7745c5c3_Err != nil {
2844 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 557, Col: 33}
2845 }
2846 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var135)
2847 if templ_7745c5c3_Err != nil {
2848 return templ_7745c5c3_Err
2849 }
2850 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 269, "\" :disabled=\"!this.form.querySelector('input[name=mode]:checked:not(:disabled)')\" :title=\"(this.form.querySelector('input[name=mode]:checked') || {}).title || ''\">Merge into ")
2851 if templ_7745c5c3_Err != nil {
2852 return templ_7745c5c3_Err
2853 }
2854 var templ_7745c5c3_Var136 string
2855 templ_7745c5c3_Var136, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
2856 if templ_7745c5c3_Err != nil {
2857 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 560, Col: 28}
2858 }
2859 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var136))
2860 if templ_7745c5c3_Err != nil {
2861 return templ_7745c5c3_Err
2862 }
2863 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 270, "</button></div></form>")
2864 if templ_7745c5c3_Err != nil {
2865 return templ_7745c5c3_Err
2866 }
2867 if p.Box.CanAutoMerge {
2868 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 271, "<form class=\"d-acts\" method=\"post\" action=\"")
2869 if templ_7745c5c3_Err != nil {
2870 return templ_7745c5c3_Err
2871 }
2872 var templ_7745c5c3_Var137 templ.SafeURL
2873 templ_7745c5c3_Var137, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.AutoAction))
2874 if templ_7745c5c3_Err != nil {
2875 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 564, Col: 80}
2876 }
2877 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var137))
2878 if templ_7745c5c3_Err != nil {
2879 return templ_7745c5c3_Err
2880 }
2881 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 272, "\"><input type=\"hidden\" name=\"head_id\" value=\"")
2882 if templ_7745c5c3_Err != nil {
2883 return templ_7745c5c3_Err
2884 }
2885 var templ_7745c5c3_Var138 string
2886 templ_7745c5c3_Var138, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.Head)
2887 if templ_7745c5c3_Err != nil {
2888 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 565, Col: 60}
2889 }
2890 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var138)
2891 if templ_7745c5c3_Err != nil {
2892 return templ_7745c5c3_Err
2893 }
2894 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 273, "\"><fieldset class=\"d-modes\"><legend>Auto-merge mode</legend> ")
2895 if templ_7745c5c3_Err != nil {
2896 return templ_7745c5c3_Err
2897 }
2898 for i, m := range p.Box.Modes {
2899 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 274, "<label><input type=\"radio\" name=\"mode\" value=\"")
2900 if templ_7745c5c3_Err != nil {
2901 return templ_7745c5c3_Err
2902 }
2903 var templ_7745c5c3_Var139 string
2904 templ_7745c5c3_Var139, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.Value)
2905 if templ_7745c5c3_Err != nil {
2906 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 569, Col: 62}
2907 }
2908 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var139)
2909 if templ_7745c5c3_Err != nil {
2910 return templ_7745c5c3_Err
2911 }
2912 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 275, "\"")
2913 if templ_7745c5c3_Err != nil {
2914 return templ_7745c5c3_Err
2915 }
2916 if i == 0 {
2917 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 276, " checked")
2918 if templ_7745c5c3_Err != nil {
2919 return templ_7745c5c3_Err
2920 }
2921 }
2922 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 277, "> ")
2923 if templ_7745c5c3_Err != nil {
2924 return templ_7745c5c3_Err
2925 }
2926 var templ_7745c5c3_Var140 string
2927 templ_7745c5c3_Var140, templ_7745c5c3_Err = templ.JoinStringErrs(m.Label)
2928 if templ_7745c5c3_Err != nil {
2929 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 569, Col: 96}
2930 }
2931 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var140))
2932 if templ_7745c5c3_Err != nil {
2933 return templ_7745c5c3_Err
2934 }
2935 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 278, "</label>")
2936 if templ_7745c5c3_Err != nil {
2937 return templ_7745c5c3_Err
2938 }
2939 }
2940 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 279, "</fieldset><div class=\"d-btns\"><button type=\"submit\" class=\"btn\"")
2941 if templ_7745c5c3_Err != nil {
2942 return templ_7745c5c3_Err
2943 }
2944 if len(p.Box.Modes) == 0 {
2945 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 280, " disabled")
2946 if templ_7745c5c3_Err != nil {
2947 return templ_7745c5c3_Err
2948 }
2949 }
2950 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 281, " title=\"merge once the checks pass\">Merge when ready</button></div></form>")
2951 if templ_7745c5c3_Err != nil {
2952 return templ_7745c5c3_Err
2953 }
2954 }
2955 }
2956 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 282, "</div></details>")
2957 if templ_7745c5c3_Err != nil {
2958 return templ_7745c5c3_Err
2959 }
2960 return nil
2961 })
2962}
2963
2964// MRMergeability is the content of the mergeability slot: the badge, and the
2965// state the controls of the merge box read.
2966func MRMergeability(v MergeabilityView) templ.Component {
2967 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2968 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2969 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2970 return templ_7745c5c3_CtxErr
2971 }
2972 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2973 if !templ_7745c5c3_IsBuffer {
2974 defer func() {
2975 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2976 if templ_7745c5c3_Err == nil {
2977 templ_7745c5c3_Err = templ_7745c5c3_BufErr
2978 }
2979 }()
2980 }
2981 ctx = templ.InitializeContext(ctx)
2982 templ_7745c5c3_Var141 := templ.GetChildren(ctx)
2983 if templ_7745c5c3_Var141 == nil {
2984 templ_7745c5c3_Var141 = templ.NopComponent
2985 }
2986 ctx = templ.ClearChildren(ctx)
2987 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 283, "<span data-mergeability data-state=\"")
2988 if templ_7745c5c3_Err != nil {
2989 return templ_7745c5c3_Err
2990 }
2991 var templ_7745c5c3_Var142 string
2992 templ_7745c5c3_Var142, templ_7745c5c3_Err = templ.ResolveAttributeValue(v.State)
2993 if templ_7745c5c3_Err != nil {
2994 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 587, Col: 22}
2995 }
2996 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var142)
2997 if templ_7745c5c3_Err != nil {
2998 return templ_7745c5c3_Err
2999 }
3000 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 284, "\" data-ff-ok=\"")
3001 if templ_7745c5c3_Err != nil {
3002 return templ_7745c5c3_Err
3003 }
3004 var templ_7745c5c3_Var143 string
3005 templ_7745c5c3_Var143, templ_7745c5c3_Err = templ.ResolveAttributeValue(strconv.FormatBool(v.FFOk))
3006 if templ_7745c5c3_Err != nil {
3007 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 588, Col: 41}
3008 }
3009 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var143)
3010 if templ_7745c5c3_Err != nil {
3011 return templ_7745c5c3_Err
3012 }
3013 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 285, "\" data-merge-ok=\"")
3014 if templ_7745c5c3_Err != nil {
3015 return templ_7745c5c3_Err
3016 }
3017 var templ_7745c5c3_Var144 string
3018 templ_7745c5c3_Var144, templ_7745c5c3_Err = templ.ResolveAttributeValue(strconv.FormatBool(v.MergeOk))
3019 if templ_7745c5c3_Err != nil {
3020 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 589, Col: 47}
3021 }
3022 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var144)
3023 if templ_7745c5c3_Err != nil {
3024 return templ_7745c5c3_Err
3025 }
3026 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 286, "\" data-ff-reason=\"")
3027 if templ_7745c5c3_Err != nil {
3028 return templ_7745c5c3_Err
3029 }
3030 var templ_7745c5c3_Var145 string
3031 templ_7745c5c3_Var145, templ_7745c5c3_Err = templ.ResolveAttributeValue(v.FFReason)
3032 if templ_7745c5c3_Err != nil {
3033 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 590, Col: 29}
3034 }
3035 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var145)
3036 if templ_7745c5c3_Err != nil {
3037 return templ_7745c5c3_Err
3038 }
3039 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 287, "\" data-merge-reason=\"")
3040 if templ_7745c5c3_Err != nil {
3041 return templ_7745c5c3_Err
3042 }
3043 var templ_7745c5c3_Var146 string
3044 templ_7745c5c3_Var146, templ_7745c5c3_Err = templ.ResolveAttributeValue(v.MergeReason)
3045 if templ_7745c5c3_Err != nil {
3046 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 591, Col: 35}
3047 }
3048 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var146)
3049 if templ_7745c5c3_Err != nil {
3050 return templ_7745c5c3_Err
3051 }
3052 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 288, "\"><span class=\"badge\" data-state=\"")
3053 if templ_7745c5c3_Err != nil {
3054 return templ_7745c5c3_Err
3055 }
3056 var templ_7745c5c3_Var147 string
3057 templ_7745c5c3_Var147, templ_7745c5c3_Err = templ.ResolveAttributeValue(v.State)
3058 if templ_7745c5c3_Err != nil {
3059 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 593, Col: 42}
3060 }
3061 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var147)
3062 if templ_7745c5c3_Err != nil {
3063 return templ_7745c5c3_Err
3064 }
3065 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 289, "\">")
3066 if templ_7745c5c3_Err != nil {
3067 return templ_7745c5c3_Err
3068 }
3069 var templ_7745c5c3_Var148 string
3070 templ_7745c5c3_Var148, templ_7745c5c3_Err = templ.JoinStringErrs(v.Label)
3071 if templ_7745c5c3_Err != nil {
3072 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 593, Col: 54}
3073 }
3074 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var148))
3075 if templ_7745c5c3_Err != nil {
3076 return templ_7745c5c3_Err
3077 }
3078 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 290, "</span> ")
3079 if templ_7745c5c3_Err != nil {
3080 return templ_7745c5c3_Err
3081 }
3082 if v.Detail != "" {
3083 var templ_7745c5c3_Var149 string
3084 templ_7745c5c3_Var149, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
3085 if templ_7745c5c3_Err != nil {
3086 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 595, Col: 8}
3087 }
3088 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var149))
3089 if templ_7745c5c3_Err != nil {
3090 return templ_7745c5c3_Err
3091 }
3092 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 291, "<span class=\"dim\">")
3093 if templ_7745c5c3_Err != nil {
3094 return templ_7745c5c3_Err
3095 }
3096 var templ_7745c5c3_Var150 string
3097 templ_7745c5c3_Var150, templ_7745c5c3_Err = templ.JoinStringErrs(v.Detail)
3098 if templ_7745c5c3_Err != nil {
3099 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 595, Col: 38}
3100 }
3101 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var150))
3102 if templ_7745c5c3_Err != nil {
3103 return templ_7745c5c3_Err
3104 }
3105 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 292, "</span>")
3106 if templ_7745c5c3_Err != nil {
3107 return templ_7745c5c3_Err
3108 }
3109 }
3110 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 293, "</span> ")
3111 if templ_7745c5c3_Err != nil {
3112 return templ_7745c5c3_Err
3113 }
3114 if len(v.Paths) > 0 {
3115 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 294, "<ul class=\"mg-paths\" aria-label=\"conflicting files\">")
3116 if templ_7745c5c3_Err != nil {
3117 return templ_7745c5c3_Err
3118 }
3119 for _, path := range v.Paths {
3120 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 295, "<li><code>")
3121 if templ_7745c5c3_Err != nil {
3122 return templ_7745c5c3_Err
3123 }
3124 var templ_7745c5c3_Var151 string
3125 templ_7745c5c3_Var151, templ_7745c5c3_Err = templ.JoinStringErrs(path)
3126 if templ_7745c5c3_Err != nil {
3127 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 601, Col: 20}
3128 }
3129 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var151))
3130 if templ_7745c5c3_Err != nil {
3131 return templ_7745c5c3_Err
3132 }
3133 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 296, "</code></li>")
3134 if templ_7745c5c3_Err != nil {
3135 return templ_7745c5c3_Err
3136 }
3137 }
3138 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 297, "</ul>")
3139 if templ_7745c5c3_Err != nil {
3140 return templ_7745c5c3_Err
3141 }
3142 }
3143 if v.PathsNote != "" {
3144 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 298, "<p class=\"dim\">")
3145 if templ_7745c5c3_Err != nil {
3146 return templ_7745c5c3_Err
3147 }
3148 var templ_7745c5c3_Var152 string
3149 templ_7745c5c3_Var152, templ_7745c5c3_Err = templ.JoinStringErrs(v.PathsNote)
3150 if templ_7745c5c3_Err != nil {
3151 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 606, Col: 30}
3152 }
3153 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var152))
3154 if templ_7745c5c3_Err != nil {
3155 return templ_7745c5c3_Err
3156 }
3157 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 299, "</p>")
3158 if templ_7745c5c3_Err != nil {
3159 return templ_7745c5c3_Err
3160 }
3161 }
3162 return nil
3163 })
3164}
3165
3166// mrMergeabilitySlot is the status region of the badge, with its content: the
3167// stream replaces the children, never the element (see LiveSlot).
3168func mrMergeabilitySlot(v MergeabilityView) templ.Component {
3169 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3170 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3171 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3172 return templ_7745c5c3_CtxErr
3173 }
3174 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3175 if !templ_7745c5c3_IsBuffer {
3176 defer func() {
3177 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3178 if templ_7745c5c3_Err == nil {
3179 templ_7745c5c3_Err = templ_7745c5c3_BufErr
3180 }
3181 }()
3182 }
3183 ctx = templ.InitializeContext(ctx)
3184 templ_7745c5c3_Var153 := templ.GetChildren(ctx)
3185 if templ_7745c5c3_Var153 == nil {
3186 templ_7745c5c3_Var153 = templ.NopComponent
3187 }
3188 ctx = templ.ClearChildren(ctx)
3189 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 300, "<div id=\"mr-mergeability\" class=\"live-slot\" role=\"status\" data-slot>")
3190 if templ_7745c5c3_Err != nil {
3191 return templ_7745c5c3_Err
3192 }
3193 templ_7745c5c3_Err = MRMergeability(v).Render(ctx, templ_7745c5c3_Buffer)
3194 if templ_7745c5c3_Err != nil {
3195 return templ_7745c5c3_Err
3196 }
3197 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 301, "</div>")
3198 if templ_7745c5c3_Err != nil {
3199 return templ_7745c5c3_Err
3200 }
3201 return nil
3202 })
3203}
3204
3205// MRMergeabilityFragment is the slot as the stream sends it.
3206func MRMergeabilityFragment(v MergeabilityView) templ.Component {
3207 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3208 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3209 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3210 return templ_7745c5c3_CtxErr
3211 }
3212 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3213 if !templ_7745c5c3_IsBuffer {
3214 defer func() {
3215 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3216 if templ_7745c5c3_Err == nil {
3217 templ_7745c5c3_Err = templ_7745c5c3_BufErr
3218 }
3219 }()
3220 }
3221 ctx = templ.InitializeContext(ctx)
3222 templ_7745c5c3_Var154 := templ.GetChildren(ctx)
3223 if templ_7745c5c3_Var154 == nil {
3224 templ_7745c5c3_Var154 = templ.NopComponent
3225 }
3226 ctx = templ.ClearChildren(ctx)
3227 templ_7745c5c3_Err = mrMergeabilitySlot(v).Render(ctx, templ_7745c5c3_Buffer)
3228 if templ_7745c5c3_Err != nil {
3229 return templ_7745c5c3_Err
3230 }
3231 return nil
3232 })
3233}
3234
3235// moreMenu shows read-only settings to every viewer, and keeps owner actions
3236// behind the same merge-box permission as before.
3237func moreMenu(p MRPage) templ.Component {
3238 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3239 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3240 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3241 return templ_7745c5c3_CtxErr
3242 }
3243 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3244 if !templ_7745c5c3_IsBuffer {
3245 defer func() {
3246 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3247 if templ_7745c5c3_Err == nil {
3248 templ_7745c5c3_Err = templ_7745c5c3_BufErr
3249 }
3250 }()
3251 }
3252 ctx = templ.InitializeContext(ctx)
3253 templ_7745c5c3_Var155 := templ.GetChildren(ctx)
3254 if templ_7745c5c3_Var155 == nil {
3255 templ_7745c5c3_Var155 = templ.NopComponent
3256 }
3257 ctx = templ.ClearChildren(ctx)
3258 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 302, "<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>")
3259 if templ_7745c5c3_Err != nil {
3260 return templ_7745c5c3_Err
3261 }
3262 var templ_7745c5c3_Var156 string
3263 templ_7745c5c3_Var156, templ_7745c5c3_Err = templ.JoinStringErrs(strings.Join(p.Modes, ", "))
3264 if templ_7745c5c3_Err != nil {
3265 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 633, Col: 38}
3266 }
3267 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var156))
3268 if templ_7745c5c3_Err != nil {
3269 return templ_7745c5c3_Err
3270 }
3271 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 303, "</dd><dt>checks</dt><dd>")
3272 if templ_7745c5c3_Err != nil {
3273 return templ_7745c5c3_Err
3274 }
3275 if p.ChecksBlock {
3276 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 304, "failing ones block the merge")
3277 if templ_7745c5c3_Err != nil {
3278 return templ_7745c5c3_Err
3279 }
3280 } else {
3281 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 305, "do not block the merge")
3282 if templ_7745c5c3_Err != nil {
3283 return templ_7745c5c3_Err
3284 }
3285 }
3286 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 306, "</dd></dl></section>")
3287 if templ_7745c5c3_Err != nil {
3288 return templ_7745c5c3_Err
3289 }
3290 if p.Box != nil {
3291 if p.Box.Signed {
3292 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 307, "<p class=\"d-note\" id=\"mr-signing\">squash and merge commits are signed with ermite's own key (generated on first start). ")
3293 if templ_7745c5c3_Err != nil {
3294 return templ_7745c5c3_Err
3295 }
3296 if p.Box.Fingerprint != "" {
3297 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 308, "fingerprint <code>")
3298 if templ_7745c5c3_Err != nil {
3299 return templ_7745c5c3_Err
3300 }
3301 var templ_7745c5c3_Var157 string
3302 templ_7745c5c3_Var157, templ_7745c5c3_Err = templ.JoinStringErrs(p.Box.Fingerprint)
3303 if templ_7745c5c3_Err != nil {
3304 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 649, Col: 44}
3305 }
3306 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var157))
3307 if templ_7745c5c3_Err != nil {
3308 return templ_7745c5c3_Err
3309 }
3310 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 309, "</code> ")
3311 if templ_7745c5c3_Err != nil {
3312 return templ_7745c5c3_Err
3313 }
3314 }
3315 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 310, "<code>ermite signing-key show</code> prints it.</p>")
3316 if templ_7745c5c3_Err != nil {
3317 return templ_7745c5c3_Err
3318 }
3319 }
3320 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 311, " ")
3321 if templ_7745c5c3_Err != nil {
3322 return templ_7745c5c3_Err
3323 }
3324 if p.Box.CanMarkRead {
3325 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 312, "<form method=\"post\" action=\"")
3326 if templ_7745c5c3_Err != nil {
3327 return templ_7745c5c3_Err
3328 }
3329 var templ_7745c5c3_Var158 templ.SafeURL
3330 templ_7745c5c3_Var158, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.ReadAction))
3331 if templ_7745c5c3_Err != nil {
3332 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 655, Col: 65}
3333 }
3334 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var158))
3335 if templ_7745c5c3_Err != nil {
3336 return templ_7745c5c3_Err
3337 }
3338 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 313, "\"><input type=\"hidden\" name=\"head_id\" value=\"")
3339 if templ_7745c5c3_Err != nil {
3340 return templ_7745c5c3_Err
3341 }
3342 var templ_7745c5c3_Var159 string
3343 templ_7745c5c3_Var159, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.Head)
3344 if templ_7745c5c3_Err != nil {
3345 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 656, Col: 60}
3346 }
3347 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var159)
3348 if templ_7745c5c3_Err != nil {
3349 return templ_7745c5c3_Err
3350 }
3351 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 314, "\"> <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>")
3352 if templ_7745c5c3_Err != nil {
3353 return templ_7745c5c3_Err
3354 }
3355 }
3356 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 315, " <form method=\"post\" action=\"")
3357 if templ_7745c5c3_Err != nil {
3358 return templ_7745c5c3_Err
3359 }
3360 var templ_7745c5c3_Var160 templ.SafeURL
3361 templ_7745c5c3_Var160, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.CloseAction))
3362 if templ_7745c5c3_Err != nil {
3363 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 660, Col: 65}
3364 }
3365 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var160))
3366 if templ_7745c5c3_Err != nil {
3367 return templ_7745c5c3_Err
3368 }
3369 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 316, "\"><button type=\"submit\" title=\"close without merging; the branch is kept\" class=\"btn danger\">Close</button></form>")
3370 if templ_7745c5c3_Err != nil {
3371 return templ_7745c5c3_Err
3372 }
3373 if !p.Box.HeadGone && p.Box.ReadyAction == "" {
3374 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 317, "<details class=\"d-or\"><summary class=\"mute\">or from a terminal</summary>")
3375 if templ_7745c5c3_Err != nil {
3376 return templ_7745c5c3_Err
3377 }
3378 templ_7745c5c3_Err = CloneBlock(p.Box.CLI).Render(ctx, templ_7745c5c3_Buffer)
3379 if templ_7745c5c3_Err != nil {
3380 return templ_7745c5c3_Err
3381 }
3382 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 318, "</details>")
3383 if templ_7745c5c3_Err != nil {
3384 return templ_7745c5c3_Err
3385 }
3386 }
3387 }
3388 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 319, "</div></details>")
3389 if templ_7745c5c3_Err != nil {
3390 return templ_7745c5c3_Err
3391 }
3392 return nil
3393 })
3394}
3395
3396func Compare(l Layout, p ComparePage) templ.Component {
3397 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3398 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3399 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3400 return templ_7745c5c3_CtxErr
3401 }
3402 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3403 if !templ_7745c5c3_IsBuffer {
3404 defer func() {
3405 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3406 if templ_7745c5c3_Err == nil {
3407 templ_7745c5c3_Err = templ_7745c5c3_BufErr
3408 }
3409 }()
3410 }
3411 ctx = templ.InitializeContext(ctx)
3412 templ_7745c5c3_Var161 := templ.GetChildren(ctx)
3413 if templ_7745c5c3_Var161 == nil {
3414 templ_7745c5c3_Var161 = templ.NopComponent
3415 }
3416 ctx = templ.ClearChildren(ctx)
3417 templ_7745c5c3_Var162 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3418 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3419 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3420 if !templ_7745c5c3_IsBuffer {
3421 defer func() {
3422 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3423 if templ_7745c5c3_Err == nil {
3424 templ_7745c5c3_Err = templ_7745c5c3_BufErr
3425 }
3426 }()
3427 }
3428 ctx = templ.InitializeContext(ctx)
3429 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 320, "<header class=\"show mr-h\"><h1>")
3430 if templ_7745c5c3_Err != nil {
3431 return templ_7745c5c3_Err
3432 }
3433 var templ_7745c5c3_Var163 string
3434 templ_7745c5c3_Var163, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
3435 if templ_7745c5c3_Err != nil {
3436 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 677, Col: 17}
3437 }
3438 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var163))
3439 if templ_7745c5c3_Err != nil {
3440 return templ_7745c5c3_Err
3441 }
3442 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 321, " → ")
3443 if templ_7745c5c3_Err != nil {
3444 return templ_7745c5c3_Err
3445 }
3446 var templ_7745c5c3_Var164 string
3447 templ_7745c5c3_Var164, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
3448 if templ_7745c5c3_Err != nil {
3449 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 677, Col: 34}
3450 }
3451 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var164))
3452 if templ_7745c5c3_Err != nil {
3453 return templ_7745c5c3_Err
3454 }
3455 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 322, "</h1><dl class=\"kv show-kv\"><dt>branch</dt><dd><a href=\"")
3456 if templ_7745c5c3_Err != nil {
3457 return templ_7745c5c3_Err
3458 }
3459 var templ_7745c5c3_Var165 templ.SafeURL
3460 templ_7745c5c3_Var165, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.SourceHref))
3461 if templ_7745c5c3_Err != nil {
3462 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 680, Col: 45}
3463 }
3464 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var165))
3465 if templ_7745c5c3_Err != nil {
3466 return templ_7745c5c3_Err
3467 }
3468 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 323, "\">")
3469 if templ_7745c5c3_Err != nil {
3470 return templ_7745c5c3_Err
3471 }
3472 var templ_7745c5c3_Var166 string
3473 templ_7745c5c3_Var166, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
3474 if templ_7745c5c3_Err != nil {
3475 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 680, Col: 58}
3476 }
3477 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var166))
3478 if templ_7745c5c3_Err != nil {
3479 return templ_7745c5c3_Err
3480 }
3481 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 324, "</a></dd><dt>target</dt><dd><a href=\"")
3482 if templ_7745c5c3_Err != nil {
3483 return templ_7745c5c3_Err
3484 }
3485 var templ_7745c5c3_Var167 templ.SafeURL
3486 templ_7745c5c3_Var167, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.TargetHref))
3487 if templ_7745c5c3_Err != nil {
3488 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 682, Col: 45}
3489 }
3490 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var167))
3491 if templ_7745c5c3_Err != nil {
3492 return templ_7745c5c3_Err
3493 }
3494 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 325, "\">")
3495 if templ_7745c5c3_Err != nil {
3496 return templ_7745c5c3_Err
3497 }
3498 var templ_7745c5c3_Var168 string
3499 templ_7745c5c3_Var168, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
3500 if templ_7745c5c3_Err != nil {
3501 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 682, Col: 58}
3502 }
3503 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var168))
3504 if templ_7745c5c3_Err != nil {
3505 return templ_7745c5c3_Err
3506 }
3507 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 326, "</a></dd><dt>ahead</dt><dd>")
3508 if templ_7745c5c3_Err != nil {
3509 return templ_7745c5c3_Err
3510 }
3511 var templ_7745c5c3_Var169 string
3512 templ_7745c5c3_Var169, templ_7745c5c3_Err = templ.JoinStringErrs(p.AheadText)
3513 if templ_7745c5c3_Err != nil {
3514 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 684, Col: 21}
3515 }
3516 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var169))
3517 if templ_7745c5c3_Err != nil {
3518 return templ_7745c5c3_Err
3519 }
3520 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 327, "</dd></dl></header>")
3521 if templ_7745c5c3_Err != nil {
3522 return templ_7745c5c3_Err
3523 }
3524 if p.Note != "" {
3525 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 328, "<p class=\"notice\">")
3526 if templ_7745c5c3_Err != nil {
3527 return templ_7745c5c3_Err
3528 }
3529 var templ_7745c5c3_Var170 string
3530 templ_7745c5c3_Var170, templ_7745c5c3_Err = templ.JoinStringErrs(p.Note)
3531 if templ_7745c5c3_Err != nil {
3532 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 688, Col: 29}
3533 }
3534 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var170))
3535 if templ_7745c5c3_Err != nil {
3536 return templ_7745c5c3_Err
3537 }
3538 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 329, "</p>")
3539 if templ_7745c5c3_Err != nil {
3540 return templ_7745c5c3_Err
3541 }
3542 }
3543 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 330, " ")
3544 if templ_7745c5c3_Err != nil {
3545 return templ_7745c5c3_Err
3546 }
3547 if p.Existing != nil {
3548 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 331, "<p class=\"notice\">an open merge request already covers these branches: <a href=\"")
3549 if templ_7745c5c3_Err != nil {
3550 return templ_7745c5c3_Err
3551 }
3552 var templ_7745c5c3_Var171 templ.SafeURL
3553 templ_7745c5c3_Var171, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Existing.Href))
3554 if templ_7745c5c3_Err != nil {
3555 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 691, Col: 114}
3556 }
3557 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var171))
3558 if templ_7745c5c3_Err != nil {
3559 return templ_7745c5c3_Err
3560 }
3561 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 332, "\">")
3562 if templ_7745c5c3_Err != nil {
3563 return templ_7745c5c3_Err
3564 }
3565 var templ_7745c5c3_Var172 string
3566 templ_7745c5c3_Var172, templ_7745c5c3_Err = templ.JoinStringErrs(p.Existing.Label)
3567 if templ_7745c5c3_Err != nil {
3568 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 691, Col: 135}
3569 }
3570 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var172))
3571 if templ_7745c5c3_Err != nil {
3572 return templ_7745c5c3_Err
3573 }
3574 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 333, "</a></p>")
3575 if templ_7745c5c3_Err != nil {
3576 return templ_7745c5c3_Err
3577 }
3578 }
3579 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 334, " ")
3580 if templ_7745c5c3_Err != nil {
3581 return templ_7745c5c3_Err
3582 }
3583 if p.Create != nil {
3584 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 335, "<form class=\"cform create\" method=\"post\" action=\"")
3585 if templ_7745c5c3_Err != nil {
3586 return templ_7745c5c3_Err
3587 }
3588 var templ_7745c5c3_Var173 templ.SafeURL
3589 templ_7745c5c3_Var173, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Create.Action))
3590 if templ_7745c5c3_Err != nil {
3591 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 694, Col: 83}
3592 }
3593 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var173))
3594 if templ_7745c5c3_Err != nil {
3595 return templ_7745c5c3_Err
3596 }
3597 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 336, "\"><input type=\"hidden\" name=\"source\" value=\"")
3598 if templ_7745c5c3_Err != nil {
3599 return templ_7745c5c3_Err
3600 }
3601 var templ_7745c5c3_Var174 string
3602 templ_7745c5c3_Var174, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Source)
3603 if templ_7745c5c3_Err != nil {
3604 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 695, Col: 62}
3605 }
3606 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var174)
3607 if templ_7745c5c3_Err != nil {
3608 return templ_7745c5c3_Err
3609 }
3610 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 337, "\"> <input type=\"hidden\" name=\"target\" value=\"")
3611 if templ_7745c5c3_Err != nil {
3612 return templ_7745c5c3_Err
3613 }
3614 var templ_7745c5c3_Var175 string
3615 templ_7745c5c3_Var175, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Target)
3616 if templ_7745c5c3_Err != nil {
3617 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 696, Col: 62}
3618 }
3619 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var175)
3620 if templ_7745c5c3_Err != nil {
3621 return templ_7745c5c3_Err
3622 }
3623 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 338, "\"> <label for=\"mr-title\">title</label> <input id=\"mr-title\" name=\"title\" type=\"text\" maxlength=\"120\" required value=\"")
3624 if templ_7745c5c3_Err != nil {
3625 return templ_7745c5c3_Err
3626 }
3627 var templ_7745c5c3_Var176 string
3628 templ_7745c5c3_Var176, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Title)
3629 if templ_7745c5c3_Err != nil {
3630 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 698, Col: 97}
3631 }
3632 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var176)
3633 if templ_7745c5c3_Err != nil {
3634 return templ_7745c5c3_Err
3635 }
3636 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 339, "\" 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>")
3637 if templ_7745c5c3_Err != nil {
3638 return templ_7745c5c3_Err
3639 }
3640 }
3641 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 340, " ")
3642 if templ_7745c5c3_Err != nil {
3643 return templ_7745c5c3_Err
3644 }
3645 if p.HasDiff {
3646 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 341, "<div class=\"diff-tools\" role=\"group\" aria-label=\"Diff view\"><span class=\"dim\">")
3647 if templ_7745c5c3_Err != nil {
3648 return templ_7745c5c3_Err
3649 }
3650 var templ_7745c5c3_Var177 string
3651 templ_7745c5c3_Var177, templ_7745c5c3_Err = templ.JoinStringErrs(plural(p.NFiles, "file", "files"))
3652 if templ_7745c5c3_Err != nil {
3653 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 708, Col: 57}
3654 }
3655 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var177))
3656 if templ_7745c5c3_Err != nil {
3657 return templ_7745c5c3_Err
3658 }
3659 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 342, " · <span class=\"plus\">+")
3660 if templ_7745c5c3_Err != nil {
3661 return templ_7745c5c3_Err
3662 }
3663 var templ_7745c5c3_Var178 string
3664 templ_7745c5c3_Var178, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Adds))
3665 if templ_7745c5c3_Err != nil {
3666 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 708, Col: 97}
3667 }
3668 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var178))
3669 if templ_7745c5c3_Err != nil {
3670 return templ_7745c5c3_Err
3671 }
3672 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 343, "</span> <span class=\"minus\">-")
3673 if templ_7745c5c3_Err != nil {
3674 return templ_7745c5c3_Err
3675 }
3676 var templ_7745c5c3_Var179 string
3677 templ_7745c5c3_Var179, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Dels))
3678 if templ_7745c5c3_Err != nil {
3679 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 708, Col: 142}
3680 }
3681 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var179))
3682 if templ_7745c5c3_Err != nil {
3683 return templ_7745c5c3_Err
3684 }
3685 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 344, "</span></span> <span class=\"grow\"></span>")
3686 if templ_7745c5c3_Err != nil {
3687 return templ_7745c5c3_Err
3688 }
3689 templ_7745c5c3_Err = diffViewMenu(p.DiffView).Render(ctx, templ_7745c5c3_Buffer)
3690 if templ_7745c5c3_Err != nil {
3691 return templ_7745c5c3_Err
3692 }
3693 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 345, "</div>")
3694 if templ_7745c5c3_Err != nil {
3695 return templ_7745c5c3_Err
3696 }
3697 if p.Invisible {
3698 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 346, "<p class=\"notice\">this diff holds invisible characters (direction controls, zero-width characters). They are shown as <span class=\"inv\"><U+XXXX></span> markers, never applied.</p>")
3699 if templ_7745c5c3_Err != nil {
3700 return templ_7745c5c3_Err
3701 }
3702 }
3703 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 347, " <div id=\"diffs\"")
3704 if templ_7745c5c3_Err != nil {
3705 return templ_7745c5c3_Err
3706 }
3707 if p.Both {
3708 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 348, " data-diff=\"")
3709 if templ_7745c5c3_Err != nil {
3710 return templ_7745c5c3_Err
3711 }
3712 var templ_7745c5c3_Var180 string
3713 templ_7745c5c3_Var180, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
3714 if templ_7745c5c3_Err != nil {
3715 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 721, Col: 23}
3716 }
3717 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var180)
3718 if templ_7745c5c3_Err != nil {
3719 return templ_7745c5c3_Err
3720 }
3721 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 349, "\"")
3722 if templ_7745c5c3_Err != nil {
3723 return templ_7745c5c3_Err
3724 }
3725 } else {
3726 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 350, " data-view=\"")
3727 if templ_7745c5c3_Err != nil {
3728 return templ_7745c5c3_Err
3729 }
3730 var templ_7745c5c3_Var181 string
3731 templ_7745c5c3_Var181, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
3732 if templ_7745c5c3_Err != nil {
3733 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 723, Col: 23}
3734 }
3735 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var181)
3736 if templ_7745c5c3_Err != nil {
3737 return templ_7745c5c3_Err
3738 }
3739 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 351, "\"")
3740 if templ_7745c5c3_Err != nil {
3741 return templ_7745c5c3_Err
3742 }
3743 }
3744 if p.Both && !p.Pinned {
3745 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 352, " hx-live=\"this.dataset.diff = sessionStorage.getItem('diff') || this.dataset.diff\"")
3746 if templ_7745c5c3_Err != nil {
3747 return templ_7745c5c3_Err
3748 }
3749 }
3750 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 353, ">")
3751 if templ_7745c5c3_Err != nil {
3752 return templ_7745c5c3_Err
3753 }
3754 for _, f := range p.Files {
3755 templ_7745c5c3_Err = DiffFileView(f, p.DiffView).Render(ctx, templ_7745c5c3_Buffer)
3756 if templ_7745c5c3_Err != nil {
3757 return templ_7745c5c3_Err
3758 }
3759 }
3760 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 354, "</div>")
3761 if templ_7745c5c3_Err != nil {
3762 return templ_7745c5c3_Err
3763 }
3764 }
3765 return nil
3766 })
3767 templ_7745c5c3_Err = Shell(l, compareRail(p)).Render(templ.WithChildren(ctx, templ_7745c5c3_Var162), templ_7745c5c3_Buffer)
3768 if templ_7745c5c3_Err != nil {
3769 return templ_7745c5c3_Err
3770 }
3771 return nil
3772 })
3773}
3774
3775func compareRail(p ComparePage) templ.Component {
3776 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3777 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3778 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3779 return templ_7745c5c3_CtxErr
3780 }
3781 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3782 if !templ_7745c5c3_IsBuffer {
3783 defer func() {
3784 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3785 if templ_7745c5c3_Err == nil {
3786 templ_7745c5c3_Err = templ_7745c5c3_BufErr
3787 }
3788 }()
3789 }
3790 ctx = templ.InitializeContext(ctx)
3791 templ_7745c5c3_Var182 := templ.GetChildren(ctx)
3792 if templ_7745c5c3_Var182 == nil {
3793 templ_7745c5c3_Var182 = templ.NopComponent
3794 }
3795 ctx = templ.ClearChildren(ctx)
3796 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 355, "<section aria-labelledby=\"r-ahead\"><h2 id=\"r-ahead\">Commits <span class=\"count\">")
3797 if templ_7745c5c3_Err != nil {
3798 return templ_7745c5c3_Err
3799 }
3800 var templ_7745c5c3_Var183 string
3801 templ_7745c5c3_Var183, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Ahead)))
3802 if templ_7745c5c3_Err != nil {
3803 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 739, Col: 67}
3804 }
3805 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var183))
3806 if templ_7745c5c3_Err != nil {
3807 return templ_7745c5c3_Err
3808 }
3809 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 356, "</span></h2><ul class=\"pcommits\">")
3810 if templ_7745c5c3_Err != nil {
3811 return templ_7745c5c3_Err
3812 }
3813 for _, c := range p.Ahead {
3814 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 357, "<li><a href=\"")
3815 if templ_7745c5c3_Err != nil {
3816 return templ_7745c5c3_Err
3817 }
3818 var templ_7745c5c3_Var184 templ.SafeURL
3819 templ_7745c5c3_Var184, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.CHref))
3820 if templ_7745c5c3_Err != nil {
3821 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 743, Col: 37}
3822 }
3823 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var184))
3824 if templ_7745c5c3_Err != nil {
3825 return templ_7745c5c3_Err
3826 }
3827 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 358, "\">")
3828 if templ_7745c5c3_Err != nil {
3829 return templ_7745c5c3_Err
3830 }
3831 var templ_7745c5c3_Var185 string
3832 templ_7745c5c3_Var185, templ_7745c5c3_Err = templ.JoinStringErrs(c.Short)
3833 if templ_7745c5c3_Err != nil {
3834 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 743, Col: 49}
3835 }
3836 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var185))
3837 if templ_7745c5c3_Err != nil {
3838 return templ_7745c5c3_Err
3839 }
3840 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 359, "</a> <span class=\"s\">")
3841 if templ_7745c5c3_Err != nil {
3842 return templ_7745c5c3_Err
3843 }
3844 var templ_7745c5c3_Var186 string
3845 templ_7745c5c3_Var186, templ_7745c5c3_Err = templ.JoinStringErrs(c.Subject)
3846 if templ_7745c5c3_Err != nil {
3847 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 744, Col: 32}
3848 }
3849 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var186))
3850 if templ_7745c5c3_Err != nil {
3851 return templ_7745c5c3_Err
3852 }
3853 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 360, "</span> <span class=\"mute\">")
3854 if templ_7745c5c3_Err != nil {
3855 return templ_7745c5c3_Err
3856 }
3857 var templ_7745c5c3_Var187 string
3858 templ_7745c5c3_Var187, templ_7745c5c3_Err = templ.JoinStringErrs(c.Author)
3859 if templ_7745c5c3_Err != nil {
3860 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 746, Col: 16}
3861 }
3862 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var187))
3863 if templ_7745c5c3_Err != nil {
3864 return templ_7745c5c3_Err
3865 }
3866 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 361, " ")
3867 if templ_7745c5c3_Err != nil {
3868 return templ_7745c5c3_Err
3869 }
3870 if c.WhenAt != "" {
3871 var templ_7745c5c3_Var188 string
3872 templ_7745c5c3_Var188, templ_7745c5c3_Err = templ.JoinStringErrs(" · ")
3873 if templ_7745c5c3_Err != nil {
3874 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 748, Col: 15}
3875 }
3876 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var188))
3877 if templ_7745c5c3_Err != nil {
3878 return templ_7745c5c3_Err
3879 }
3880 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 362, "<time datetime=\"")
3881 if templ_7745c5c3_Err != nil {
3882 return templ_7745c5c3_Err
3883 }
3884 var templ_7745c5c3_Var189 string
3885 templ_7745c5c3_Var189, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.WhenAt)
3886 if templ_7745c5c3_Err != nil {
3887 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 748, Col: 42}
3888 }
3889 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var189)
3890 if templ_7745c5c3_Err != nil {
3891 return templ_7745c5c3_Err
3892 }
3893 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 363, "\">")
3894 if templ_7745c5c3_Err != nil {
3895 return templ_7745c5c3_Err
3896 }
3897 var templ_7745c5c3_Var190 string
3898 templ_7745c5c3_Var190, templ_7745c5c3_Err = templ.JoinStringErrs(c.When)
3899 if templ_7745c5c3_Err != nil {
3900 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 748, Col: 53}
3901 }
3902 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var190))
3903 if templ_7745c5c3_Err != nil {
3904 return templ_7745c5c3_Err
3905 }
3906 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 364, "</time>")
3907 if templ_7745c5c3_Err != nil {
3908 return templ_7745c5c3_Err
3909 }
3910 }
3911 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 365, "</span></li>")
3912 if templ_7745c5c3_Err != nil {
3913 return templ_7745c5c3_Err
3914 }
3915 }
3916 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 366, "</ul>")
3917 if templ_7745c5c3_Err != nil {
3918 return templ_7745c5c3_Err
3919 }
3920 if len(p.Ahead) == 0 {
3921 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 367, "<p class=\"dim\">no commit ahead of ")
3922 if templ_7745c5c3_Err != nil {
3923 return templ_7745c5c3_Err
3924 }
3925 var templ_7745c5c3_Var191 string
3926 templ_7745c5c3_Var191, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
3927 if templ_7745c5c3_Err != nil {
3928 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 755, Col: 47}
3929 }
3930 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var191))
3931 if templ_7745c5c3_Err != nil {
3932 return templ_7745c5c3_Err
3933 }
3934 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 368, ".</p>")
3935 if templ_7745c5c3_Err != nil {
3936 return templ_7745c5c3_Err
3937 }
3938 }
3939 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 369, "</section>")
3940 if templ_7745c5c3_Err != nil {
3941 return templ_7745c5c3_Err
3942 }
3943 if p.HasDiff {
3944 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 370, "<section aria-labelledby=\"r-files\"><h2 id=\"r-files\">Files <span class=\"count\">")
3945 if templ_7745c5c3_Err != nil {
3946 return templ_7745c5c3_Err
3947 }
3948 var templ_7745c5c3_Var192 string
3949 templ_7745c5c3_Var192, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Files)))
3950 if templ_7745c5c3_Err != nil {
3951 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 760, Col: 66}
3952 }
3953 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var192))
3954 if templ_7745c5c3_Err != nil {
3955 return templ_7745c5c3_Err
3956 }
3957 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 371, "</span></h2>")
3958 if templ_7745c5c3_Err != nil {
3959 return templ_7745c5c3_Err
3960 }
3961 templ_7745c5c3_Err = FileList(p.Files).Render(ctx, templ_7745c5c3_Buffer)
3962 if templ_7745c5c3_Err != nil {
3963 return templ_7745c5c3_Err
3964 }
3965 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 372, "</section>")
3966 if templ_7745c5c3_Err != nil {
3967 return templ_7745c5c3_Err
3968 }
3969 }
3970 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 373, "<section aria-labelledby=\"r-cli\"><h2 id=\"r-cli\">From a terminal</h2>")
3971 if templ_7745c5c3_Err != nil {
3972 return templ_7745c5c3_Err
3973 }
3974 templ_7745c5c3_Err = CloneBlock(p.CLI).Render(ctx, templ_7745c5c3_Buffer)
3975 if templ_7745c5c3_Err != nil {
3976 return templ_7745c5c3_Err
3977 }
3978 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 374, "</section>")
3979 if templ_7745c5c3_Err != nil {
3980 return templ_7745c5c3_Err
3981 }
3982 return nil
3983 })
3984}
3985
3986var _ = templruntime.GeneratedTemplate