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