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, "<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: 116, Col: 36}
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: 116, Col: 55}
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: 119, Col: 45}
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: 120, Col: 14}
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: 122, Col: 14}
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: 122, Col: 53}
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: 122, Col: 71}
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: 122, Col: 99}
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: 128, Col: 14}
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: 133, Col: 20}
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: 135, Col: 14}
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: 135, Col: 48}
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: 135, Col: 71}
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: 135, Col: 89}
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: 140, Col: 37}
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: 140, Col: 51}
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.Deleting != "" {
798 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "<p class=\"note\" role=\"status\">merged. the branch ")
799 if templ_7745c5c3_Err != nil {
800 return templ_7745c5c3_Err
801 }
802 var templ_7745c5c3_Var42 string
803 templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinStringErrs(p.Deleting)
804 if templ_7745c5c3_Err != nil {
805 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 145, Col: 64}
806 }
807 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42))
808 if templ_7745c5c3_Err != nil {
809 return templ_7745c5c3_Err
810 }
811 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, " is being deleted.</p>")
812 if templ_7745c5c3_Err != nil {
813 return templ_7745c5c3_Err
814 }
815 }
816 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, " ")
817 if templ_7745c5c3_Err != nil {
818 return templ_7745c5c3_Err
819 }
820 if p.MergeError != "" {
821 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "<p class=\"d-err\" role=\"alert\">")
822 if templ_7745c5c3_Err != nil {
823 return templ_7745c5c3_Err
824 }
825 var templ_7745c5c3_Var43 string
826 templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(p.MergeError)
827 if templ_7745c5c3_Err != nil {
828 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 148, Col: 47}
829 }
830 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43))
831 if templ_7745c5c3_Err != nil {
832 return templ_7745c5c3_Err
833 }
834 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, "</p>")
835 if templ_7745c5c3_Err != nil {
836 return templ_7745c5c3_Err
837 }
838 }
839 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 74, " ")
840 if templ_7745c5c3_Err != nil {
841 return templ_7745c5c3_Err
842 }
843 templ_7745c5c3_Err = LiveSlot("mr-notice").Render(ctx, templ_7745c5c3_Buffer)
844 if templ_7745c5c3_Err != nil {
845 return templ_7745c5c3_Err
846 }
847 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 75, " ")
848 if templ_7745c5c3_Err != nil {
849 return templ_7745c5c3_Err
850 }
851 if p.Desc != "" {
852 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 76, "<article class=\"mr-desc prose\" aria-label=\"description\" hx-ignore>")
853 if templ_7745c5c3_Err != nil {
854 return templ_7745c5c3_Err
855 }
856 templ_7745c5c3_Err = templ.Raw(string(p.Desc)).Render(ctx, templ_7745c5c3_Buffer)
857 if templ_7745c5c3_Err != nil {
858 return templ_7745c5c3_Err
859 }
860 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 77, "</article>")
861 if templ_7745c5c3_Err != nil {
862 return templ_7745c5c3_Err
863 }
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: 159, 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: 163, 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: 165, 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: 169, 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: 169, 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: 173, 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: 183, 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: 189, 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: 192, 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: 194, 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: 207, 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: 207, 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: 225, 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: 225, 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: 227, 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: 246, 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: 246, 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: 248, 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: 250, 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: 250, 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: 250, 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: 250, 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: 253, 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: 256, 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: 259, 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: 259, 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: 283, 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: 286, 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: 289, 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: 292, 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: 292, 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: 292, 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: 295, 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: 295, 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: 306, 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: 307, 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: 309, 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: 311, 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: 326, 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: 327, 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: 327, 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: 329, 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: 344, 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: 345, 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: 346, 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: 347, 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: 350, 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: 356, 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: 361, 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: 370, 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: 383, 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: 383, 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: 383, 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: 394, 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: 398, 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: 398, 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: 399, 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: 404, 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: 406, 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: 406, 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: 406, 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: 409, 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: 419, 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: 426, 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: 445, 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: 445, 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: 445, 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 = viewLink(p.DiffView, "unified", "Unified", "u", p.UnifiedHref).Render(ctx, templ_7745c5c3_Buffer)
2398 if templ_7745c5c3_Err != nil {
2399 return templ_7745c5c3_Err
2400 }
2401 templ_7745c5c3_Err = viewLink(p.DiffView, "split", "Split", "d", p.SplitHref).Render(ctx, templ_7745c5c3_Buffer)
2402 if templ_7745c5c3_Err != nil {
2403 return templ_7745c5c3_Err
2404 }
2405 templ_7745c5c3_Err = collapseButton().Render(ctx, templ_7745c5c3_Buffer)
2406 if templ_7745c5c3_Err != nil {
2407 return templ_7745c5c3_Err
2408 }
2409 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 223, "<span class=\"grow\"></span>")
2410 if templ_7745c5c3_Err != nil {
2411 return templ_7745c5c3_Err
2412 }
2413 templ_7745c5c3_Err = MRChecksSum(p.ChecksSum).Render(ctx, templ_7745c5c3_Buffer)
2414 if templ_7745c5c3_Err != nil {
2415 return templ_7745c5c3_Err
2416 }
2417 if p.Box != nil {
2418 templ_7745c5c3_Err = mergeMenu(p).Render(ctx, templ_7745c5c3_Buffer)
2419 if templ_7745c5c3_Err != nil {
2420 return templ_7745c5c3_Err
2421 }
2422 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 224, " ")
2423 if templ_7745c5c3_Err != nil {
2424 return templ_7745c5c3_Err
2425 }
2426 templ_7745c5c3_Err = moreMenu(p).Render(ctx, templ_7745c5c3_Buffer)
2427 if templ_7745c5c3_Err != nil {
2428 return templ_7745c5c3_Err
2429 }
2430 }
2431 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 225, "</div>")
2432 if templ_7745c5c3_Err != nil {
2433 return templ_7745c5c3_Err
2434 }
2435 return nil
2436 })
2437}
2438
2439// mergeMenu is the merge of an open request, for the owner: the form (it
2440// carries the head that was read), or "Ready for review" for a draft. The
2441// mode and the branch deletion have keys (1-3, D) while it is open.
2442//
2443// The badge is a live slot (mr-mergeability); the modes and the button read
2444// its data-* attributes (hx-live bindings), so that they follow the slot when
2445// the stream replaces its content. The server renders the same state in the
2446// attributes, for a page without scripts.
2447func mergeMenu(p MRPage) templ.Component {
2448 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2449 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2450 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2451 return templ_7745c5c3_CtxErr
2452 }
2453 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2454 if !templ_7745c5c3_IsBuffer {
2455 defer func() {
2456 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2457 if templ_7745c5c3_Err == nil {
2458 templ_7745c5c3_Err = templ_7745c5c3_BufErr
2459 }
2460 }()
2461 }
2462 ctx = templ.InitializeContext(ctx)
2463 templ_7745c5c3_Var117 := templ.GetChildren(ctx)
2464 if templ_7745c5c3_Var117 == nil {
2465 templ_7745c5c3_Var117 = templ.NopComponent
2466 }
2467 ctx = templ.ClearChildren(ctx)
2468 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 226, "<details class=\"menu mmenu\" id=\"merge-menu\" data-state=\"open\"")
2469 if templ_7745c5c3_Err != nil {
2470 return templ_7745c5c3_Err
2471 }
2472 if p.Box.Error != "" {
2473 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 227, " open")
2474 if templ_7745c5c3_Err != nil {
2475 return templ_7745c5c3_Err
2476 }
2477 }
2478 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 228, "><summary class=\"btn primary\" aria-keyshortcuts=\"Shift+M\">")
2479 if templ_7745c5c3_Err != nil {
2480 return templ_7745c5c3_Err
2481 }
2482 if p.Box.ReadyAction != "" {
2483 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 229, "Draft ")
2484 if templ_7745c5c3_Err != nil {
2485 return templ_7745c5c3_Err
2486 }
2487 } else {
2488 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 230, "Merge ")
2489 if templ_7745c5c3_Err != nil {
2490 return templ_7745c5c3_Err
2491 }
2492 }
2493 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>")
2494 if templ_7745c5c3_Err != nil {
2495 return templ_7745c5c3_Err
2496 }
2497 if p.Box.HeadGone {
2498 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 232, "gone: the source branch was deleted")
2499 if templ_7745c5c3_Err != nil {
2500 return templ_7745c5c3_Err
2501 }
2502 } else {
2503 var templ_7745c5c3_Var118 string
2504 templ_7745c5c3_Var118, templ_7745c5c3_Err = templ.JoinStringErrs(p.HeadShort)
2505 if templ_7745c5c3_Err != nil {
2506 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 483, Col: 19}
2507 }
2508 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var118))
2509 if templ_7745c5c3_Err != nil {
2510 return templ_7745c5c3_Err
2511 }
2512 }
2513 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 233, "</dd><dt>into</dt><dd>")
2514 if templ_7745c5c3_Err != nil {
2515 return templ_7745c5c3_Err
2516 }
2517 var templ_7745c5c3_Var119 string
2518 templ_7745c5c3_Var119, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
2519 if templ_7745c5c3_Err != nil {
2520 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 487, Col: 18}
2521 }
2522 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var119))
2523 if templ_7745c5c3_Err != nil {
2524 return templ_7745c5c3_Err
2525 }
2526 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 234, "</dd></dl>")
2527 if templ_7745c5c3_Err != nil {
2528 return templ_7745c5c3_Err
2529 }
2530 if p.Box.Error != "" {
2531 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 235, "<p class=\"d-err\" role=\"alert\">")
2532 if templ_7745c5c3_Err != nil {
2533 return templ_7745c5c3_Err
2534 }
2535 var templ_7745c5c3_Var120 string
2536 templ_7745c5c3_Var120, templ_7745c5c3_Err = templ.JoinStringErrs(p.Box.Error)
2537 if templ_7745c5c3_Err != nil {
2538 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 490, Col: 47}
2539 }
2540 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var120))
2541 if templ_7745c5c3_Err != nil {
2542 return templ_7745c5c3_Err
2543 }
2544 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 236, "</p>")
2545 if templ_7745c5c3_Err != nil {
2546 return templ_7745c5c3_Err
2547 }
2548 }
2549 if p.Box.ReadyAction != "" {
2550 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=\"")
2551 if templ_7745c5c3_Err != nil {
2552 return templ_7745c5c3_Err
2553 }
2554 var templ_7745c5c3_Var121 templ.SafeURL
2555 templ_7745c5c3_Var121, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.ReadyAction))
2556 if templ_7745c5c3_Err != nil {
2557 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 494, Col: 80}
2558 }
2559 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var121))
2560 if templ_7745c5c3_Err != nil {
2561 return templ_7745c5c3_Err
2562 }
2563 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>")
2564 if templ_7745c5c3_Err != nil {
2565 return templ_7745c5c3_Err
2566 }
2567 } else if !p.Box.HeadGone {
2568 templ_7745c5c3_Err = mrMergeabilitySlot(p.Box.Mergeability).Render(ctx, templ_7745c5c3_Buffer)
2569 if templ_7745c5c3_Err != nil {
2570 return templ_7745c5c3_Err
2571 }
2572 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 239, " <form class=\"d-acts\" method=\"post\" action=\"")
2573 if templ_7745c5c3_Err != nil {
2574 return templ_7745c5c3_Err
2575 }
2576 var templ_7745c5c3_Var122 templ.SafeURL
2577 templ_7745c5c3_Var122, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.MergeAction))
2578 if templ_7745c5c3_Err != nil {
2579 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 499, Col: 80}
2580 }
2581 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var122))
2582 if templ_7745c5c3_Err != nil {
2583 return templ_7745c5c3_Err
2584 }
2585 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 240, "\"><input type=\"hidden\" name=\"head_id\" value=\"")
2586 if templ_7745c5c3_Err != nil {
2587 return templ_7745c5c3_Err
2588 }
2589 var templ_7745c5c3_Var123 string
2590 templ_7745c5c3_Var123, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.Head)
2591 if templ_7745c5c3_Err != nil {
2592 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 500, Col: 59}
2593 }
2594 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var123)
2595 if templ_7745c5c3_Err != nil {
2596 return templ_7745c5c3_Err
2597 }
2598 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 241, "\"><fieldset class=\"d-modes\"><legend class=\"sr\">merge mode</legend> ")
2599 if templ_7745c5c3_Err != nil {
2600 return templ_7745c5c3_Err
2601 }
2602 for i, m := range p.Box.Modes {
2603 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 242, "<label><input type=\"radio\" name=\"mode\" value=\"")
2604 if templ_7745c5c3_Err != nil {
2605 return templ_7745c5c3_Err
2606 }
2607 var templ_7745c5c3_Var124 string
2608 templ_7745c5c3_Var124, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.Value)
2609 if templ_7745c5c3_Err != nil {
2610 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 508, Col: 24}
2611 }
2612 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var124)
2613 if templ_7745c5c3_Err != nil {
2614 return templ_7745c5c3_Err
2615 }
2616 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 243, "\"")
2617 if templ_7745c5c3_Err != nil {
2618 return templ_7745c5c3_Err
2619 }
2620 if i == p.Box.Checked() {
2621 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 244, " checked")
2622 if templ_7745c5c3_Err != nil {
2623 return templ_7745c5c3_Err
2624 }
2625 }
2626 if m.Disabled {
2627 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 245, " disabled")
2628 if templ_7745c5c3_Err != nil {
2629 return templ_7745c5c3_Err
2630 }
2631 }
2632 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 246, " title=\"")
2633 if templ_7745c5c3_Err != nil {
2634 return templ_7745c5c3_Err
2635 }
2636 var templ_7745c5c3_Var125 string
2637 templ_7745c5c3_Var125, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.Reason)
2638 if templ_7745c5c3_Err != nil {
2639 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 511, Col: 25}
2640 }
2641 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var125)
2642 if templ_7745c5c3_Err != nil {
2643 return templ_7745c5c3_Err
2644 }
2645 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\"> ")
2646 if templ_7745c5c3_Err != nil {
2647 return templ_7745c5c3_Err
2648 }
2649 var templ_7745c5c3_Var126 string
2650 templ_7745c5c3_Var126, templ_7745c5c3_Err = templ.JoinStringErrs(m.Label)
2651 if templ_7745c5c3_Err != nil {
2652 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 515, Col: 17}
2653 }
2654 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var126))
2655 if templ_7745c5c3_Err != nil {
2656 return templ_7745c5c3_Err
2657 }
2658 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 248, " ")
2659 if templ_7745c5c3_Err != nil {
2660 return templ_7745c5c3_Err
2661 }
2662 if i < 9 {
2663 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 249, "<kbd aria-hidden=\"true\">")
2664 if templ_7745c5c3_Err != nil {
2665 return templ_7745c5c3_Err
2666 }
2667 var templ_7745c5c3_Var127 string
2668 templ_7745c5c3_Var127, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(i + 1))
2669 if templ_7745c5c3_Err != nil {
2670 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 517, Col: 46}
2671 }
2672 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var127))
2673 if templ_7745c5c3_Err != nil {
2674 return templ_7745c5c3_Err
2675 }
2676 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 250, "</kbd>")
2677 if templ_7745c5c3_Err != nil {
2678 return templ_7745c5c3_Err
2679 }
2680 }
2681 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 251, "</label>")
2682 if templ_7745c5c3_Err != nil {
2683 return templ_7745c5c3_Err
2684 }
2685 }
2686 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 252, "</fieldset>")
2687 if templ_7745c5c3_Err != nil {
2688 return templ_7745c5c3_Err
2689 }
2690 if p.Box.Signed {
2691 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). ")
2692 if templ_7745c5c3_Err != nil {
2693 return templ_7745c5c3_Err
2694 }
2695 if p.Box.Fingerprint != "" {
2696 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 254, "fingerprint <code>")
2697 if templ_7745c5c3_Err != nil {
2698 return templ_7745c5c3_Err
2699 }
2700 var templ_7745c5c3_Var128 string
2701 templ_7745c5c3_Var128, templ_7745c5c3_Err = templ.JoinStringErrs(p.Box.Fingerprint)
2702 if templ_7745c5c3_Err != nil {
2703 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 526, Col: 45}
2704 }
2705 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var128))
2706 if templ_7745c5c3_Err != nil {
2707 return templ_7745c5c3_Err
2708 }
2709 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 255, "</code> ")
2710 if templ_7745c5c3_Err != nil {
2711 return templ_7745c5c3_Err
2712 }
2713 }
2714 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 256, "<code>ermite signing-key show</code> prints it.</p>")
2715 if templ_7745c5c3_Err != nil {
2716 return templ_7745c5c3_Err
2717 }
2718 }
2719 if p.Box.CanDeleteBranch {
2720 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 257, "<label class=\"d-check\"><input type=\"checkbox\" name=\"delete_branch\" value=\"1\"> delete ")
2721 if templ_7745c5c3_Err != nil {
2722 return templ_7745c5c3_Err
2723 }
2724 var templ_7745c5c3_Var129 string
2725 templ_7745c5c3_Var129, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
2726 if templ_7745c5c3_Err != nil {
2727 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 532, Col: 102}
2728 }
2729 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var129))
2730 if templ_7745c5c3_Err != nil {
2731 return templ_7745c5c3_Err
2732 }
2733 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 258, " after the merge <kbd aria-hidden=\"true\">D</kbd></label>")
2734 if templ_7745c5c3_Err != nil {
2735 return templ_7745c5c3_Err
2736 }
2737 }
2738 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 259, "<div class=\"d-btns\"><button type=\"submit\" class=\"btn primary\" data-default")
2739 if templ_7745c5c3_Err != nil {
2740 return templ_7745c5c3_Err
2741 }
2742 if !p.Box.CanMerge() {
2743 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 260, " disabled")
2744 if templ_7745c5c3_Err != nil {
2745 return templ_7745c5c3_Err
2746 }
2747 }
2748 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 261, " title=\"")
2749 if templ_7745c5c3_Err != nil {
2750 return templ_7745c5c3_Err
2751 }
2752 var templ_7745c5c3_Var130 string
2753 templ_7745c5c3_Var130, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.MergeTitle())
2754 if templ_7745c5c3_Err != nil {
2755 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 540, Col: 33}
2756 }
2757 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var130)
2758 if templ_7745c5c3_Err != nil {
2759 return templ_7745c5c3_Err
2760 }
2761 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 ")
2762 if templ_7745c5c3_Err != nil {
2763 return templ_7745c5c3_Err
2764 }
2765 var templ_7745c5c3_Var131 string
2766 templ_7745c5c3_Var131, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
2767 if templ_7745c5c3_Err != nil {
2768 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 543, Col: 28}
2769 }
2770 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var131))
2771 if templ_7745c5c3_Err != nil {
2772 return templ_7745c5c3_Err
2773 }
2774 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 263, "</button></div></form>")
2775 if templ_7745c5c3_Err != nil {
2776 return templ_7745c5c3_Err
2777 }
2778 }
2779 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 264, "</div></details>")
2780 if templ_7745c5c3_Err != nil {
2781 return templ_7745c5c3_Err
2782 }
2783 return nil
2784 })
2785}
2786
2787// MRMergeability is the content of the mergeability slot: the badge, and the
2788// state the controls of the merge box read.
2789func MRMergeability(v MergeabilityView) templ.Component {
2790 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2791 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2792 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2793 return templ_7745c5c3_CtxErr
2794 }
2795 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2796 if !templ_7745c5c3_IsBuffer {
2797 defer func() {
2798 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2799 if templ_7745c5c3_Err == nil {
2800 templ_7745c5c3_Err = templ_7745c5c3_BufErr
2801 }
2802 }()
2803 }
2804 ctx = templ.InitializeContext(ctx)
2805 templ_7745c5c3_Var132 := templ.GetChildren(ctx)
2806 if templ_7745c5c3_Var132 == nil {
2807 templ_7745c5c3_Var132 = templ.NopComponent
2808 }
2809 ctx = templ.ClearChildren(ctx)
2810 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 265, "<span data-mergeability data-state=\"")
2811 if templ_7745c5c3_Err != nil {
2812 return templ_7745c5c3_Err
2813 }
2814 var templ_7745c5c3_Var133 string
2815 templ_7745c5c3_Var133, templ_7745c5c3_Err = templ.ResolveAttributeValue(v.State)
2816 if templ_7745c5c3_Err != nil {
2817 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 556, Col: 22}
2818 }
2819 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var133)
2820 if templ_7745c5c3_Err != nil {
2821 return templ_7745c5c3_Err
2822 }
2823 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 266, "\" data-ff-ok=\"")
2824 if templ_7745c5c3_Err != nil {
2825 return templ_7745c5c3_Err
2826 }
2827 var templ_7745c5c3_Var134 string
2828 templ_7745c5c3_Var134, templ_7745c5c3_Err = templ.ResolveAttributeValue(strconv.FormatBool(v.FFOk))
2829 if templ_7745c5c3_Err != nil {
2830 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 557, Col: 41}
2831 }
2832 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var134)
2833 if templ_7745c5c3_Err != nil {
2834 return templ_7745c5c3_Err
2835 }
2836 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 267, "\" data-merge-ok=\"")
2837 if templ_7745c5c3_Err != nil {
2838 return templ_7745c5c3_Err
2839 }
2840 var templ_7745c5c3_Var135 string
2841 templ_7745c5c3_Var135, templ_7745c5c3_Err = templ.ResolveAttributeValue(strconv.FormatBool(v.MergeOk))
2842 if templ_7745c5c3_Err != nil {
2843 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 558, Col: 47}
2844 }
2845 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var135)
2846 if templ_7745c5c3_Err != nil {
2847 return templ_7745c5c3_Err
2848 }
2849 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 268, "\" data-ff-reason=\"")
2850 if templ_7745c5c3_Err != nil {
2851 return templ_7745c5c3_Err
2852 }
2853 var templ_7745c5c3_Var136 string
2854 templ_7745c5c3_Var136, templ_7745c5c3_Err = templ.ResolveAttributeValue(v.FFReason)
2855 if templ_7745c5c3_Err != nil {
2856 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 559, Col: 29}
2857 }
2858 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var136)
2859 if templ_7745c5c3_Err != nil {
2860 return templ_7745c5c3_Err
2861 }
2862 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 269, "\" data-merge-reason=\"")
2863 if templ_7745c5c3_Err != nil {
2864 return templ_7745c5c3_Err
2865 }
2866 var templ_7745c5c3_Var137 string
2867 templ_7745c5c3_Var137, templ_7745c5c3_Err = templ.ResolveAttributeValue(v.MergeReason)
2868 if templ_7745c5c3_Err != nil {
2869 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 560, Col: 35}
2870 }
2871 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var137)
2872 if templ_7745c5c3_Err != nil {
2873 return templ_7745c5c3_Err
2874 }
2875 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 270, "\"><span class=\"badge\" data-state=\"")
2876 if templ_7745c5c3_Err != nil {
2877 return templ_7745c5c3_Err
2878 }
2879 var templ_7745c5c3_Var138 string
2880 templ_7745c5c3_Var138, templ_7745c5c3_Err = templ.ResolveAttributeValue(v.State)
2881 if templ_7745c5c3_Err != nil {
2882 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 562, Col: 42}
2883 }
2884 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var138)
2885 if templ_7745c5c3_Err != nil {
2886 return templ_7745c5c3_Err
2887 }
2888 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 271, "\">")
2889 if templ_7745c5c3_Err != nil {
2890 return templ_7745c5c3_Err
2891 }
2892 var templ_7745c5c3_Var139 string
2893 templ_7745c5c3_Var139, templ_7745c5c3_Err = templ.JoinStringErrs(v.Label)
2894 if templ_7745c5c3_Err != nil {
2895 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 562, Col: 54}
2896 }
2897 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var139))
2898 if templ_7745c5c3_Err != nil {
2899 return templ_7745c5c3_Err
2900 }
2901 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 272, "</span> ")
2902 if templ_7745c5c3_Err != nil {
2903 return templ_7745c5c3_Err
2904 }
2905 if v.Detail != "" {
2906 var templ_7745c5c3_Var140 string
2907 templ_7745c5c3_Var140, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
2908 if templ_7745c5c3_Err != nil {
2909 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 564, Col: 8}
2910 }
2911 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var140))
2912 if templ_7745c5c3_Err != nil {
2913 return templ_7745c5c3_Err
2914 }
2915 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 273, "<span class=\"dim\">")
2916 if templ_7745c5c3_Err != nil {
2917 return templ_7745c5c3_Err
2918 }
2919 var templ_7745c5c3_Var141 string
2920 templ_7745c5c3_Var141, templ_7745c5c3_Err = templ.JoinStringErrs(v.Detail)
2921 if templ_7745c5c3_Err != nil {
2922 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 564, Col: 38}
2923 }
2924 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var141))
2925 if templ_7745c5c3_Err != nil {
2926 return templ_7745c5c3_Err
2927 }
2928 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 274, "</span>")
2929 if templ_7745c5c3_Err != nil {
2930 return templ_7745c5c3_Err
2931 }
2932 }
2933 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 275, "</span> ")
2934 if templ_7745c5c3_Err != nil {
2935 return templ_7745c5c3_Err
2936 }
2937 if len(v.Paths) > 0 {
2938 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 276, "<ul class=\"mg-paths\" aria-label=\"conflicting files\">")
2939 if templ_7745c5c3_Err != nil {
2940 return templ_7745c5c3_Err
2941 }
2942 for _, path := range v.Paths {
2943 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 277, "<li><code>")
2944 if templ_7745c5c3_Err != nil {
2945 return templ_7745c5c3_Err
2946 }
2947 var templ_7745c5c3_Var142 string
2948 templ_7745c5c3_Var142, templ_7745c5c3_Err = templ.JoinStringErrs(path)
2949 if templ_7745c5c3_Err != nil {
2950 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 570, Col: 20}
2951 }
2952 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var142))
2953 if templ_7745c5c3_Err != nil {
2954 return templ_7745c5c3_Err
2955 }
2956 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 278, "</code></li>")
2957 if templ_7745c5c3_Err != nil {
2958 return templ_7745c5c3_Err
2959 }
2960 }
2961 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 279, "</ul>")
2962 if templ_7745c5c3_Err != nil {
2963 return templ_7745c5c3_Err
2964 }
2965 }
2966 if v.PathsNote != "" {
2967 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 280, "<p class=\"dim\">")
2968 if templ_7745c5c3_Err != nil {
2969 return templ_7745c5c3_Err
2970 }
2971 var templ_7745c5c3_Var143 string
2972 templ_7745c5c3_Var143, templ_7745c5c3_Err = templ.JoinStringErrs(v.PathsNote)
2973 if templ_7745c5c3_Err != nil {
2974 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 575, Col: 30}
2975 }
2976 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var143))
2977 if templ_7745c5c3_Err != nil {
2978 return templ_7745c5c3_Err
2979 }
2980 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 281, "</p>")
2981 if templ_7745c5c3_Err != nil {
2982 return templ_7745c5c3_Err
2983 }
2984 }
2985 return nil
2986 })
2987}
2988
2989// mrMergeabilitySlot is the status region of the badge, with its content: the
2990// stream replaces the children, never the element (see LiveSlot).
2991func mrMergeabilitySlot(v MergeabilityView) templ.Component {
2992 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2993 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2994 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2995 return templ_7745c5c3_CtxErr
2996 }
2997 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2998 if !templ_7745c5c3_IsBuffer {
2999 defer func() {
3000 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3001 if templ_7745c5c3_Err == nil {
3002 templ_7745c5c3_Err = templ_7745c5c3_BufErr
3003 }
3004 }()
3005 }
3006 ctx = templ.InitializeContext(ctx)
3007 templ_7745c5c3_Var144 := templ.GetChildren(ctx)
3008 if templ_7745c5c3_Var144 == nil {
3009 templ_7745c5c3_Var144 = templ.NopComponent
3010 }
3011 ctx = templ.ClearChildren(ctx)
3012 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 282, "<div id=\"mr-mergeability\" class=\"live-slot\" role=\"status\" data-slot>")
3013 if templ_7745c5c3_Err != nil {
3014 return templ_7745c5c3_Err
3015 }
3016 templ_7745c5c3_Err = MRMergeability(v).Render(ctx, templ_7745c5c3_Buffer)
3017 if templ_7745c5c3_Err != nil {
3018 return templ_7745c5c3_Err
3019 }
3020 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 283, "</div>")
3021 if templ_7745c5c3_Err != nil {
3022 return templ_7745c5c3_Err
3023 }
3024 return nil
3025 })
3026}
3027
3028// MRMergeabilityFragment is the slot as the stream sends it.
3029func MRMergeabilityFragment(v MergeabilityView) templ.Component {
3030 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3031 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3032 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3033 return templ_7745c5c3_CtxErr
3034 }
3035 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3036 if !templ_7745c5c3_IsBuffer {
3037 defer func() {
3038 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3039 if templ_7745c5c3_Err == nil {
3040 templ_7745c5c3_Err = templ_7745c5c3_BufErr
3041 }
3042 }()
3043 }
3044 ctx = templ.InitializeContext(ctx)
3045 templ_7745c5c3_Var145 := templ.GetChildren(ctx)
3046 if templ_7745c5c3_Var145 == nil {
3047 templ_7745c5c3_Var145 = templ.NopComponent
3048 }
3049 ctx = templ.ClearChildren(ctx)
3050 templ_7745c5c3_Err = mrMergeabilitySlot(v).Render(ctx, templ_7745c5c3_Buffer)
3051 if templ_7745c5c3_Err != nil {
3052 return templ_7745c5c3_Err
3053 }
3054 return nil
3055 })
3056}
3057
3058// moreMenu is what else the owner does with an open request: mark the head
3059// read, close it, merge it from a terminal.
3060func moreMenu(p MRPage) templ.Component {
3061 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3062 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3063 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3064 return templ_7745c5c3_CtxErr
3065 }
3066 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3067 if !templ_7745c5c3_IsBuffer {
3068 defer func() {
3069 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3070 if templ_7745c5c3_Err == nil {
3071 templ_7745c5c3_Err = templ_7745c5c3_BufErr
3072 }
3073 }()
3074 }
3075 ctx = templ.InitializeContext(ctx)
3076 templ_7745c5c3_Var146 := templ.GetChildren(ctx)
3077 if templ_7745c5c3_Var146 == nil {
3078 templ_7745c5c3_Var146 = templ.NopComponent
3079 }
3080 ctx = templ.ClearChildren(ctx)
3081 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\">")
3082 if templ_7745c5c3_Err != nil {
3083 return templ_7745c5c3_Err
3084 }
3085 if p.Box.CanMarkRead {
3086 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 285, "<form method=\"post\" action=\"")
3087 if templ_7745c5c3_Err != nil {
3088 return templ_7745c5c3_Err
3089 }
3090 var templ_7745c5c3_Var147 templ.SafeURL
3091 templ_7745c5c3_Var147, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.ReadAction))
3092 if templ_7745c5c3_Err != nil {
3093 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 599, Col: 64}
3094 }
3095 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var147))
3096 if templ_7745c5c3_Err != nil {
3097 return templ_7745c5c3_Err
3098 }
3099 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 286, "\"><input type=\"hidden\" name=\"head_id\" value=\"")
3100 if templ_7745c5c3_Err != nil {
3101 return templ_7745c5c3_Err
3102 }
3103 var templ_7745c5c3_Var148 string
3104 templ_7745c5c3_Var148, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.Head)
3105 if templ_7745c5c3_Err != nil {
3106 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 600, Col: 59}
3107 }
3108 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var148)
3109 if templ_7745c5c3_Err != nil {
3110 return templ_7745c5c3_Err
3111 }
3112 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>")
3113 if templ_7745c5c3_Err != nil {
3114 return templ_7745c5c3_Err
3115 }
3116 }
3117 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 288, "<form method=\"post\" action=\"")
3118 if templ_7745c5c3_Err != nil {
3119 return templ_7745c5c3_Err
3120 }
3121 var templ_7745c5c3_Var149 templ.SafeURL
3122 templ_7745c5c3_Var149, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.CloseAction))
3123 if templ_7745c5c3_Err != nil {
3124 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 604, Col: 64}
3125 }
3126 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var149))
3127 if templ_7745c5c3_Err != nil {
3128 return templ_7745c5c3_Err
3129 }
3130 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>")
3131 if templ_7745c5c3_Err != nil {
3132 return templ_7745c5c3_Err
3133 }
3134 if !p.Box.HeadGone && p.Box.ReadyAction == "" {
3135 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 290, "<details class=\"d-or\"><summary class=\"mute\">or from a terminal</summary>")
3136 if templ_7745c5c3_Err != nil {
3137 return templ_7745c5c3_Err
3138 }
3139 templ_7745c5c3_Err = CloneBlock(p.Box.CLI).Render(ctx, templ_7745c5c3_Buffer)
3140 if templ_7745c5c3_Err != nil {
3141 return templ_7745c5c3_Err
3142 }
3143 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 291, "</details>")
3144 if templ_7745c5c3_Err != nil {
3145 return templ_7745c5c3_Err
3146 }
3147 }
3148 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 292, "</div></details>")
3149 if templ_7745c5c3_Err != nil {
3150 return templ_7745c5c3_Err
3151 }
3152 return nil
3153 })
3154}
3155
3156func Compare(l Layout, p ComparePage) templ.Component {
3157 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3158 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3159 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3160 return templ_7745c5c3_CtxErr
3161 }
3162 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3163 if !templ_7745c5c3_IsBuffer {
3164 defer func() {
3165 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3166 if templ_7745c5c3_Err == nil {
3167 templ_7745c5c3_Err = templ_7745c5c3_BufErr
3168 }
3169 }()
3170 }
3171 ctx = templ.InitializeContext(ctx)
3172 templ_7745c5c3_Var150 := templ.GetChildren(ctx)
3173 if templ_7745c5c3_Var150 == nil {
3174 templ_7745c5c3_Var150 = templ.NopComponent
3175 }
3176 ctx = templ.ClearChildren(ctx)
3177 templ_7745c5c3_Var151 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3178 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3179 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3180 if !templ_7745c5c3_IsBuffer {
3181 defer func() {
3182 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3183 if templ_7745c5c3_Err == nil {
3184 templ_7745c5c3_Err = templ_7745c5c3_BufErr
3185 }
3186 }()
3187 }
3188 ctx = templ.InitializeContext(ctx)
3189 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 293, "<header class=\"show mr-h\"><h1>")
3190 if templ_7745c5c3_Err != nil {
3191 return templ_7745c5c3_Err
3192 }
3193 var templ_7745c5c3_Var152 string
3194 templ_7745c5c3_Var152, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
3195 if templ_7745c5c3_Err != nil {
3196 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 620, Col: 17}
3197 }
3198 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var152))
3199 if templ_7745c5c3_Err != nil {
3200 return templ_7745c5c3_Err
3201 }
3202 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 294, " → ")
3203 if templ_7745c5c3_Err != nil {
3204 return templ_7745c5c3_Err
3205 }
3206 var templ_7745c5c3_Var153 string
3207 templ_7745c5c3_Var153, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
3208 if templ_7745c5c3_Err != nil {
3209 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 620, Col: 34}
3210 }
3211 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var153))
3212 if templ_7745c5c3_Err != nil {
3213 return templ_7745c5c3_Err
3214 }
3215 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 295, "</h1><dl class=\"kv show-kv\"><dt>branch</dt><dd><a href=\"")
3216 if templ_7745c5c3_Err != nil {
3217 return templ_7745c5c3_Err
3218 }
3219 var templ_7745c5c3_Var154 templ.SafeURL
3220 templ_7745c5c3_Var154, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.SourceHref))
3221 if templ_7745c5c3_Err != nil {
3222 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 623, Col: 45}
3223 }
3224 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var154))
3225 if templ_7745c5c3_Err != nil {
3226 return templ_7745c5c3_Err
3227 }
3228 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 296, "\">")
3229 if templ_7745c5c3_Err != nil {
3230 return templ_7745c5c3_Err
3231 }
3232 var templ_7745c5c3_Var155 string
3233 templ_7745c5c3_Var155, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
3234 if templ_7745c5c3_Err != nil {
3235 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 623, Col: 58}
3236 }
3237 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var155))
3238 if templ_7745c5c3_Err != nil {
3239 return templ_7745c5c3_Err
3240 }
3241 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 297, "</a></dd><dt>target</dt><dd><a href=\"")
3242 if templ_7745c5c3_Err != nil {
3243 return templ_7745c5c3_Err
3244 }
3245 var templ_7745c5c3_Var156 templ.SafeURL
3246 templ_7745c5c3_Var156, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.TargetHref))
3247 if templ_7745c5c3_Err != nil {
3248 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 625, Col: 45}
3249 }
3250 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var156))
3251 if templ_7745c5c3_Err != nil {
3252 return templ_7745c5c3_Err
3253 }
3254 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 298, "\">")
3255 if templ_7745c5c3_Err != nil {
3256 return templ_7745c5c3_Err
3257 }
3258 var templ_7745c5c3_Var157 string
3259 templ_7745c5c3_Var157, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
3260 if templ_7745c5c3_Err != nil {
3261 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 625, Col: 58}
3262 }
3263 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var157))
3264 if templ_7745c5c3_Err != nil {
3265 return templ_7745c5c3_Err
3266 }
3267 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 299, "</a></dd><dt>ahead</dt><dd>")
3268 if templ_7745c5c3_Err != nil {
3269 return templ_7745c5c3_Err
3270 }
3271 var templ_7745c5c3_Var158 string
3272 templ_7745c5c3_Var158, templ_7745c5c3_Err = templ.JoinStringErrs(p.AheadText)
3273 if templ_7745c5c3_Err != nil {
3274 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 627, Col: 21}
3275 }
3276 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var158))
3277 if templ_7745c5c3_Err != nil {
3278 return templ_7745c5c3_Err
3279 }
3280 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 300, "</dd></dl></header>")
3281 if templ_7745c5c3_Err != nil {
3282 return templ_7745c5c3_Err
3283 }
3284 if p.Note != "" {
3285 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 301, "<p class=\"notice\">")
3286 if templ_7745c5c3_Err != nil {
3287 return templ_7745c5c3_Err
3288 }
3289 var templ_7745c5c3_Var159 string
3290 templ_7745c5c3_Var159, templ_7745c5c3_Err = templ.JoinStringErrs(p.Note)
3291 if templ_7745c5c3_Err != nil {
3292 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 631, Col: 29}
3293 }
3294 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var159))
3295 if templ_7745c5c3_Err != nil {
3296 return templ_7745c5c3_Err
3297 }
3298 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 302, "</p>")
3299 if templ_7745c5c3_Err != nil {
3300 return templ_7745c5c3_Err
3301 }
3302 }
3303 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 303, " ")
3304 if templ_7745c5c3_Err != nil {
3305 return templ_7745c5c3_Err
3306 }
3307 if p.Existing != nil {
3308 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 304, "<p class=\"notice\">an open merge request already covers these branches: <a href=\"")
3309 if templ_7745c5c3_Err != nil {
3310 return templ_7745c5c3_Err
3311 }
3312 var templ_7745c5c3_Var160 templ.SafeURL
3313 templ_7745c5c3_Var160, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Existing.Href))
3314 if templ_7745c5c3_Err != nil {
3315 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 634, Col: 114}
3316 }
3317 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var160))
3318 if templ_7745c5c3_Err != nil {
3319 return templ_7745c5c3_Err
3320 }
3321 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 305, "\">")
3322 if templ_7745c5c3_Err != nil {
3323 return templ_7745c5c3_Err
3324 }
3325 var templ_7745c5c3_Var161 string
3326 templ_7745c5c3_Var161, templ_7745c5c3_Err = templ.JoinStringErrs(p.Existing.Label)
3327 if templ_7745c5c3_Err != nil {
3328 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 634, Col: 135}
3329 }
3330 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var161))
3331 if templ_7745c5c3_Err != nil {
3332 return templ_7745c5c3_Err
3333 }
3334 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 306, "</a></p>")
3335 if templ_7745c5c3_Err != nil {
3336 return templ_7745c5c3_Err
3337 }
3338 }
3339 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 307, " ")
3340 if templ_7745c5c3_Err != nil {
3341 return templ_7745c5c3_Err
3342 }
3343 if p.Create != nil {
3344 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 308, "<form class=\"cform create\" method=\"post\" action=\"")
3345 if templ_7745c5c3_Err != nil {
3346 return templ_7745c5c3_Err
3347 }
3348 var templ_7745c5c3_Var162 templ.SafeURL
3349 templ_7745c5c3_Var162, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Create.Action))
3350 if templ_7745c5c3_Err != nil {
3351 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 637, Col: 83}
3352 }
3353 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var162))
3354 if templ_7745c5c3_Err != nil {
3355 return templ_7745c5c3_Err
3356 }
3357 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 309, "\"><input type=\"hidden\" name=\"source\" value=\"")
3358 if templ_7745c5c3_Err != nil {
3359 return templ_7745c5c3_Err
3360 }
3361 var templ_7745c5c3_Var163 string
3362 templ_7745c5c3_Var163, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Source)
3363 if templ_7745c5c3_Err != nil {
3364 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 638, Col: 62}
3365 }
3366 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var163)
3367 if templ_7745c5c3_Err != nil {
3368 return templ_7745c5c3_Err
3369 }
3370 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 310, "\"> <input type=\"hidden\" name=\"target\" value=\"")
3371 if templ_7745c5c3_Err != nil {
3372 return templ_7745c5c3_Err
3373 }
3374 var templ_7745c5c3_Var164 string
3375 templ_7745c5c3_Var164, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Target)
3376 if templ_7745c5c3_Err != nil {
3377 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 639, Col: 62}
3378 }
3379 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var164)
3380 if templ_7745c5c3_Err != nil {
3381 return templ_7745c5c3_Err
3382 }
3383 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=\"")
3384 if templ_7745c5c3_Err != nil {
3385 return templ_7745c5c3_Err
3386 }
3387 var templ_7745c5c3_Var165 string
3388 templ_7745c5c3_Var165, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Title)
3389 if templ_7745c5c3_Err != nil {
3390 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 641, Col: 97}
3391 }
3392 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var165)
3393 if templ_7745c5c3_Err != nil {
3394 return templ_7745c5c3_Err
3395 }
3396 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>")
3397 if templ_7745c5c3_Err != nil {
3398 return templ_7745c5c3_Err
3399 }
3400 }
3401 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 313, " ")
3402 if templ_7745c5c3_Err != nil {
3403 return templ_7745c5c3_Err
3404 }
3405 if p.HasDiff {
3406 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 314, "<div class=\"diff-tools\" role=\"group\" aria-label=\"Diff view\"><span class=\"dim\">")
3407 if templ_7745c5c3_Err != nil {
3408 return templ_7745c5c3_Err
3409 }
3410 var templ_7745c5c3_Var166 string
3411 templ_7745c5c3_Var166, templ_7745c5c3_Err = templ.JoinStringErrs(plural(p.NFiles, "file", "files"))
3412 if templ_7745c5c3_Err != nil {
3413 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 651, Col: 57}
3414 }
3415 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var166))
3416 if templ_7745c5c3_Err != nil {
3417 return templ_7745c5c3_Err
3418 }
3419 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 315, " · <span class=\"plus\">+")
3420 if templ_7745c5c3_Err != nil {
3421 return templ_7745c5c3_Err
3422 }
3423 var templ_7745c5c3_Var167 string
3424 templ_7745c5c3_Var167, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Adds))
3425 if templ_7745c5c3_Err != nil {
3426 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 651, Col: 97}
3427 }
3428 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var167))
3429 if templ_7745c5c3_Err != nil {
3430 return templ_7745c5c3_Err
3431 }
3432 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 316, "</span> <span class=\"minus\">-")
3433 if templ_7745c5c3_Err != nil {
3434 return templ_7745c5c3_Err
3435 }
3436 var templ_7745c5c3_Var168 string
3437 templ_7745c5c3_Var168, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Dels))
3438 if templ_7745c5c3_Err != nil {
3439 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 651, Col: 142}
3440 }
3441 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var168))
3442 if templ_7745c5c3_Err != nil {
3443 return templ_7745c5c3_Err
3444 }
3445 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 317, "</span></span> <span class=\"grow\"></span>")
3446 if templ_7745c5c3_Err != nil {
3447 return templ_7745c5c3_Err
3448 }
3449 templ_7745c5c3_Err = viewLink(p.DiffView, "unified", "Unified", "u", p.UnifiedHref).Render(ctx, templ_7745c5c3_Buffer)
3450 if templ_7745c5c3_Err != nil {
3451 return templ_7745c5c3_Err
3452 }
3453 templ_7745c5c3_Err = viewLink(p.DiffView, "split", "Split", "d", p.SplitHref).Render(ctx, templ_7745c5c3_Buffer)
3454 if templ_7745c5c3_Err != nil {
3455 return templ_7745c5c3_Err
3456 }
3457 templ_7745c5c3_Err = collapseButton().Render(ctx, templ_7745c5c3_Buffer)
3458 if templ_7745c5c3_Err != nil {
3459 return templ_7745c5c3_Err
3460 }
3461 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 318, "</div>")
3462 if templ_7745c5c3_Err != nil {
3463 return templ_7745c5c3_Err
3464 }
3465 if p.Invisible {
3466 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>")
3467 if templ_7745c5c3_Err != nil {
3468 return templ_7745c5c3_Err
3469 }
3470 }
3471 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 320, " <div id=\"diffs\"")
3472 if templ_7745c5c3_Err != nil {
3473 return templ_7745c5c3_Err
3474 }
3475 if p.Both {
3476 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 321, " data-diff=\"")
3477 if templ_7745c5c3_Err != nil {
3478 return templ_7745c5c3_Err
3479 }
3480 var templ_7745c5c3_Var169 string
3481 templ_7745c5c3_Var169, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
3482 if templ_7745c5c3_Err != nil {
3483 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 666, Col: 23}
3484 }
3485 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var169)
3486 if templ_7745c5c3_Err != nil {
3487 return templ_7745c5c3_Err
3488 }
3489 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 322, "\"")
3490 if templ_7745c5c3_Err != nil {
3491 return templ_7745c5c3_Err
3492 }
3493 } else {
3494 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 323, " data-view=\"")
3495 if templ_7745c5c3_Err != nil {
3496 return templ_7745c5c3_Err
3497 }
3498 var templ_7745c5c3_Var170 string
3499 templ_7745c5c3_Var170, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
3500 if templ_7745c5c3_Err != nil {
3501 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 668, Col: 23}
3502 }
3503 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var170)
3504 if templ_7745c5c3_Err != nil {
3505 return templ_7745c5c3_Err
3506 }
3507 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 324, "\"")
3508 if templ_7745c5c3_Err != nil {
3509 return templ_7745c5c3_Err
3510 }
3511 }
3512 if p.Both && !p.Pinned {
3513 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 325, " hx-live=\"this.dataset.diff = sessionStorage.getItem('diff') || this.dataset.diff\"")
3514 if templ_7745c5c3_Err != nil {
3515 return templ_7745c5c3_Err
3516 }
3517 }
3518 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 326, ">")
3519 if templ_7745c5c3_Err != nil {
3520 return templ_7745c5c3_Err
3521 }
3522 for _, f := range p.Files {
3523 templ_7745c5c3_Err = DiffFileView(f, p.DiffView).Render(ctx, templ_7745c5c3_Buffer)
3524 if templ_7745c5c3_Err != nil {
3525 return templ_7745c5c3_Err
3526 }
3527 }
3528 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 327, "</div>")
3529 if templ_7745c5c3_Err != nil {
3530 return templ_7745c5c3_Err
3531 }
3532 }
3533 return nil
3534 })
3535 templ_7745c5c3_Err = Shell(l, compareRail(p)).Render(templ.WithChildren(ctx, templ_7745c5c3_Var151), templ_7745c5c3_Buffer)
3536 if templ_7745c5c3_Err != nil {
3537 return templ_7745c5c3_Err
3538 }
3539 return nil
3540 })
3541}
3542
3543func compareRail(p ComparePage) templ.Component {
3544 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3545 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3546 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3547 return templ_7745c5c3_CtxErr
3548 }
3549 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3550 if !templ_7745c5c3_IsBuffer {
3551 defer func() {
3552 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3553 if templ_7745c5c3_Err == nil {
3554 templ_7745c5c3_Err = templ_7745c5c3_BufErr
3555 }
3556 }()
3557 }
3558 ctx = templ.InitializeContext(ctx)
3559 templ_7745c5c3_Var171 := templ.GetChildren(ctx)
3560 if templ_7745c5c3_Var171 == nil {
3561 templ_7745c5c3_Var171 = templ.NopComponent
3562 }
3563 ctx = templ.ClearChildren(ctx)
3564 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 328, "<section aria-labelledby=\"r-ahead\"><h2 id=\"r-ahead\">Commits <span class=\"count\">")
3565 if templ_7745c5c3_Err != nil {
3566 return templ_7745c5c3_Err
3567 }
3568 var templ_7745c5c3_Var172 string
3569 templ_7745c5c3_Var172, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Ahead)))
3570 if templ_7745c5c3_Err != nil {
3571 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 684, Col: 67}
3572 }
3573 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var172))
3574 if templ_7745c5c3_Err != nil {
3575 return templ_7745c5c3_Err
3576 }
3577 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 329, "</span></h2><ul class=\"pcommits\">")
3578 if templ_7745c5c3_Err != nil {
3579 return templ_7745c5c3_Err
3580 }
3581 for _, c := range p.Ahead {
3582 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 330, "<li><a href=\"")
3583 if templ_7745c5c3_Err != nil {
3584 return templ_7745c5c3_Err
3585 }
3586 var templ_7745c5c3_Var173 templ.SafeURL
3587 templ_7745c5c3_Var173, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.CHref))
3588 if templ_7745c5c3_Err != nil {
3589 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 688, Col: 37}
3590 }
3591 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var173))
3592 if templ_7745c5c3_Err != nil {
3593 return templ_7745c5c3_Err
3594 }
3595 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 331, "\">")
3596 if templ_7745c5c3_Err != nil {
3597 return templ_7745c5c3_Err
3598 }
3599 var templ_7745c5c3_Var174 string
3600 templ_7745c5c3_Var174, templ_7745c5c3_Err = templ.JoinStringErrs(c.Short)
3601 if templ_7745c5c3_Err != nil {
3602 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 688, Col: 49}
3603 }
3604 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var174))
3605 if templ_7745c5c3_Err != nil {
3606 return templ_7745c5c3_Err
3607 }
3608 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 332, "</a> <span class=\"s\">")
3609 if templ_7745c5c3_Err != nil {
3610 return templ_7745c5c3_Err
3611 }
3612 var templ_7745c5c3_Var175 string
3613 templ_7745c5c3_Var175, templ_7745c5c3_Err = templ.JoinStringErrs(c.Subject)
3614 if templ_7745c5c3_Err != nil {
3615 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 689, Col: 32}
3616 }
3617 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var175))
3618 if templ_7745c5c3_Err != nil {
3619 return templ_7745c5c3_Err
3620 }
3621 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 333, "</span> <span class=\"mute\">")
3622 if templ_7745c5c3_Err != nil {
3623 return templ_7745c5c3_Err
3624 }
3625 var templ_7745c5c3_Var176 string
3626 templ_7745c5c3_Var176, templ_7745c5c3_Err = templ.JoinStringErrs(c.Author)
3627 if templ_7745c5c3_Err != nil {
3628 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 691, Col: 16}
3629 }
3630 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var176))
3631 if templ_7745c5c3_Err != nil {
3632 return templ_7745c5c3_Err
3633 }
3634 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 334, " ")
3635 if templ_7745c5c3_Err != nil {
3636 return templ_7745c5c3_Err
3637 }
3638 if c.WhenAt != "" {
3639 var templ_7745c5c3_Var177 string
3640 templ_7745c5c3_Var177, templ_7745c5c3_Err = templ.JoinStringErrs(" · ")
3641 if templ_7745c5c3_Err != nil {
3642 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 693, Col: 15}
3643 }
3644 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var177))
3645 if templ_7745c5c3_Err != nil {
3646 return templ_7745c5c3_Err
3647 }
3648 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 335, "<time datetime=\"")
3649 if templ_7745c5c3_Err != nil {
3650 return templ_7745c5c3_Err
3651 }
3652 var templ_7745c5c3_Var178 string
3653 templ_7745c5c3_Var178, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.WhenAt)
3654 if templ_7745c5c3_Err != nil {
3655 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 693, Col: 42}
3656 }
3657 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var178)
3658 if templ_7745c5c3_Err != nil {
3659 return templ_7745c5c3_Err
3660 }
3661 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 336, "\">")
3662 if templ_7745c5c3_Err != nil {
3663 return templ_7745c5c3_Err
3664 }
3665 var templ_7745c5c3_Var179 string
3666 templ_7745c5c3_Var179, templ_7745c5c3_Err = templ.JoinStringErrs(c.When)
3667 if templ_7745c5c3_Err != nil {
3668 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 693, Col: 53}
3669 }
3670 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var179))
3671 if templ_7745c5c3_Err != nil {
3672 return templ_7745c5c3_Err
3673 }
3674 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 337, "</time>")
3675 if templ_7745c5c3_Err != nil {
3676 return templ_7745c5c3_Err
3677 }
3678 }
3679 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 338, "</span></li>")
3680 if templ_7745c5c3_Err != nil {
3681 return templ_7745c5c3_Err
3682 }
3683 }
3684 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 339, "</ul>")
3685 if templ_7745c5c3_Err != nil {
3686 return templ_7745c5c3_Err
3687 }
3688 if len(p.Ahead) == 0 {
3689 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 340, "<p class=\"dim\">no commit ahead of ")
3690 if templ_7745c5c3_Err != nil {
3691 return templ_7745c5c3_Err
3692 }
3693 var templ_7745c5c3_Var180 string
3694 templ_7745c5c3_Var180, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
3695 if templ_7745c5c3_Err != nil {
3696 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 700, Col: 47}
3697 }
3698 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var180))
3699 if templ_7745c5c3_Err != nil {
3700 return templ_7745c5c3_Err
3701 }
3702 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 341, ".</p>")
3703 if templ_7745c5c3_Err != nil {
3704 return templ_7745c5c3_Err
3705 }
3706 }
3707 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 342, "</section>")
3708 if templ_7745c5c3_Err != nil {
3709 return templ_7745c5c3_Err
3710 }
3711 if p.HasDiff {
3712 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 343, "<section aria-labelledby=\"r-files\"><h2 id=\"r-files\">Files <span class=\"count\">")
3713 if templ_7745c5c3_Err != nil {
3714 return templ_7745c5c3_Err
3715 }
3716 var templ_7745c5c3_Var181 string
3717 templ_7745c5c3_Var181, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Files)))
3718 if templ_7745c5c3_Err != nil {
3719 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 705, Col: 66}
3720 }
3721 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var181))
3722 if templ_7745c5c3_Err != nil {
3723 return templ_7745c5c3_Err
3724 }
3725 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 344, "</span></h2>")
3726 if templ_7745c5c3_Err != nil {
3727 return templ_7745c5c3_Err
3728 }
3729 templ_7745c5c3_Err = FileList(p.Files).Render(ctx, templ_7745c5c3_Buffer)
3730 if templ_7745c5c3_Err != nil {
3731 return templ_7745c5c3_Err
3732 }
3733 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 345, "</section>")
3734 if templ_7745c5c3_Err != nil {
3735 return templ_7745c5c3_Err
3736 }
3737 }
3738 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 346, "<section aria-labelledby=\"r-cli\"><h2 id=\"r-cli\">From a terminal</h2>")
3739 if templ_7745c5c3_Err != nil {
3740 return templ_7745c5c3_Err
3741 }
3742 templ_7745c5c3_Err = CloneBlock(p.CLI).Render(ctx, templ_7745c5c3_Buffer)
3743 if templ_7745c5c3_Err != nil {
3744 return templ_7745c5c3_Err
3745 }
3746 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 347, "</section>")
3747 if templ_7745c5c3_Err != nil {
3748 return templ_7745c5c3_Err
3749 }
3750 return nil
3751 })
3752}
3753
3754var _ = templruntime.GeneratedTemplate