1// Code generated by templ - DO NOT EDIT.
2
3// templ: version: v0.3.1020
4package web
5
6//lint:file-ignore SA4006 This context is only used if a nested component is present.
7
8import "github.com/a-h/templ"
9import templruntime "github.com/a-h/templ/runtime"
10
11// The CI pages: the runs of a repository, a run with its jobs, a job with its
12// steps and its log (actions.go). A state is always a word as well as a
13// symbol and a colour.
14
15// CheckIcon is the symbol of a state: a mark in the colour of its kind, with
16// the state as its text for a screen reader.
17func CheckIcon(kind, state string) templ.Component {
18 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
19 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
20 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
21 return templ_7745c5c3_CtxErr
22 }
23 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
24 if !templ_7745c5c3_IsBuffer {
25 defer func() {
26 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
27 if templ_7745c5c3_Err == nil {
28 templ_7745c5c3_Err = templ_7745c5c3_BufErr
29 }
30 }()
31 }
32 ctx = templ.InitializeContext(ctx)
33 templ_7745c5c3_Var1 := templ.GetChildren(ctx)
34 if templ_7745c5c3_Var1 == nil {
35 templ_7745c5c3_Var1 = templ.NopComponent
36 }
37 ctx = templ.ClearChildren(ctx)
38 var templ_7745c5c3_Var2 = []any{"ck", "ck-" + kind}
39 templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...)
40 if templ_7745c5c3_Err != nil {
41 return templ_7745c5c3_Err
42 }
43 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<span class=\"")
44 if templ_7745c5c3_Err != nil {
45 return templ_7745c5c3_Err
46 }
47 var templ_7745c5c3_Var3 string
48 templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.ResolveAttributeValue(templ.CSSClasses(templ_7745c5c3_Var2).String())
49 if templ_7745c5c3_Err != nil {
50 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 1, Col: 0}
51 }
52 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var3)
53 if templ_7745c5c3_Err != nil {
54 return templ_7745c5c3_Err
55 }
56 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\" role=\"img\" aria-label=\"")
57 if templ_7745c5c3_Err != nil {
58 return templ_7745c5c3_Err
59 }
60 var templ_7745c5c3_Var4 string
61 templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.ResolveAttributeValue(state)
62 if templ_7745c5c3_Err != nil {
63 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 10, Col: 65}
64 }
65 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var4)
66 if templ_7745c5c3_Err != nil {
67 return templ_7745c5c3_Err
68 }
69 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\" title=\"")
70 if templ_7745c5c3_Err != nil {
71 return templ_7745c5c3_Err
72 }
73 var templ_7745c5c3_Var5 string
74 templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.ResolveAttributeValue(state)
75 if templ_7745c5c3_Err != nil {
76 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 10, Col: 81}
77 }
78 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var5)
79 if templ_7745c5c3_Err != nil {
80 return templ_7745c5c3_Err
81 }
82 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\"></span>")
83 if templ_7745c5c3_Err != nil {
84 return templ_7745c5c3_Err
85 }
86 return nil
87 })
88}
89
90func Actions(l Layout, p ActionsPage) templ.Component {
91 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
92 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
93 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
94 return templ_7745c5c3_CtxErr
95 }
96 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
97 if !templ_7745c5c3_IsBuffer {
98 defer func() {
99 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
100 if templ_7745c5c3_Err == nil {
101 templ_7745c5c3_Err = templ_7745c5c3_BufErr
102 }
103 }()
104 }
105 ctx = templ.InitializeContext(ctx)
106 templ_7745c5c3_Var6 := templ.GetChildren(ctx)
107 if templ_7745c5c3_Var6 == nil {
108 templ_7745c5c3_Var6 = templ.NopComponent
109 }
110 ctx = templ.ClearChildren(ctx)
111 templ_7745c5c3_Var7 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
112 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
113 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
114 if !templ_7745c5c3_IsBuffer {
115 defer func() {
116 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
117 if templ_7745c5c3_Err == nil {
118 templ_7745c5c3_Err = templ_7745c5c3_BufErr
119 }
120 }()
121 }
122 ctx = templ.InitializeContext(ctx)
123 if len(p.Runs) == 0 {
124 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<p class=\"dim\">no runs yet: a push that matches a workflow of .github/workflows starts one.</p>")
125 if templ_7745c5c3_Err != nil {
126 return templ_7745c5c3_Err
127 }
128 } else {
129 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "<table class=\"list runs\" aria-label=\"Runs\"><thead><tr><th class=\"c-st\"></th><th class=\"c-name\">workflow</th><th class=\"c-sub\">commit</th><th class=\"c-ref\">ref</th><th class=\"c-who\">actor</th><th class=\"c-dur\">time</th><th class=\"c-when\">created</th></tr></thead> <tbody id=\"run-rows\" data-rows>")
130 if templ_7745c5c3_Err != nil {
131 return templ_7745c5c3_Err
132 }
133 for _, r := range p.Runs {
134 templ_7745c5c3_Err = RunListRow(r).Render(ctx, templ_7745c5c3_Buffer)
135 if templ_7745c5c3_Err != nil {
136 return templ_7745c5c3_Err
137 }
138 }
139 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</tbody></table>")
140 if templ_7745c5c3_Err != nil {
141 return templ_7745c5c3_Err
142 }
143 }
144 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, " ")
145 if templ_7745c5c3_Err != nil {
146 return templ_7745c5c3_Err
147 }
148 if p.More != "" {
149 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "<p class=\"more\"><a href=\"")
150 if templ_7745c5c3_Err != nil {
151 return templ_7745c5c3_Err
152 }
153 var templ_7745c5c3_Var8 templ.SafeURL
154 templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.More))
155 if templ_7745c5c3_Err != nil {
156 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 30, Col: 50}
157 }
158 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
159 if templ_7745c5c3_Err != nil {
160 return templ_7745c5c3_Err
161 }
162 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "\" rel=\"next\">older runs</a></p>")
163 if templ_7745c5c3_Err != nil {
164 return templ_7745c5c3_Err
165 }
166 }
167 return nil
168 })
169 templ_7745c5c3_Err = Shell(l, nil).Render(templ.WithChildren(ctx, templ_7745c5c3_Var7), templ_7745c5c3_Buffer)
170 if templ_7745c5c3_Err != nil {
171 return templ_7745c5c3_Err
172 }
173 return nil
174 })
175}
176
177// RunListRow is a row of the list of runs; its id is the target of the live
178// updates.
179func RunListRow(r RunRow) templ.Component {
180 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
181 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
182 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
183 return templ_7745c5c3_CtxErr
184 }
185 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
186 if !templ_7745c5c3_IsBuffer {
187 defer func() {
188 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
189 if templ_7745c5c3_Err == nil {
190 templ_7745c5c3_Err = templ_7745c5c3_BufErr
191 }
192 }()
193 }
194 ctx = templ.InitializeContext(ctx)
195 templ_7745c5c3_Var9 := templ.GetChildren(ctx)
196 if templ_7745c5c3_Var9 == nil {
197 templ_7745c5c3_Var9 = templ.NopComponent
198 }
199 ctx = templ.ClearChildren(ctx)
200 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "<tr id=\"")
201 if templ_7745c5c3_Err != nil {
202 return templ_7745c5c3_Err
203 }
204 var templ_7745c5c3_Var10 string
205 templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.ResolveAttributeValue("run-" + r.ID)
206 if templ_7745c5c3_Err != nil {
207 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 38, Col: 23}
208 }
209 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10)
210 if templ_7745c5c3_Err != nil {
211 return templ_7745c5c3_Err
212 }
213 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "\"><td class=\"c-st\">")
214 if templ_7745c5c3_Err != nil {
215 return templ_7745c5c3_Err
216 }
217 templ_7745c5c3_Err = CheckIcon(r.Kind, r.State).Render(ctx, templ_7745c5c3_Buffer)
218 if templ_7745c5c3_Err != nil {
219 return templ_7745c5c3_Err
220 }
221 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "</td><td class=\"c-name\"><a href=\"")
222 if templ_7745c5c3_Err != nil {
223 return templ_7745c5c3_Err
224 }
225 var templ_7745c5c3_Var11 templ.SafeURL
226 templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(r.Href))
227 if templ_7745c5c3_Err != nil {
228 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 41, Col: 34}
229 }
230 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
231 if templ_7745c5c3_Err != nil {
232 return templ_7745c5c3_Err
233 }
234 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "\">")
235 if templ_7745c5c3_Err != nil {
236 return templ_7745c5c3_Err
237 }
238 var templ_7745c5c3_Var12 string
239 templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(r.Workflow)
240 if templ_7745c5c3_Err != nil {
241 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 41, Col: 49}
242 }
243 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
244 if templ_7745c5c3_Err != nil {
245 return templ_7745c5c3_Err
246 }
247 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "</a> <span class=\"mute\">")
248 if templ_7745c5c3_Err != nil {
249 return templ_7745c5c3_Err
250 }
251 var templ_7745c5c3_Var13 string
252 templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(r.Number)
253 if templ_7745c5c3_Err != nil {
254 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 42, Col: 32}
255 }
256 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
257 if templ_7745c5c3_Err != nil {
258 return templ_7745c5c3_Err
259 }
260 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "</span> ")
261 if templ_7745c5c3_Err != nil {
262 return templ_7745c5c3_Err
263 }
264 if r.Attempt > 1 {
265 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "<span class=\"pill\">attempt ")
266 if templ_7745c5c3_Err != nil {
267 return templ_7745c5c3_Err
268 }
269 var templ_7745c5c3_Var14 string
270 templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(int(r.Attempt)))
271 if templ_7745c5c3_Err != nil {
272 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 44, Col: 53}
273 }
274 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
275 if templ_7745c5c3_Err != nil {
276 return templ_7745c5c3_Err
277 }
278 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "</span>")
279 if templ_7745c5c3_Err != nil {
280 return templ_7745c5c3_Err
281 }
282 }
283 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "</td><td class=\"c-sub\"><a href=\"")
284 if templ_7745c5c3_Err != nil {
285 return templ_7745c5c3_Err
286 }
287 var templ_7745c5c3_Var15 templ.SafeURL
288 templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(r.CHref))
289 if templ_7745c5c3_Err != nil {
290 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 47, Col: 52}
291 }
292 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
293 if templ_7745c5c3_Err != nil {
294 return templ_7745c5c3_Err
295 }
296 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "\">")
297 if templ_7745c5c3_Err != nil {
298 return templ_7745c5c3_Err
299 }
300 var templ_7745c5c3_Var16 string
301 templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(r.Short)
302 if templ_7745c5c3_Err != nil {
303 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 47, Col: 64}
304 }
305 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
306 if templ_7745c5c3_Err != nil {
307 return templ_7745c5c3_Err
308 }
309 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "</a> ")
310 if templ_7745c5c3_Err != nil {
311 return templ_7745c5c3_Err
312 }
313 var templ_7745c5c3_Var17 string
314 templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(r.Title)
315 if templ_7745c5c3_Err != nil {
316 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 47, Col: 80}
317 }
318 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
319 if templ_7745c5c3_Err != nil {
320 return templ_7745c5c3_Err
321 }
322 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</td><td class=\"c-ref\"><a href=\"")
323 if templ_7745c5c3_Err != nil {
324 return templ_7745c5c3_Err
325 }
326 var templ_7745c5c3_Var18 templ.SafeURL
327 templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(r.RefHref))
328 if templ_7745c5c3_Err != nil {
329 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 48, Col: 54}
330 }
331 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
332 if templ_7745c5c3_Err != nil {
333 return templ_7745c5c3_Err
334 }
335 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "\">")
336 if templ_7745c5c3_Err != nil {
337 return templ_7745c5c3_Err
338 }
339 var templ_7745c5c3_Var19 string
340 templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(r.Ref)
341 if templ_7745c5c3_Err != nil {
342 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 48, Col: 64}
343 }
344 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
345 if templ_7745c5c3_Err != nil {
346 return templ_7745c5c3_Err
347 }
348 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "</a></td><td class=\"c-who dim\">")
349 if templ_7745c5c3_Err != nil {
350 return templ_7745c5c3_Err
351 }
352 var templ_7745c5c3_Var20 string
353 templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(r.Actor)
354 if templ_7745c5c3_Err != nil {
355 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 49, Col: 33}
356 }
357 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
358 if templ_7745c5c3_Err != nil {
359 return templ_7745c5c3_Err
360 }
361 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "</td><td class=\"c-dur dim\">")
362 if templ_7745c5c3_Err != nil {
363 return templ_7745c5c3_Err
364 }
365 var templ_7745c5c3_Var21 string
366 templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(r.State)
367 if templ_7745c5c3_Err != nil {
368 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 50, Col: 33}
369 }
370 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
371 if templ_7745c5c3_Err != nil {
372 return templ_7745c5c3_Err
373 }
374 var templ_7745c5c3_Var22 string
375 templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
376 if templ_7745c5c3_Err != nil {
377 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 50, Col: 40}
378 }
379 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
380 if templ_7745c5c3_Err != nil {
381 return templ_7745c5c3_Err
382 }
383 var templ_7745c5c3_Var23 string
384 templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(r.Duration)
385 if templ_7745c5c3_Err != nil {
386 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 50, Col: 54}
387 }
388 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
389 if templ_7745c5c3_Err != nil {
390 return templ_7745c5c3_Err
391 }
392 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "</td><td class=\"c-when dim\">")
393 if templ_7745c5c3_Err != nil {
394 return templ_7745c5c3_Err
395 }
396 if r.WhenAt != "" {
397 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "<time datetime=\"")
398 if templ_7745c5c3_Err != nil {
399 return templ_7745c5c3_Err
400 }
401 var templ_7745c5c3_Var24 string
402 templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.ResolveAttributeValue(r.WhenAt)
403 if templ_7745c5c3_Err != nil {
404 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 53, Col: 29}
405 }
406 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24)
407 if templ_7745c5c3_Err != nil {
408 return templ_7745c5c3_Err
409 }
410 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "\" title=\"")
411 if templ_7745c5c3_Err != nil {
412 return templ_7745c5c3_Err
413 }
414 var templ_7745c5c3_Var25 string
415 templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.ResolveAttributeValue(r.WhenAt)
416 if templ_7745c5c3_Err != nil {
417 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 53, Col: 48}
418 }
419 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var25)
420 if templ_7745c5c3_Err != nil {
421 return templ_7745c5c3_Err
422 }
423 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "\">")
424 if templ_7745c5c3_Err != nil {
425 return templ_7745c5c3_Err
426 }
427 var templ_7745c5c3_Var26 string
428 templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(r.When)
429 if templ_7745c5c3_Err != nil {
430 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 53, Col: 59}
431 }
432 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
433 if templ_7745c5c3_Err != nil {
434 return templ_7745c5c3_Err
435 }
436 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "</time>")
437 if templ_7745c5c3_Err != nil {
438 return templ_7745c5c3_Err
439 }
440 }
441 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "</td></tr>")
442 if templ_7745c5c3_Err != nil {
443 return templ_7745c5c3_Err
444 }
445 return nil
446 })
447}
448
449func RunDetail(l Layout, p RunPage) templ.Component {
450 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
451 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
452 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
453 return templ_7745c5c3_CtxErr
454 }
455 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
456 if !templ_7745c5c3_IsBuffer {
457 defer func() {
458 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
459 if templ_7745c5c3_Err == nil {
460 templ_7745c5c3_Err = templ_7745c5c3_BufErr
461 }
462 }()
463 }
464 ctx = templ.InitializeContext(ctx)
465 templ_7745c5c3_Var27 := templ.GetChildren(ctx)
466 if templ_7745c5c3_Var27 == nil {
467 templ_7745c5c3_Var27 = templ.NopComponent
468 }
469 ctx = templ.ClearChildren(ctx)
470 templ_7745c5c3_Var28 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
471 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
472 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
473 if !templ_7745c5c3_IsBuffer {
474 defer func() {
475 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
476 if templ_7745c5c3_Err == nil {
477 templ_7745c5c3_Err = templ_7745c5c3_BufErr
478 }
479 }()
480 }
481 ctx = templ.InitializeContext(ctx)
482 templ_7745c5c3_Err = LiveSlot("run-notice").Render(ctx, templ_7745c5c3_Buffer)
483 if templ_7745c5c3_Err != nil {
484 return templ_7745c5c3_Err
485 }
486 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, " <div id=\"run-body\">")
487 if templ_7745c5c3_Err != nil {
488 return templ_7745c5c3_Err
489 }
490 templ_7745c5c3_Err = RunBody(p).Render(ctx, templ_7745c5c3_Buffer)
491 if templ_7745c5c3_Err != nil {
492 return templ_7745c5c3_Err
493 }
494 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "</div>")
495 if templ_7745c5c3_Err != nil {
496 return templ_7745c5c3_Err
497 }
498 templ_7745c5c3_Err = RunSummaries(p.Summaries, p.SummariesMore).Render(ctx, templ_7745c5c3_Buffer)
499 if templ_7745c5c3_Err != nil {
500 return templ_7745c5c3_Err
501 }
502 return nil
503 })
504 templ_7745c5c3_Err = Shell(l, runRail(p)).Render(templ.WithChildren(ctx, templ_7745c5c3_Var28), templ_7745c5c3_Buffer)
505 if templ_7745c5c3_Err != nil {
506 return templ_7745c5c3_Err
507 }
508 return nil
509 })
510}
511
512// runBodyFragment is the body of the run page as a live fragment.
513func runBodyFragment(p RunPage) templ.Component {
514 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
515 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
516 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
517 return templ_7745c5c3_CtxErr
518 }
519 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
520 if !templ_7745c5c3_IsBuffer {
521 defer func() {
522 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
523 if templ_7745c5c3_Err == nil {
524 templ_7745c5c3_Err = templ_7745c5c3_BufErr
525 }
526 }()
527 }
528 ctx = templ.InitializeContext(ctx)
529 templ_7745c5c3_Var29 := templ.GetChildren(ctx)
530 if templ_7745c5c3_Var29 == nil {
531 templ_7745c5c3_Var29 = templ.NopComponent
532 }
533 ctx = templ.ClearChildren(ctx)
534 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "<div id=\"run-body\">")
535 if templ_7745c5c3_Err != nil {
536 return templ_7745c5c3_Err
537 }
538 templ_7745c5c3_Err = RunBody(p).Render(ctx, templ_7745c5c3_Buffer)
539 if templ_7745c5c3_Err != nil {
540 return templ_7745c5c3_Err
541 }
542 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "</div>")
543 if templ_7745c5c3_Err != nil {
544 return templ_7745c5c3_Err
545 }
546 return nil
547 })
548}
549
550// RunBody is the jobs of a run, replaced by the live updates.
551func RunBody(p RunPage) templ.Component {
552 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
553 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
554 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
555 return templ_7745c5c3_CtxErr
556 }
557 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
558 if !templ_7745c5c3_IsBuffer {
559 defer func() {
560 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
561 if templ_7745c5c3_Err == nil {
562 templ_7745c5c3_Err = templ_7745c5c3_BufErr
563 }
564 }()
565 }
566 ctx = templ.InitializeContext(ctx)
567 templ_7745c5c3_Var30 := templ.GetChildren(ctx)
568 if templ_7745c5c3_Var30 == nil {
569 templ_7745c5c3_Var30 = templ.NopComponent
570 }
571 ctx = templ.ClearChildren(ctx)
572 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "<h2 class=\"run-h\">")
573 if templ_7745c5c3_Err != nil {
574 return templ_7745c5c3_Err
575 }
576 templ_7745c5c3_Err = CheckIcon(p.Kind, p.State).Render(ctx, templ_7745c5c3_Buffer)
577 if templ_7745c5c3_Err != nil {
578 return templ_7745c5c3_Err
579 }
580 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "<span>")
581 if templ_7745c5c3_Err != nil {
582 return templ_7745c5c3_Err
583 }
584 var templ_7745c5c3_Var31 string
585 templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(p.Workflow)
586 if templ_7745c5c3_Err != nil {
587 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 78, Col: 64}
588 }
589 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
590 if templ_7745c5c3_Err != nil {
591 return templ_7745c5c3_Err
592 }
593 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "</span> <span class=\"mute\">")
594 if templ_7745c5c3_Err != nil {
595 return templ_7745c5c3_Err
596 }
597 var templ_7745c5c3_Var32 string
598 templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(p.Number)
599 if templ_7745c5c3_Err != nil {
600 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 78, Col: 103}
601 }
602 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
603 if templ_7745c5c3_Err != nil {
604 return templ_7745c5c3_Err
605 }
606 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "</span></h2>")
607 if templ_7745c5c3_Err != nil {
608 return templ_7745c5c3_Err
609 }
610 if p.Error != "" {
611 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "<pre class=\"run-err\">")
612 if templ_7745c5c3_Err != nil {
613 return templ_7745c5c3_Err
614 }
615 var templ_7745c5c3_Var33 string
616 templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(p.Error)
617 if templ_7745c5c3_Err != nil {
618 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 80, Col: 32}
619 }
620 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33))
621 if templ_7745c5c3_Err != nil {
622 return templ_7745c5c3_Err
623 }
624 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "</pre>")
625 if templ_7745c5c3_Err != nil {
626 return templ_7745c5c3_Err
627 }
628 }
629 if len(p.Annotations) > 0 {
630 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "<section class=\"annots\" aria-labelledby=\"run-annots\"><h3 id=\"run-annots\">Annotations <span class=\"count\">")
631 if templ_7745c5c3_Err != nil {
632 return templ_7745c5c3_Err
633 }
634 var templ_7745c5c3_Var34 string
635 templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Annotations)))
636 if templ_7745c5c3_Err != nil {
637 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 84, Col: 81}
638 }
639 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34))
640 if templ_7745c5c3_Err != nil {
641 return templ_7745c5c3_Err
642 }
643 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "</span></h3>")
644 if templ_7745c5c3_Err != nil {
645 return templ_7745c5c3_Err
646 }
647 templ_7745c5c3_Err = AnnotationList(p.Annotations, p.AnnotationsMore, false).Render(ctx, templ_7745c5c3_Buffer)
648 if templ_7745c5c3_Err != nil {
649 return templ_7745c5c3_Err
650 }
651 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "</section>")
652 if templ_7745c5c3_Err != nil {
653 return templ_7745c5c3_Err
654 }
655 }
656 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "<ul class=\"jobs\">")
657 if templ_7745c5c3_Err != nil {
658 return templ_7745c5c3_Err
659 }
660 for _, j := range p.Jobs {
661 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "<li id=\"")
662 if templ_7745c5c3_Err != nil {
663 return templ_7745c5c3_Err
664 }
665 var templ_7745c5c3_Var35 string
666 templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.ResolveAttributeValue("job-" + j.ID)
667 if templ_7745c5c3_Err != nil {
668 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 90, Col: 25}
669 }
670 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var35)
671 if templ_7745c5c3_Err != nil {
672 return templ_7745c5c3_Err
673 }
674 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "\"><a class=\"job-h\" href=\"")
675 if templ_7745c5c3_Err != nil {
676 return templ_7745c5c3_Err
677 }
678 var templ_7745c5c3_Var36 templ.SafeURL
679 templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(j.Href))
680 if templ_7745c5c3_Err != nil {
681 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 91, Col: 49}
682 }
683 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36))
684 if templ_7745c5c3_Err != nil {
685 return templ_7745c5c3_Err
686 }
687 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "\">")
688 if templ_7745c5c3_Err != nil {
689 return templ_7745c5c3_Err
690 }
691 templ_7745c5c3_Err = CheckIcon(j.Kind, j.State).Render(ctx, templ_7745c5c3_Buffer)
692 if templ_7745c5c3_Err != nil {
693 return templ_7745c5c3_Err
694 }
695 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "<span class=\"j-name\">")
696 if templ_7745c5c3_Err != nil {
697 return templ_7745c5c3_Err
698 }
699 var templ_7745c5c3_Var37 string
700 templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(j.Name)
701 if templ_7745c5c3_Err != nil {
702 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 93, Col: 34}
703 }
704 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
705 if templ_7745c5c3_Err != nil {
706 return templ_7745c5c3_Err
707 }
708 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "</span> <span class=\"dim\">")
709 if templ_7745c5c3_Err != nil {
710 return templ_7745c5c3_Err
711 }
712 var templ_7745c5c3_Var38 string
713 templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.JoinStringErrs(j.State)
714 if templ_7745c5c3_Err != nil {
715 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 94, Col: 32}
716 }
717 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var38))
718 if templ_7745c5c3_Err != nil {
719 return templ_7745c5c3_Err
720 }
721 var templ_7745c5c3_Var39 string
722 templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
723 if templ_7745c5c3_Err != nil {
724 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 94, Col: 39}
725 }
726 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39))
727 if templ_7745c5c3_Err != nil {
728 return templ_7745c5c3_Err
729 }
730 var templ_7745c5c3_Var40 string
731 templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.JoinStringErrs(j.Duration)
732 if templ_7745c5c3_Err != nil {
733 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 94, Col: 53}
734 }
735 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var40))
736 if templ_7745c5c3_Err != nil {
737 return templ_7745c5c3_Err
738 }
739 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "</span></a> ")
740 if templ_7745c5c3_Err != nil {
741 return templ_7745c5c3_Err
742 }
743 if j.Runner != "" {
744 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "<span class=\"mute\">on ")
745 if templ_7745c5c3_Err != nil {
746 return templ_7745c5c3_Err
747 }
748 var templ_7745c5c3_Var41 string
749 templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(runnerText(j))
750 if templ_7745c5c3_Err != nil {
751 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 97, Col: 42}
752 }
753 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41))
754 if templ_7745c5c3_Err != nil {
755 return templ_7745c5c3_Err
756 }
757 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "</span> ")
758 if templ_7745c5c3_Err != nil {
759 return templ_7745c5c3_Err
760 }
761 }
762 if len(j.Needs) > 0 {
763 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "<span class=\"mute\">needs ")
764 if templ_7745c5c3_Err != nil {
765 return templ_7745c5c3_Err
766 }
767 var templ_7745c5c3_Var42 string
768 templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinStringErrs(joinWords(j.Needs))
769 if templ_7745c5c3_Err != nil {
770 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 100, Col: 50}
771 }
772 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42))
773 if templ_7745c5c3_Err != nil {
774 return templ_7745c5c3_Err
775 }
776 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "</span> ")
777 if templ_7745c5c3_Err != nil {
778 return templ_7745c5c3_Err
779 }
780 }
781 if j.Error != "" {
782 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "<p class=\"job-err\">")
783 if templ_7745c5c3_Err != nil {
784 return templ_7745c5c3_Err
785 }
786 var templ_7745c5c3_Var43 string
787 templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(j.Error)
788 if templ_7745c5c3_Err != nil {
789 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 103, Col: 33}
790 }
791 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43))
792 if templ_7745c5c3_Err != nil {
793 return templ_7745c5c3_Err
794 }
795 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "</p>")
796 if templ_7745c5c3_Err != nil {
797 return templ_7745c5c3_Err
798 }
799 }
800 if len(j.Steps) > 0 {
801 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "<ol class=\"steps\">")
802 if templ_7745c5c3_Err != nil {
803 return templ_7745c5c3_Err
804 }
805 for _, s := range j.Steps {
806 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "<li>")
807 if templ_7745c5c3_Err != nil {
808 return templ_7745c5c3_Err
809 }
810 templ_7745c5c3_Err = CheckIcon(s.Kind, s.State).Render(ctx, templ_7745c5c3_Buffer)
811 if templ_7745c5c3_Err != nil {
812 return templ_7745c5c3_Err
813 }
814 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "<span>")
815 if templ_7745c5c3_Err != nil {
816 return templ_7745c5c3_Err
817 }
818 var templ_7745c5c3_Var44 string
819 templ_7745c5c3_Var44, templ_7745c5c3_Err = templ.JoinStringErrs(s.Name)
820 if templ_7745c5c3_Err != nil {
821 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 108, Col: 53}
822 }
823 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var44))
824 if templ_7745c5c3_Err != nil {
825 return templ_7745c5c3_Err
826 }
827 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "</span> <span class=\"dim\">")
828 if templ_7745c5c3_Err != nil {
829 return templ_7745c5c3_Err
830 }
831 var templ_7745c5c3_Var45 string
832 templ_7745c5c3_Var45, templ_7745c5c3_Err = templ.JoinStringErrs(s.Duration)
833 if templ_7745c5c3_Err != nil {
834 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 108, Col: 93}
835 }
836 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var45))
837 if templ_7745c5c3_Err != nil {
838 return templ_7745c5c3_Err
839 }
840 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "</span></li>")
841 if templ_7745c5c3_Err != nil {
842 return templ_7745c5c3_Err
843 }
844 }
845 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "</ol>")
846 if templ_7745c5c3_Err != nil {
847 return templ_7745c5c3_Err
848 }
849 }
850 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "</li>")
851 if templ_7745c5c3_Err != nil {
852 return templ_7745c5c3_Err
853 }
854 }
855 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "</ul>")
856 if templ_7745c5c3_Err != nil {
857 return templ_7745c5c3_Err
858 }
859 return nil
860 })
861}
862
863// AnnotationList is a list of annotations: the level as a mark with its word,
864// the job and the step, the title and the message, and file:line. Everything
865// comes from the workflow and is text. Without grouped, each item names its job (the
866// run page); grouped lists the annotations by step instead (the job page).
867func AnnotationList(anns []AnnotationView, more bool, grouped bool) templ.Component {
868 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
869 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
870 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
871 return templ_7745c5c3_CtxErr
872 }
873 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
874 if !templ_7745c5c3_IsBuffer {
875 defer func() {
876 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
877 if templ_7745c5c3_Err == nil {
878 templ_7745c5c3_Err = templ_7745c5c3_BufErr
879 }
880 }()
881 }
882 ctx = templ.InitializeContext(ctx)
883 templ_7745c5c3_Var46 := templ.GetChildren(ctx)
884 if templ_7745c5c3_Var46 == nil {
885 templ_7745c5c3_Var46 = templ.NopComponent
886 }
887 ctx = templ.ClearChildren(ctx)
888 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "<ul class=\"annot-list\">")
889 if templ_7745c5c3_Err != nil {
890 return templ_7745c5c3_Err
891 }
892 for _, a := range anns {
893 var templ_7745c5c3_Var47 = []any{"annot", "annot-" + a.Kind}
894 templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var47...)
895 if templ_7745c5c3_Err != nil {
896 return templ_7745c5c3_Err
897 }
898 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "<li class=\"")
899 if templ_7745c5c3_Err != nil {
900 return templ_7745c5c3_Err
901 }
902 var templ_7745c5c3_Var48 string
903 templ_7745c5c3_Var48, templ_7745c5c3_Err = templ.ResolveAttributeValue(templ.CSSClasses(templ_7745c5c3_Var47).String())
904 if templ_7745c5c3_Err != nil {
905 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 1, Col: 0}
906 }
907 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var48)
908 if templ_7745c5c3_Err != nil {
909 return templ_7745c5c3_Err
910 }
911 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "\">")
912 if templ_7745c5c3_Err != nil {
913 return templ_7745c5c3_Err
914 }
915 if grouped && a.StepHead {
916 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "<p class=\"annot-step\">")
917 if templ_7745c5c3_Err != nil {
918 return templ_7745c5c3_Err
919 }
920 if a.StepHref != "" {
921 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, "<a href=\"")
922 if templ_7745c5c3_Err != nil {
923 return templ_7745c5c3_Err
924 }
925 var templ_7745c5c3_Var49 templ.SafeURL
926 templ_7745c5c3_Var49, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(a.StepHref))
927 if templ_7745c5c3_Err != nil {
928 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 128, Col: 42}
929 }
930 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var49))
931 if templ_7745c5c3_Err != nil {
932 return templ_7745c5c3_Err
933 }
934 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "\">")
935 if templ_7745c5c3_Err != nil {
936 return templ_7745c5c3_Err
937 }
938 var templ_7745c5c3_Var50 string
939 templ_7745c5c3_Var50, templ_7745c5c3_Err = templ.JoinStringErrs(a.Step)
940 if templ_7745c5c3_Err != nil {
941 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 128, Col: 53}
942 }
943 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var50))
944 if templ_7745c5c3_Err != nil {
945 return templ_7745c5c3_Err
946 }
947 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "</a>")
948 if templ_7745c5c3_Err != nil {
949 return templ_7745c5c3_Err
950 }
951 } else {
952 var templ_7745c5c3_Var51 string
953 templ_7745c5c3_Var51, templ_7745c5c3_Err = templ.JoinStringErrs(a.Step)
954 if templ_7745c5c3_Err != nil {
955 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 130, Col: 15}
956 }
957 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var51))
958 if templ_7745c5c3_Err != nil {
959 return templ_7745c5c3_Err
960 }
961 }
962 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, "</p>")
963 if templ_7745c5c3_Err != nil {
964 return templ_7745c5c3_Err
965 }
966 }
967 var templ_7745c5c3_Var52 = []any{"an", "an-" + a.Kind}
968 templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var52...)
969 if templ_7745c5c3_Err != nil {
970 return templ_7745c5c3_Err
971 }
972 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 74, "<span class=\"")
973 if templ_7745c5c3_Err != nil {
974 return templ_7745c5c3_Err
975 }
976 var templ_7745c5c3_Var53 string
977 templ_7745c5c3_Var53, templ_7745c5c3_Err = templ.ResolveAttributeValue(templ.CSSClasses(templ_7745c5c3_Var52).String())
978 if templ_7745c5c3_Err != nil {
979 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 1, Col: 0}
980 }
981 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var53)
982 if templ_7745c5c3_Err != nil {
983 return templ_7745c5c3_Err
984 }
985 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 75, "\" role=\"img\" aria-label=\"")
986 if templ_7745c5c3_Err != nil {
987 return templ_7745c5c3_Err
988 }
989 var templ_7745c5c3_Var54 string
990 templ_7745c5c3_Var54, templ_7745c5c3_Err = templ.ResolveAttributeValue(a.Level)
991 if templ_7745c5c3_Err != nil {
992 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 134, Col: 72}
993 }
994 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var54)
995 if templ_7745c5c3_Err != nil {
996 return templ_7745c5c3_Err
997 }
998 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 76, "\" title=\"")
999 if templ_7745c5c3_Err != nil {
1000 return templ_7745c5c3_Err
1001 }
1002 var templ_7745c5c3_Var55 string
1003 templ_7745c5c3_Var55, templ_7745c5c3_Err = templ.ResolveAttributeValue(a.Level)
1004 if templ_7745c5c3_Err != nil {
1005 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 134, Col: 90}
1006 }
1007 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var55)
1008 if templ_7745c5c3_Err != nil {
1009 return templ_7745c5c3_Err
1010 }
1011 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 77, "\"></span><div class=\"annot-body\"><p class=\"annot-head\"><span class=\"annot-level\">")
1012 if templ_7745c5c3_Err != nil {
1013 return templ_7745c5c3_Err
1014 }
1015 var templ_7745c5c3_Var56 string
1016 templ_7745c5c3_Var56, templ_7745c5c3_Err = templ.JoinStringErrs(a.Level)
1017 if templ_7745c5c3_Err != nil {
1018 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 137, Col: 41}
1019 }
1020 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var56))
1021 if templ_7745c5c3_Err != nil {
1022 return templ_7745c5c3_Err
1023 }
1024 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 78, "</span> ")
1025 if templ_7745c5c3_Err != nil {
1026 return templ_7745c5c3_Err
1027 }
1028 if !grouped {
1029 if a.JobHref != "" {
1030 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 79, "<a href=\"")
1031 if templ_7745c5c3_Err != nil {
1032 return templ_7745c5c3_Err
1033 }
1034 var templ_7745c5c3_Var57 templ.SafeURL
1035 templ_7745c5c3_Var57, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(a.JobHref))
1036 if templ_7745c5c3_Err != nil {
1037 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 140, Col: 42}
1038 }
1039 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var57))
1040 if templ_7745c5c3_Err != nil {
1041 return templ_7745c5c3_Err
1042 }
1043 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 80, "\">")
1044 if templ_7745c5c3_Err != nil {
1045 return templ_7745c5c3_Err
1046 }
1047 var templ_7745c5c3_Var58 string
1048 templ_7745c5c3_Var58, templ_7745c5c3_Err = templ.JoinStringErrs(a.Job)
1049 if templ_7745c5c3_Err != nil {
1050 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 140, Col: 52}
1051 }
1052 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var58))
1053 if templ_7745c5c3_Err != nil {
1054 return templ_7745c5c3_Err
1055 }
1056 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 81, "</a>")
1057 if templ_7745c5c3_Err != nil {
1058 return templ_7745c5c3_Err
1059 }
1060 } else {
1061 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 82, "<span>")
1062 if templ_7745c5c3_Err != nil {
1063 return templ_7745c5c3_Err
1064 }
1065 var templ_7745c5c3_Var59 string
1066 templ_7745c5c3_Var59, templ_7745c5c3_Err = templ.JoinStringErrs(a.Job)
1067 if templ_7745c5c3_Err != nil {
1068 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 142, Col: 21}
1069 }
1070 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var59))
1071 if templ_7745c5c3_Err != nil {
1072 return templ_7745c5c3_Err
1073 }
1074 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 83, "</span>")
1075 if templ_7745c5c3_Err != nil {
1076 return templ_7745c5c3_Err
1077 }
1078 }
1079 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 84, " <span class=\"mute\">")
1080 if templ_7745c5c3_Err != nil {
1081 return templ_7745c5c3_Err
1082 }
1083 var templ_7745c5c3_Var60 string
1084 templ_7745c5c3_Var60, templ_7745c5c3_Err = templ.JoinStringErrs(a.Step)
1085 if templ_7745c5c3_Err != nil {
1086 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 144, Col: 34}
1087 }
1088 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var60))
1089 if templ_7745c5c3_Err != nil {
1090 return templ_7745c5c3_Err
1091 }
1092 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 85, "</span> ")
1093 if templ_7745c5c3_Err != nil {
1094 return templ_7745c5c3_Err
1095 }
1096 }
1097 if a.Title != "" {
1098 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 86, "<strong>")
1099 if templ_7745c5c3_Err != nil {
1100 return templ_7745c5c3_Err
1101 }
1102 var templ_7745c5c3_Var61 string
1103 templ_7745c5c3_Var61, templ_7745c5c3_Err = templ.JoinStringErrs(a.Title)
1104 if templ_7745c5c3_Err != nil {
1105 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 147, Col: 24}
1106 }
1107 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var61))
1108 if templ_7745c5c3_Err != nil {
1109 return templ_7745c5c3_Err
1110 }
1111 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 87, "</strong>")
1112 if templ_7745c5c3_Err != nil {
1113 return templ_7745c5c3_Err
1114 }
1115 }
1116 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 88, "</p><p class=\"annot-msg\">")
1117 if templ_7745c5c3_Err != nil {
1118 return templ_7745c5c3_Err
1119 }
1120 var templ_7745c5c3_Var62 string
1121 templ_7745c5c3_Var62, templ_7745c5c3_Err = templ.JoinStringErrs(a.Message)
1122 if templ_7745c5c3_Err != nil {
1123 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 150, Col: 37}
1124 }
1125 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var62))
1126 if templ_7745c5c3_Err != nil {
1127 return templ_7745c5c3_Err
1128 }
1129 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 89, "</p>")
1130 if templ_7745c5c3_Err != nil {
1131 return templ_7745c5c3_Err
1132 }
1133 if a.Where != "" {
1134 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 90, "<p class=\"annot-where\">")
1135 if templ_7745c5c3_Err != nil {
1136 return templ_7745c5c3_Err
1137 }
1138 if a.WhereHref != "" {
1139 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 91, "<a href=\"")
1140 if templ_7745c5c3_Err != nil {
1141 return templ_7745c5c3_Err
1142 }
1143 var templ_7745c5c3_Var63 templ.SafeURL
1144 templ_7745c5c3_Var63, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(a.WhereHref))
1145 if templ_7745c5c3_Err != nil {
1146 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 154, Col: 44}
1147 }
1148 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var63))
1149 if templ_7745c5c3_Err != nil {
1150 return templ_7745c5c3_Err
1151 }
1152 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 92, "\">")
1153 if templ_7745c5c3_Err != nil {
1154 return templ_7745c5c3_Err
1155 }
1156 var templ_7745c5c3_Var64 string
1157 templ_7745c5c3_Var64, templ_7745c5c3_Err = templ.JoinStringErrs(a.Where)
1158 if templ_7745c5c3_Err != nil {
1159 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 154, Col: 56}
1160 }
1161 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var64))
1162 if templ_7745c5c3_Err != nil {
1163 return templ_7745c5c3_Err
1164 }
1165 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 93, "</a>")
1166 if templ_7745c5c3_Err != nil {
1167 return templ_7745c5c3_Err
1168 }
1169 } else {
1170 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 94, "<span>")
1171 if templ_7745c5c3_Err != nil {
1172 return templ_7745c5c3_Err
1173 }
1174 var templ_7745c5c3_Var65 string
1175 templ_7745c5c3_Var65, templ_7745c5c3_Err = templ.JoinStringErrs(a.Where)
1176 if templ_7745c5c3_Err != nil {
1177 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 156, Col: 23}
1178 }
1179 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var65))
1180 if templ_7745c5c3_Err != nil {
1181 return templ_7745c5c3_Err
1182 }
1183 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 95, "</span>")
1184 if templ_7745c5c3_Err != nil {
1185 return templ_7745c5c3_Err
1186 }
1187 }
1188 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 96, "</p>")
1189 if templ_7745c5c3_Err != nil {
1190 return templ_7745c5c3_Err
1191 }
1192 }
1193 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 97, "</div></li>")
1194 if templ_7745c5c3_Err != nil {
1195 return templ_7745c5c3_Err
1196 }
1197 }
1198 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 98, "</ul>")
1199 if templ_7745c5c3_Err != nil {
1200 return templ_7745c5c3_Err
1201 }
1202 if more {
1203 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 99, "<p class=\"mute\">more annotations exist than are shown.</p>")
1204 if templ_7745c5c3_Err != nil {
1205 return templ_7745c5c3_Err
1206 }
1207 }
1208 return nil
1209 })
1210}
1211
1212// JobAnnotations is the annotations of the job page, replaced by the live
1213// updates; the element exists even when there is none, so that the first one
1214// has something to replace.
1215func JobAnnotations(anns []AnnotationView, more bool) templ.Component {
1216 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1217 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1218 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1219 return templ_7745c5c3_CtxErr
1220 }
1221 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1222 if !templ_7745c5c3_IsBuffer {
1223 defer func() {
1224 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1225 if templ_7745c5c3_Err == nil {
1226 templ_7745c5c3_Err = templ_7745c5c3_BufErr
1227 }
1228 }()
1229 }
1230 ctx = templ.InitializeContext(ctx)
1231 templ_7745c5c3_Var66 := templ.GetChildren(ctx)
1232 if templ_7745c5c3_Var66 == nil {
1233 templ_7745c5c3_Var66 = templ.NopComponent
1234 }
1235 ctx = templ.ClearChildren(ctx)
1236 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 100, "<section id=\"job-annotations\" class=\"annots\" aria-label=\"Annotations\">")
1237 if templ_7745c5c3_Err != nil {
1238 return templ_7745c5c3_Err
1239 }
1240 if len(anns) > 0 {
1241 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 101, "<h3>Annotations <span class=\"count\">")
1242 if templ_7745c5c3_Err != nil {
1243 return templ_7745c5c3_Err
1244 }
1245 var templ_7745c5c3_Var67 string
1246 templ_7745c5c3_Var67, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(anns)))
1247 if templ_7745c5c3_Err != nil {
1248 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 175, Col: 56}
1249 }
1250 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var67))
1251 if templ_7745c5c3_Err != nil {
1252 return templ_7745c5c3_Err
1253 }
1254 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 102, "</span></h3>")
1255 if templ_7745c5c3_Err != nil {
1256 return templ_7745c5c3_Err
1257 }
1258 templ_7745c5c3_Err = AnnotationList(anns, more, true).Render(ctx, templ_7745c5c3_Buffer)
1259 if templ_7745c5c3_Err != nil {
1260 return templ_7745c5c3_Err
1261 }
1262 }
1263 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 103, "</section>")
1264 if templ_7745c5c3_Err != nil {
1265 return templ_7745c5c3_Err
1266 }
1267 return nil
1268 })
1269}
1270
1271// RunSummaries is the job summaries of a run, one block per step that wrote
1272// one. The Markdown is rendered by the README renderer: raw HTML dropped, URLs
1273// filtered, images shown as their alt text.
1274func RunSummaries(sums []JobSummaries, more bool) templ.Component {
1275 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1276 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1277 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1278 return templ_7745c5c3_CtxErr
1279 }
1280 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1281 if !templ_7745c5c3_IsBuffer {
1282 defer func() {
1283 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1284 if templ_7745c5c3_Err == nil {
1285 templ_7745c5c3_Err = templ_7745c5c3_BufErr
1286 }
1287 }()
1288 }
1289 ctx = templ.InitializeContext(ctx)
1290 templ_7745c5c3_Var68 := templ.GetChildren(ctx)
1291 if templ_7745c5c3_Var68 == nil {
1292 templ_7745c5c3_Var68 = templ.NopComponent
1293 }
1294 ctx = templ.ClearChildren(ctx)
1295 for _, j := range sums {
1296 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 104, "<section class=\"summaries\" aria-label=\"")
1297 if templ_7745c5c3_Err != nil {
1298 return templ_7745c5c3_Err
1299 }
1300 var templ_7745c5c3_Var69 string
1301 templ_7745c5c3_Var69, templ_7745c5c3_Err = templ.ResolveAttributeValue("Summary of " + j.Job)
1302 if templ_7745c5c3_Err != nil {
1303 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 186, Col: 63}
1304 }
1305 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var69)
1306 if templ_7745c5c3_Err != nil {
1307 return templ_7745c5c3_Err
1308 }
1309 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 105, "\"><h3>")
1310 if templ_7745c5c3_Err != nil {
1311 return templ_7745c5c3_Err
1312 }
1313 if j.JobHref != "" {
1314 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 106, "<a href=\"")
1315 if templ_7745c5c3_Err != nil {
1316 return templ_7745c5c3_Err
1317 }
1318 var templ_7745c5c3_Var70 templ.SafeURL
1319 templ_7745c5c3_Var70, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(j.JobHref))
1320 if templ_7745c5c3_Err != nil {
1321 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 189, Col: 39}
1322 }
1323 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var70))
1324 if templ_7745c5c3_Err != nil {
1325 return templ_7745c5c3_Err
1326 }
1327 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 107, "\">")
1328 if templ_7745c5c3_Err != nil {
1329 return templ_7745c5c3_Err
1330 }
1331 var templ_7745c5c3_Var71 string
1332 templ_7745c5c3_Var71, templ_7745c5c3_Err = templ.JoinStringErrs(j.Job)
1333 if templ_7745c5c3_Err != nil {
1334 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 189, Col: 49}
1335 }
1336 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var71))
1337 if templ_7745c5c3_Err != nil {
1338 return templ_7745c5c3_Err
1339 }
1340 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 108, "</a> ")
1341 if templ_7745c5c3_Err != nil {
1342 return templ_7745c5c3_Err
1343 }
1344 } else {
1345 var templ_7745c5c3_Var72 string
1346 templ_7745c5c3_Var72, templ_7745c5c3_Err = templ.JoinStringErrs(j.Job)
1347 if templ_7745c5c3_Err != nil {
1348 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 191, Col: 12}
1349 }
1350 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var72))
1351 if templ_7745c5c3_Err != nil {
1352 return templ_7745c5c3_Err
1353 }
1354 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 109, " ")
1355 if templ_7745c5c3_Err != nil {
1356 return templ_7745c5c3_Err
1357 }
1358 }
1359 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 110, "<span class=\"mute\">summary</span></h3>")
1360 if templ_7745c5c3_Err != nil {
1361 return templ_7745c5c3_Err
1362 }
1363 for _, s := range j.Steps {
1364 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 111, "<article class=\"prose summary\" aria-label=\"")
1365 if templ_7745c5c3_Err != nil {
1366 return templ_7745c5c3_Err
1367 }
1368 var templ_7745c5c3_Var73 string
1369 templ_7745c5c3_Var73, templ_7745c5c3_Err = templ.ResolveAttributeValue(s.Step)
1370 if templ_7745c5c3_Err != nil {
1371 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 196, Col: 54}
1372 }
1373 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var73)
1374 if templ_7745c5c3_Err != nil {
1375 return templ_7745c5c3_Err
1376 }
1377 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 112, "\" hx-ignore><h4 class=\"summary-step\">")
1378 if templ_7745c5c3_Err != nil {
1379 return templ_7745c5c3_Err
1380 }
1381 var templ_7745c5c3_Var74 string
1382 templ_7745c5c3_Var74, templ_7745c5c3_Err = templ.JoinStringErrs(s.Step)
1383 if templ_7745c5c3_Err != nil {
1384 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 197, Col: 38}
1385 }
1386 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var74))
1387 if templ_7745c5c3_Err != nil {
1388 return templ_7745c5c3_Err
1389 }
1390 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 113, "</h4>")
1391 if templ_7745c5c3_Err != nil {
1392 return templ_7745c5c3_Err
1393 }
1394 if s.Note != "" {
1395 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 114, "<p class=\"dim\">")
1396 if templ_7745c5c3_Err != nil {
1397 return templ_7745c5c3_Err
1398 }
1399 var templ_7745c5c3_Var75 string
1400 templ_7745c5c3_Var75, templ_7745c5c3_Err = templ.JoinStringErrs(s.Note)
1401 if templ_7745c5c3_Err != nil {
1402 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 199, Col: 29}
1403 }
1404 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var75))
1405 if templ_7745c5c3_Err != nil {
1406 return templ_7745c5c3_Err
1407 }
1408 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 115, "</p>")
1409 if templ_7745c5c3_Err != nil {
1410 return templ_7745c5c3_Err
1411 }
1412 } else {
1413 templ_7745c5c3_Err = templ.Raw(s.HTML).Render(ctx, templ_7745c5c3_Buffer)
1414 if templ_7745c5c3_Err != nil {
1415 return templ_7745c5c3_Err
1416 }
1417 }
1418 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 116, "</article>")
1419 if templ_7745c5c3_Err != nil {
1420 return templ_7745c5c3_Err
1421 }
1422 }
1423 if j.More {
1424 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 117, "<p class=\"mute\">the job has more summaries than the first 20, which are shown.</p>")
1425 if templ_7745c5c3_Err != nil {
1426 return templ_7745c5c3_Err
1427 }
1428 }
1429 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 118, "</section>")
1430 if templ_7745c5c3_Err != nil {
1431 return templ_7745c5c3_Err
1432 }
1433 }
1434 if more {
1435 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 119, "<p class=\"mute\">more summaries are not shown: the summaries of the page are over ")
1436 if templ_7745c5c3_Err != nil {
1437 return templ_7745c5c3_Err
1438 }
1439 var templ_7745c5c3_Var76 string
1440 templ_7745c5c3_Var76, templ_7745c5c3_Err = templ.JoinStringErrs(humanSize(maxSummaryPageBytes))
1441 if templ_7745c5c3_Err != nil {
1442 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 211, Col: 115}
1443 }
1444 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var76))
1445 if templ_7745c5c3_Err != nil {
1446 return templ_7745c5c3_Err
1447 }
1448 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 120, ".</p>")
1449 if templ_7745c5c3_Err != nil {
1450 return templ_7745c5c3_Err
1451 }
1452 }
1453 return nil
1454 })
1455}
1456
1457func runRail(p RunPage) templ.Component {
1458 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1459 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1460 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1461 return templ_7745c5c3_CtxErr
1462 }
1463 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1464 if !templ_7745c5c3_IsBuffer {
1465 defer func() {
1466 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1467 if templ_7745c5c3_Err == nil {
1468 templ_7745c5c3_Err = templ_7745c5c3_BufErr
1469 }
1470 }()
1471 }
1472 ctx = templ.InitializeContext(ctx)
1473 templ_7745c5c3_Var77 := templ.GetChildren(ctx)
1474 if templ_7745c5c3_Var77 == nil {
1475 templ_7745c5c3_Var77 = templ.NopComponent
1476 }
1477 ctx = templ.ClearChildren(ctx)
1478 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 121, "<section aria-labelledby=\"r-run\"><h2 id=\"r-run\">Run</h2><dl class=\"kv\"><dt>result</dt><dd>")
1479 if templ_7745c5c3_Err != nil {
1480 return templ_7745c5c3_Err
1481 }
1482 var templ_7745c5c3_Var78 string
1483 templ_7745c5c3_Var78, templ_7745c5c3_Err = templ.JoinStringErrs(p.State)
1484 if templ_7745c5c3_Err != nil {
1485 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 220, Col: 16}
1486 }
1487 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var78))
1488 if templ_7745c5c3_Err != nil {
1489 return templ_7745c5c3_Err
1490 }
1491 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 122, "</dd><dt>commit</dt><dd><a href=\"")
1492 if templ_7745c5c3_Err != nil {
1493 return templ_7745c5c3_Err
1494 }
1495 var templ_7745c5c3_Var79 templ.SafeURL
1496 templ_7745c5c3_Var79, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.CHref))
1497 if templ_7745c5c3_Err != nil {
1498 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 222, Col: 39}
1499 }
1500 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var79))
1501 if templ_7745c5c3_Err != nil {
1502 return templ_7745c5c3_Err
1503 }
1504 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 123, "\">")
1505 if templ_7745c5c3_Err != nil {
1506 return templ_7745c5c3_Err
1507 }
1508 var templ_7745c5c3_Var80 string
1509 templ_7745c5c3_Var80, templ_7745c5c3_Err = templ.JoinStringErrs(p.Short)
1510 if templ_7745c5c3_Err != nil {
1511 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 222, Col: 51}
1512 }
1513 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var80))
1514 if templ_7745c5c3_Err != nil {
1515 return templ_7745c5c3_Err
1516 }
1517 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 124, "</a></dd><dt>ref</dt><dd><a href=\"")
1518 if templ_7745c5c3_Err != nil {
1519 return templ_7745c5c3_Err
1520 }
1521 var templ_7745c5c3_Var81 templ.SafeURL
1522 templ_7745c5c3_Var81, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.RefHref))
1523 if templ_7745c5c3_Err != nil {
1524 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 224, Col: 41}
1525 }
1526 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var81))
1527 if templ_7745c5c3_Err != nil {
1528 return templ_7745c5c3_Err
1529 }
1530 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 125, "\">")
1531 if templ_7745c5c3_Err != nil {
1532 return templ_7745c5c3_Err
1533 }
1534 var templ_7745c5c3_Var82 string
1535 templ_7745c5c3_Var82, templ_7745c5c3_Err = templ.JoinStringErrs(p.Ref)
1536 if templ_7745c5c3_Err != nil {
1537 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 224, Col: 51}
1538 }
1539 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var82))
1540 if templ_7745c5c3_Err != nil {
1541 return templ_7745c5c3_Err
1542 }
1543 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 126, "</a></dd><dt>actor</dt><dd>")
1544 if templ_7745c5c3_Err != nil {
1545 return templ_7745c5c3_Err
1546 }
1547 var templ_7745c5c3_Var83 string
1548 templ_7745c5c3_Var83, templ_7745c5c3_Err = templ.JoinStringErrs(p.Actor)
1549 if templ_7745c5c3_Err != nil {
1550 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 226, Col: 16}
1551 }
1552 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var83))
1553 if templ_7745c5c3_Err != nil {
1554 return templ_7745c5c3_Err
1555 }
1556 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 127, "</dd><dt>attempt</dt><dd>")
1557 if templ_7745c5c3_Err != nil {
1558 return templ_7745c5c3_Err
1559 }
1560 var templ_7745c5c3_Var84 string
1561 templ_7745c5c3_Var84, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(int(p.Attempt)))
1562 if templ_7745c5c3_Err != nil {
1563 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 228, Col: 29}
1564 }
1565 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var84))
1566 if templ_7745c5c3_Err != nil {
1567 return templ_7745c5c3_Err
1568 }
1569 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 128, " of ")
1570 if templ_7745c5c3_Err != nil {
1571 return templ_7745c5c3_Err
1572 }
1573 var templ_7745c5c3_Var85 string
1574 templ_7745c5c3_Var85, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(int(p.Latest)))
1575 if templ_7745c5c3_Err != nil {
1576 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 228, Col: 56}
1577 }
1578 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var85))
1579 if templ_7745c5c3_Err != nil {
1580 return templ_7745c5c3_Err
1581 }
1582 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 129, "</dd></dl>")
1583 if templ_7745c5c3_Err != nil {
1584 return templ_7745c5c3_Err
1585 }
1586 if len(p.Attempts) > 0 {
1587 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 130, "<ul class=\"attempts\">")
1588 if templ_7745c5c3_Err != nil {
1589 return templ_7745c5c3_Err
1590 }
1591 for _, a := range p.Attempts {
1592 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 131, "<li>")
1593 if templ_7745c5c3_Err != nil {
1594 return templ_7745c5c3_Err
1595 }
1596 if a.Current {
1597 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 132, "<span aria-current=\"page\">")
1598 if templ_7745c5c3_Err != nil {
1599 return templ_7745c5c3_Err
1600 }
1601 var templ_7745c5c3_Var86 string
1602 templ_7745c5c3_Var86, templ_7745c5c3_Err = templ.JoinStringErrs(a.Label)
1603 if templ_7745c5c3_Err != nil {
1604 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 235, Col: 42}
1605 }
1606 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var86))
1607 if templ_7745c5c3_Err != nil {
1608 return templ_7745c5c3_Err
1609 }
1610 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 133, "</span>")
1611 if templ_7745c5c3_Err != nil {
1612 return templ_7745c5c3_Err
1613 }
1614 } else {
1615 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 134, "<a href=\"")
1616 if templ_7745c5c3_Err != nil {
1617 return templ_7745c5c3_Err
1618 }
1619 var templ_7745c5c3_Var87 templ.SafeURL
1620 templ_7745c5c3_Var87, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(a.Href))
1621 if templ_7745c5c3_Err != nil {
1622 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 237, Col: 38}
1623 }
1624 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var87))
1625 if templ_7745c5c3_Err != nil {
1626 return templ_7745c5c3_Err
1627 }
1628 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 135, "\">")
1629 if templ_7745c5c3_Err != nil {
1630 return templ_7745c5c3_Err
1631 }
1632 var templ_7745c5c3_Var88 string
1633 templ_7745c5c3_Var88, templ_7745c5c3_Err = templ.JoinStringErrs(a.Label)
1634 if templ_7745c5c3_Err != nil {
1635 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 237, Col: 50}
1636 }
1637 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var88))
1638 if templ_7745c5c3_Err != nil {
1639 return templ_7745c5c3_Err
1640 }
1641 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 136, "</a>")
1642 if templ_7745c5c3_Err != nil {
1643 return templ_7745c5c3_Err
1644 }
1645 }
1646 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 137, "</li>")
1647 if templ_7745c5c3_Err != nil {
1648 return templ_7745c5c3_Err
1649 }
1650 }
1651 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 138, "</ul>")
1652 if templ_7745c5c3_Err != nil {
1653 return templ_7745c5c3_Err
1654 }
1655 }
1656 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 139, "</section>")
1657 if templ_7745c5c3_Err != nil {
1658 return templ_7745c5c3_Err
1659 }
1660 if p.CancelAction != "" || p.RerunAction != "" {
1661 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 140, "<section aria-labelledby=\"r-act\" class=\"decide\"><h2 id=\"r-act\">Actions</h2><div class=\"d-btns\">")
1662 if templ_7745c5c3_Err != nil {
1663 return templ_7745c5c3_Err
1664 }
1665 if p.CancelAction != "" {
1666 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 141, "<form method=\"post\" action=\"")
1667 if templ_7745c5c3_Err != nil {
1668 return templ_7745c5c3_Err
1669 }
1670 var templ_7745c5c3_Var89 templ.SafeURL
1671 templ_7745c5c3_Var89, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.CancelAction))
1672 if templ_7745c5c3_Err != nil {
1673 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 249, Col: 63}
1674 }
1675 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var89))
1676 if templ_7745c5c3_Err != nil {
1677 return templ_7745c5c3_Err
1678 }
1679 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 142, "\"><button type=\"submit\" class=\"btn\">Cancel run</button></form>")
1680 if templ_7745c5c3_Err != nil {
1681 return templ_7745c5c3_Err
1682 }
1683 }
1684 if p.RerunAction != "" {
1685 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 143, "<form method=\"post\" action=\"")
1686 if templ_7745c5c3_Err != nil {
1687 return templ_7745c5c3_Err
1688 }
1689 var templ_7745c5c3_Var90 templ.SafeURL
1690 templ_7745c5c3_Var90, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.RerunAction))
1691 if templ_7745c5c3_Err != nil {
1692 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 252, Col: 62}
1693 }
1694 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var90))
1695 if templ_7745c5c3_Err != nil {
1696 return templ_7745c5c3_Err
1697 }
1698 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 144, "\"><button type=\"submit\" class=\"btn primary\">Re-run all jobs</button></form>")
1699 if templ_7745c5c3_Err != nil {
1700 return templ_7745c5c3_Err
1701 }
1702 }
1703 if p.CanRerunFailed {
1704 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 145, "<form method=\"post\" action=\"")
1705 if templ_7745c5c3_Err != nil {
1706 return templ_7745c5c3_Err
1707 }
1708 var templ_7745c5c3_Var91 templ.SafeURL
1709 templ_7745c5c3_Var91, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.RerunFailedAction))
1710 if templ_7745c5c3_Err != nil {
1711 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 255, Col: 68}
1712 }
1713 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var91))
1714 if templ_7745c5c3_Err != nil {
1715 return templ_7745c5c3_Err
1716 }
1717 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 146, "\"><button type=\"submit\" class=\"btn\">Re-run failed jobs</button></form>")
1718 if templ_7745c5c3_Err != nil {
1719 return templ_7745c5c3_Err
1720 }
1721 }
1722 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 147, "</div></section>")
1723 if templ_7745c5c3_Err != nil {
1724 return templ_7745c5c3_Err
1725 }
1726 }
1727 return nil
1728 })
1729}
1730
1731// JobHead is the title of the job page with its state and its error, replaced
1732// by the live updates. total is the number of lines the log holds.
1733func JobHead(j JobRow, total int64) templ.Component {
1734 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1735 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1736 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1737 return templ_7745c5c3_CtxErr
1738 }
1739 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1740 if !templ_7745c5c3_IsBuffer {
1741 defer func() {
1742 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1743 if templ_7745c5c3_Err == nil {
1744 templ_7745c5c3_Err = templ_7745c5c3_BufErr
1745 }
1746 }()
1747 }
1748 ctx = templ.InitializeContext(ctx)
1749 templ_7745c5c3_Var92 := templ.GetChildren(ctx)
1750 if templ_7745c5c3_Var92 == nil {
1751 templ_7745c5c3_Var92 = templ.NopComponent
1752 }
1753 ctx = templ.ClearChildren(ctx)
1754 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 148, "<div id=\"job-head\" data-total=\"")
1755 if templ_7745c5c3_Err != nil {
1756 return templ_7745c5c3_Err
1757 }
1758 var templ_7745c5c3_Var93 string
1759 templ_7745c5c3_Var93, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa64(total))
1760 if templ_7745c5c3_Err != nil {
1761 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 265, Col: 46}
1762 }
1763 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var93)
1764 if templ_7745c5c3_Err != nil {
1765 return templ_7745c5c3_Err
1766 }
1767 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 149, "\"><h2 class=\"run-h\">")
1768 if templ_7745c5c3_Err != nil {
1769 return templ_7745c5c3_Err
1770 }
1771 templ_7745c5c3_Err = CheckIcon(j.Kind, j.State).Render(ctx, templ_7745c5c3_Buffer)
1772 if templ_7745c5c3_Err != nil {
1773 return templ_7745c5c3_Err
1774 }
1775 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 150, "<span>")
1776 if templ_7745c5c3_Err != nil {
1777 return templ_7745c5c3_Err
1778 }
1779 var templ_7745c5c3_Var94 string
1780 templ_7745c5c3_Var94, templ_7745c5c3_Err = templ.JoinStringErrs(j.Name)
1781 if templ_7745c5c3_Err != nil {
1782 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 266, Col: 61}
1783 }
1784 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var94))
1785 if templ_7745c5c3_Err != nil {
1786 return templ_7745c5c3_Err
1787 }
1788 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 151, "</span> <span class=\"dim\">")
1789 if templ_7745c5c3_Err != nil {
1790 return templ_7745c5c3_Err
1791 }
1792 var templ_7745c5c3_Var95 string
1793 templ_7745c5c3_Var95, templ_7745c5c3_Err = templ.JoinStringErrs(j.State)
1794 if templ_7745c5c3_Err != nil {
1795 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 266, Col: 98}
1796 }
1797 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var95))
1798 if templ_7745c5c3_Err != nil {
1799 return templ_7745c5c3_Err
1800 }
1801 var templ_7745c5c3_Var96 string
1802 templ_7745c5c3_Var96, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
1803 if templ_7745c5c3_Err != nil {
1804 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 266, Col: 105}
1805 }
1806 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var96))
1807 if templ_7745c5c3_Err != nil {
1808 return templ_7745c5c3_Err
1809 }
1810 var templ_7745c5c3_Var97 string
1811 templ_7745c5c3_Var97, templ_7745c5c3_Err = templ.JoinStringErrs(j.Duration)
1812 if templ_7745c5c3_Err != nil {
1813 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 266, Col: 119}
1814 }
1815 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var97))
1816 if templ_7745c5c3_Err != nil {
1817 return templ_7745c5c3_Err
1818 }
1819 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 152, "</span></h2>")
1820 if templ_7745c5c3_Err != nil {
1821 return templ_7745c5c3_Err
1822 }
1823 if j.Error != "" {
1824 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 153, "<p class=\"job-err\">")
1825 if templ_7745c5c3_Err != nil {
1826 return templ_7745c5c3_Err
1827 }
1828 var templ_7745c5c3_Var98 string
1829 templ_7745c5c3_Var98, templ_7745c5c3_Err = templ.JoinStringErrs(j.Error)
1830 if templ_7745c5c3_Err != nil {
1831 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 268, Col: 31}
1832 }
1833 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var98))
1834 if templ_7745c5c3_Err != nil {
1835 return templ_7745c5c3_Err
1836 }
1837 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 154, "</p>")
1838 if templ_7745c5c3_Err != nil {
1839 return templ_7745c5c3_Err
1840 }
1841 }
1842 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 155, "</div>")
1843 if templ_7745c5c3_Err != nil {
1844 return templ_7745c5c3_Err
1845 }
1846 return nil
1847 })
1848}
1849
1850// JobSteps is the steps of the job in the rail, replaced by the live updates.
1851func JobSteps(steps []StepView) templ.Component {
1852 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1853 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1854 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1855 return templ_7745c5c3_CtxErr
1856 }
1857 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1858 if !templ_7745c5c3_IsBuffer {
1859 defer func() {
1860 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1861 if templ_7745c5c3_Err == nil {
1862 templ_7745c5c3_Err = templ_7745c5c3_BufErr
1863 }
1864 }()
1865 }
1866 ctx = templ.InitializeContext(ctx)
1867 templ_7745c5c3_Var99 := templ.GetChildren(ctx)
1868 if templ_7745c5c3_Var99 == nil {
1869 templ_7745c5c3_Var99 = templ.NopComponent
1870 }
1871 ctx = templ.ClearChildren(ctx)
1872 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 156, "<ol class=\"steps\" id=\"job-steps\">")
1873 if templ_7745c5c3_Err != nil {
1874 return templ_7745c5c3_Err
1875 }
1876 for _, s := range steps {
1877 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 157, "<li>")
1878 if templ_7745c5c3_Err != nil {
1879 return templ_7745c5c3_Err
1880 }
1881 templ_7745c5c3_Err = CheckIcon(s.Kind, s.State).Render(ctx, templ_7745c5c3_Buffer)
1882 if templ_7745c5c3_Err != nil {
1883 return templ_7745c5c3_Err
1884 }
1885 if s.LogEnd > s.LogStart {
1886 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 158, "<a href=\"")
1887 if templ_7745c5c3_Err != nil {
1888 return templ_7745c5c3_Err
1889 }
1890 var templ_7745c5c3_Var100 templ.SafeURL
1891 templ_7745c5c3_Var100, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL("#L" + itoa64(s.LogStart)))
1892 if templ_7745c5c3_Err != nil {
1893 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 280, Col: 55}
1894 }
1895 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var100))
1896 if templ_7745c5c3_Err != nil {
1897 return templ_7745c5c3_Err
1898 }
1899 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 159, "\">")
1900 if templ_7745c5c3_Err != nil {
1901 return templ_7745c5c3_Err
1902 }
1903 var templ_7745c5c3_Var101 string
1904 templ_7745c5c3_Var101, templ_7745c5c3_Err = templ.JoinStringErrs(s.Name)
1905 if templ_7745c5c3_Err != nil {
1906 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 280, Col: 66}
1907 }
1908 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var101))
1909 if templ_7745c5c3_Err != nil {
1910 return templ_7745c5c3_Err
1911 }
1912 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 160, "</a> ")
1913 if templ_7745c5c3_Err != nil {
1914 return templ_7745c5c3_Err
1915 }
1916 } else {
1917 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 161, "<span>")
1918 if templ_7745c5c3_Err != nil {
1919 return templ_7745c5c3_Err
1920 }
1921 var templ_7745c5c3_Var102 string
1922 templ_7745c5c3_Var102, templ_7745c5c3_Err = templ.JoinStringErrs(s.Name)
1923 if templ_7745c5c3_Err != nil {
1924 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 282, Col: 19}
1925 }
1926 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var102))
1927 if templ_7745c5c3_Err != nil {
1928 return templ_7745c5c3_Err
1929 }
1930 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 162, "</span> ")
1931 if templ_7745c5c3_Err != nil {
1932 return templ_7745c5c3_Err
1933 }
1934 }
1935 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 163, "<span class=\"dim\">")
1936 if templ_7745c5c3_Err != nil {
1937 return templ_7745c5c3_Err
1938 }
1939 var templ_7745c5c3_Var103 string
1940 templ_7745c5c3_Var103, templ_7745c5c3_Err = templ.JoinStringErrs(s.Duration)
1941 if templ_7745c5c3_Err != nil {
1942 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 284, Col: 34}
1943 }
1944 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var103))
1945 if templ_7745c5c3_Err != nil {
1946 return templ_7745c5c3_Err
1947 }
1948 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 164, "</span></li>")
1949 if templ_7745c5c3_Err != nil {
1950 return templ_7745c5c3_Err
1951 }
1952 }
1953 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 165, "</ol>")
1954 if templ_7745c5c3_Err != nil {
1955 return templ_7745c5c3_Err
1956 }
1957 return nil
1958 })
1959}
1960
1961func Job(l Layout, p JobPage) templ.Component {
1962 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1963 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1964 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1965 return templ_7745c5c3_CtxErr
1966 }
1967 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1968 if !templ_7745c5c3_IsBuffer {
1969 defer func() {
1970 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1971 if templ_7745c5c3_Err == nil {
1972 templ_7745c5c3_Err = templ_7745c5c3_BufErr
1973 }
1974 }()
1975 }
1976 ctx = templ.InitializeContext(ctx)
1977 templ_7745c5c3_Var104 := templ.GetChildren(ctx)
1978 if templ_7745c5c3_Var104 == nil {
1979 templ_7745c5c3_Var104 = templ.NopComponent
1980 }
1981 ctx = templ.ClearChildren(ctx)
1982 templ_7745c5c3_Var105 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1983 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1984 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1985 if !templ_7745c5c3_IsBuffer {
1986 defer func() {
1987 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1988 if templ_7745c5c3_Err == nil {
1989 templ_7745c5c3_Err = templ_7745c5c3_BufErr
1990 }
1991 }()
1992 }
1993 ctx = templ.InitializeContext(ctx)
1994 templ_7745c5c3_Err = LiveSlot("job-notice").Render(ctx, templ_7745c5c3_Buffer)
1995 if templ_7745c5c3_Err != nil {
1996 return templ_7745c5c3_Err
1997 }
1998 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 166, " ")
1999 if templ_7745c5c3_Err != nil {
2000 return templ_7745c5c3_Err
2001 }
2002 templ_7745c5c3_Err = JobHead(p.JobRow, p.Total).Render(ctx, templ_7745c5c3_Buffer)
2003 if templ_7745c5c3_Err != nil {
2004 return templ_7745c5c3_Err
2005 }
2006 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 167, " ")
2007 if templ_7745c5c3_Err != nil {
2008 return templ_7745c5c3_Err
2009 }
2010 templ_7745c5c3_Err = JobAnnotations(p.Annotations, p.AnnotationsMore).Render(ctx, templ_7745c5c3_Buffer)
2011 if templ_7745c5c3_Err != nil {
2012 return templ_7745c5c3_Err
2013 }
2014 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 168, " <div id=\"job-log\" class=\"joblog\" data-total=\"")
2015 if templ_7745c5c3_Err != nil {
2016 return templ_7745c5c3_Err
2017 }
2018 var templ_7745c5c3_Var106 string
2019 templ_7745c5c3_Var106, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa64(p.Total))
2020 if templ_7745c5c3_Err != nil {
2021 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 295, Col: 63}
2022 }
2023 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var106)
2024 if templ_7745c5c3_Err != nil {
2025 return templ_7745c5c3_Err
2026 }
2027 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 169, "\"")
2028 if templ_7745c5c3_Err != nil {
2029 return templ_7745c5c3_Err
2030 }
2031 if p.Follow {
2032 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 170, " data-follow")
2033 if templ_7745c5c3_Err != nil {
2034 return templ_7745c5c3_Err
2035 }
2036 }
2037 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 171, " data-stream=\"")
2038 if templ_7745c5c3_Err != nil {
2039 return templ_7745c5c3_Err
2040 }
2041 var templ_7745c5c3_Var107 string
2042 templ_7745c5c3_Var107, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.StreamHref)
2043 if templ_7745c5c3_Err != nil {
2044 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 295, Col: 118}
2045 }
2046 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var107)
2047 if templ_7745c5c3_Err != nil {
2048 return templ_7745c5c3_Err
2049 }
2050 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 172, "\" data-next=\"")
2051 if templ_7745c5c3_Err != nil {
2052 return templ_7745c5c3_Err
2053 }
2054 var templ_7745c5c3_Var108 string
2055 templ_7745c5c3_Var108, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa64(p.From + int64(len(p.Lines))))
2056 if templ_7745c5c3_Err != nil {
2057 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 295, Col: 169}
2058 }
2059 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var108)
2060 if templ_7745c5c3_Err != nil {
2061 return templ_7745c5c3_Err
2062 }
2063 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 173, "\">")
2064 if templ_7745c5c3_Err != nil {
2065 return templ_7745c5c3_Err
2066 }
2067 if p.Note != "" {
2068 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 174, "<p class=\"dim\">")
2069 if templ_7745c5c3_Err != nil {
2070 return templ_7745c5c3_Err
2071 }
2072 var templ_7745c5c3_Var109 string
2073 templ_7745c5c3_Var109, templ_7745c5c3_Err = templ.JoinStringErrs(p.Note)
2074 if templ_7745c5c3_Err != nil {
2075 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 297, Col: 27}
2076 }
2077 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var109))
2078 if templ_7745c5c3_Err != nil {
2079 return templ_7745c5c3_Err
2080 }
2081 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 175, "</p>")
2082 if templ_7745c5c3_Err != nil {
2083 return templ_7745c5c3_Err
2084 }
2085 }
2086 if p.Prev != "" {
2087 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 176, "<p class=\"more\"><a href=\"")
2088 if templ_7745c5c3_Err != nil {
2089 return templ_7745c5c3_Err
2090 }
2091 var templ_7745c5c3_Var110 templ.SafeURL
2092 templ_7745c5c3_Var110, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Prev))
2093 if templ_7745c5c3_Err != nil {
2094 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 300, Col: 51}
2095 }
2096 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var110))
2097 if templ_7745c5c3_Err != nil {
2098 return templ_7745c5c3_Err
2099 }
2100 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 177, "\" rel=\"prev\">earlier lines</a></p>")
2101 if templ_7745c5c3_Err != nil {
2102 return templ_7745c5c3_Err
2103 }
2104 }
2105 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 178, "<ol class=\"log\" start=\"")
2106 if templ_7745c5c3_Err != nil {
2107 return templ_7745c5c3_Err
2108 }
2109 var templ_7745c5c3_Var111 string
2110 templ_7745c5c3_Var111, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa64(p.From + 1))
2111 if templ_7745c5c3_Err != nil {
2112 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 302, Col: 45}
2113 }
2114 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var111)
2115 if templ_7745c5c3_Err != nil {
2116 return templ_7745c5c3_Err
2117 }
2118 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 179, "\">")
2119 if templ_7745c5c3_Err != nil {
2120 return templ_7745c5c3_Err
2121 }
2122 for _, ln := range p.Lines {
2123 templ_7745c5c3_Err = LogLine(ln).Render(ctx, templ_7745c5c3_Buffer)
2124 if templ_7745c5c3_Err != nil {
2125 return templ_7745c5c3_Err
2126 }
2127 }
2128 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 180, "</ol>")
2129 if templ_7745c5c3_Err != nil {
2130 return templ_7745c5c3_Err
2131 }
2132 if p.Next != "" {
2133 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 181, "<p class=\"more\"><a href=\"")
2134 if templ_7745c5c3_Err != nil {
2135 return templ_7745c5c3_Err
2136 }
2137 var templ_7745c5c3_Var112 templ.SafeURL
2138 templ_7745c5c3_Var112, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Next))
2139 if templ_7745c5c3_Err != nil {
2140 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 308, Col: 51}
2141 }
2142 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var112))
2143 if templ_7745c5c3_Err != nil {
2144 return templ_7745c5c3_Err
2145 }
2146 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 182, "\" rel=\"next\">more lines</a></p>")
2147 if templ_7745c5c3_Err != nil {
2148 return templ_7745c5c3_Err
2149 }
2150 }
2151 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 183, "</div>")
2152 if templ_7745c5c3_Err != nil {
2153 return templ_7745c5c3_Err
2154 }
2155 return nil
2156 })
2157 templ_7745c5c3_Err = Shell(l, jobRail(p)).Render(templ.WithChildren(ctx, templ_7745c5c3_Var105), templ_7745c5c3_Buffer)
2158 if templ_7745c5c3_Err != nil {
2159 return templ_7745c5c3_Err
2160 }
2161 return nil
2162 })
2163}
2164
2165// LogLine is a line of the log. Group and error markers of the runner show as
2166// headings and errors, never as raw text.
2167func LogLine(ln LogLineView) templ.Component {
2168 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2169 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2170 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2171 return templ_7745c5c3_CtxErr
2172 }
2173 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2174 if !templ_7745c5c3_IsBuffer {
2175 defer func() {
2176 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2177 if templ_7745c5c3_Err == nil {
2178 templ_7745c5c3_Err = templ_7745c5c3_BufErr
2179 }
2180 }()
2181 }
2182 ctx = templ.InitializeContext(ctx)
2183 templ_7745c5c3_Var113 := templ.GetChildren(ctx)
2184 if templ_7745c5c3_Var113 == nil {
2185 templ_7745c5c3_Var113 = templ.NopComponent
2186 }
2187 ctx = templ.ClearChildren(ctx)
2188 var templ_7745c5c3_Var114 = []any{logClass(ln)}
2189 templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var114...)
2190 if templ_7745c5c3_Err != nil {
2191 return templ_7745c5c3_Err
2192 }
2193 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 184, "<li id=\"")
2194 if templ_7745c5c3_Err != nil {
2195 return templ_7745c5c3_Err
2196 }
2197 var templ_7745c5c3_Var115 string
2198 templ_7745c5c3_Var115, templ_7745c5c3_Err = templ.ResolveAttributeValue("L" + itoa64(ln.N))
2199 if templ_7745c5c3_Err != nil {
2200 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 317, Col: 28}
2201 }
2202 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var115)
2203 if templ_7745c5c3_Err != nil {
2204 return templ_7745c5c3_Err
2205 }
2206 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 185, "\" class=\"")
2207 if templ_7745c5c3_Err != nil {
2208 return templ_7745c5c3_Err
2209 }
2210 var templ_7745c5c3_Var116 string
2211 templ_7745c5c3_Var116, templ_7745c5c3_Err = templ.ResolveAttributeValue(templ.CSSClasses(templ_7745c5c3_Var114).String())
2212 if templ_7745c5c3_Err != nil {
2213 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 1, Col: 0}
2214 }
2215 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var116)
2216 if templ_7745c5c3_Err != nil {
2217 return templ_7745c5c3_Err
2218 }
2219 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 186, "\" data-step=\"")
2220 if templ_7745c5c3_Err != nil {
2221 return templ_7745c5c3_Err
2222 }
2223 var templ_7745c5c3_Var117 string
2224 templ_7745c5c3_Var117, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(int(ln.Step)))
2225 if templ_7745c5c3_Err != nil {
2226 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 317, Col: 84}
2227 }
2228 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var117)
2229 if templ_7745c5c3_Err != nil {
2230 return templ_7745c5c3_Err
2231 }
2232 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 187, "\"")
2233 if templ_7745c5c3_Err != nil {
2234 return templ_7745c5c3_Err
2235 }
2236 if ln.Continued {
2237 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 188, " data-cont")
2238 if templ_7745c5c3_Err != nil {
2239 return templ_7745c5c3_Err
2240 }
2241 }
2242 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 189, "><time>")
2243 if templ_7745c5c3_Err != nil {
2244 return templ_7745c5c3_Err
2245 }
2246 var templ_7745c5c3_Var118 string
2247 templ_7745c5c3_Var118, templ_7745c5c3_Err = templ.JoinStringErrs(ln.Time)
2248 if templ_7745c5c3_Err != nil {
2249 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 317, Col: 130}
2250 }
2251 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var118))
2252 if templ_7745c5c3_Err != nil {
2253 return templ_7745c5c3_Err
2254 }
2255 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 190, "</time><span class=\"t\">")
2256 if templ_7745c5c3_Err != nil {
2257 return templ_7745c5c3_Err
2258 }
2259 var templ_7745c5c3_Var119 string
2260 templ_7745c5c3_Var119, templ_7745c5c3_Err = templ.JoinStringErrs(ln.Text)
2261 if templ_7745c5c3_Err != nil {
2262 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 317, Col: 164}
2263 }
2264 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var119))
2265 if templ_7745c5c3_Err != nil {
2266 return templ_7745c5c3_Err
2267 }
2268 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 191, "</span></li>")
2269 if templ_7745c5c3_Err != nil {
2270 return templ_7745c5c3_Err
2271 }
2272 return nil
2273 })
2274}
2275
2276func jobRail(p JobPage) templ.Component {
2277 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2278 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2279 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2280 return templ_7745c5c3_CtxErr
2281 }
2282 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2283 if !templ_7745c5c3_IsBuffer {
2284 defer func() {
2285 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2286 if templ_7745c5c3_Err == nil {
2287 templ_7745c5c3_Err = templ_7745c5c3_BufErr
2288 }
2289 }()
2290 }
2291 ctx = templ.InitializeContext(ctx)
2292 templ_7745c5c3_Var120 := templ.GetChildren(ctx)
2293 if templ_7745c5c3_Var120 == nil {
2294 templ_7745c5c3_Var120 = templ.NopComponent
2295 }
2296 ctx = templ.ClearChildren(ctx)
2297 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 192, "<section aria-labelledby=\"r-job\"><h2 id=\"r-job\">Steps</h2>")
2298 if templ_7745c5c3_Err != nil {
2299 return templ_7745c5c3_Err
2300 }
2301 templ_7745c5c3_Err = JobSteps(p.Steps).Render(ctx, templ_7745c5c3_Buffer)
2302 if templ_7745c5c3_Err != nil {
2303 return templ_7745c5c3_Err
2304 }
2305 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 193, "</section><section aria-labelledby=\"r-jobf\"><h2 id=\"r-jobf\">Job</h2><dl class=\"kv\"><dt>run</dt><dd><a href=\"")
2306 if templ_7745c5c3_Err != nil {
2307 return templ_7745c5c3_Err
2308 }
2309 var templ_7745c5c3_Var121 templ.SafeURL
2310 templ_7745c5c3_Var121, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.RunHref))
2311 if templ_7745c5c3_Err != nil {
2312 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 329, Col: 41}
2313 }
2314 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var121))
2315 if templ_7745c5c3_Err != nil {
2316 return templ_7745c5c3_Err
2317 }
2318 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 194, "\">")
2319 if templ_7745c5c3_Err != nil {
2320 return templ_7745c5c3_Err
2321 }
2322 var templ_7745c5c3_Var122 string
2323 templ_7745c5c3_Var122, templ_7745c5c3_Err = templ.JoinStringErrs(p.RunName)
2324 if templ_7745c5c3_Err != nil {
2325 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 329, Col: 55}
2326 }
2327 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var122))
2328 if templ_7745c5c3_Err != nil {
2329 return templ_7745c5c3_Err
2330 }
2331 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 195, "</a></dd>")
2332 if templ_7745c5c3_Err != nil {
2333 return templ_7745c5c3_Err
2334 }
2335 if p.Runner != "" {
2336 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 196, "<dt>runner</dt><dd>")
2337 if templ_7745c5c3_Err != nil {
2338 return templ_7745c5c3_Err
2339 }
2340 var templ_7745c5c3_Var123 string
2341 templ_7745c5c3_Var123, templ_7745c5c3_Err = templ.JoinStringErrs(p.Runner)
2342 if templ_7745c5c3_Err != nil {
2343 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 332, Col: 18}
2344 }
2345 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var123))
2346 if templ_7745c5c3_Err != nil {
2347 return templ_7745c5c3_Err
2348 }
2349 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 197, "</dd>")
2350 if templ_7745c5c3_Err != nil {
2351 return templ_7745c5c3_Err
2352 }
2353 }
2354 if p.Isolation != "" {
2355 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 198, "<dt>isolation</dt><dd>")
2356 if templ_7745c5c3_Err != nil {
2357 return templ_7745c5c3_Err
2358 }
2359 var templ_7745c5c3_Var124 string
2360 templ_7745c5c3_Var124, templ_7745c5c3_Err = templ.JoinStringErrs(p.Isolation)
2361 if templ_7745c5c3_Err != nil {
2362 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 336, Col: 21}
2363 }
2364 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var124))
2365 if templ_7745c5c3_Err != nil {
2366 return templ_7745c5c3_Err
2367 }
2368 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 199, "</dd>")
2369 if templ_7745c5c3_Err != nil {
2370 return templ_7745c5c3_Err
2371 }
2372 }
2373 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 200, "<dt>lines</dt><dd>")
2374 if templ_7745c5c3_Err != nil {
2375 return templ_7745c5c3_Err
2376 }
2377 var templ_7745c5c3_Var125 string
2378 templ_7745c5c3_Var125, templ_7745c5c3_Err = templ.JoinStringErrs(itoa64(p.Total))
2379 if templ_7745c5c3_Err != nil {
2380 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 339, Col: 24}
2381 }
2382 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var125))
2383 if templ_7745c5c3_Err != nil {
2384 return templ_7745c5c3_Err
2385 }
2386 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 201, "</dd></dl><p><a href=\"")
2387 if templ_7745c5c3_Err != nil {
2388 return templ_7745c5c3_Err
2389 }
2390 var templ_7745c5c3_Var126 templ.SafeURL
2391 templ_7745c5c3_Var126, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.RawHref))
2392 if templ_7745c5c3_Err != nil {
2393 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 341, Col: 39}
2394 }
2395 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var126))
2396 if templ_7745c5c3_Err != nil {
2397 return templ_7745c5c3_Err
2398 }
2399 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 202, "\">raw log</a></p></section>")
2400 if templ_7745c5c3_Err != nil {
2401 return templ_7745c5c3_Err
2402 }
2403 return nil
2404 })
2405}
2406
2407// CommitChecks is the combined state of the checks of a commit, as a mark
2408// with a count, linking to the page that explains it.
2409func CommitChecks(c ChecksSummary) templ.Component {
2410 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2411 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2412 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2413 return templ_7745c5c3_CtxErr
2414 }
2415 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2416 if !templ_7745c5c3_IsBuffer {
2417 defer func() {
2418 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2419 if templ_7745c5c3_Err == nil {
2420 templ_7745c5c3_Err = templ_7745c5c3_BufErr
2421 }
2422 }()
2423 }
2424 ctx = templ.InitializeContext(ctx)
2425 templ_7745c5c3_Var127 := templ.GetChildren(ctx)
2426 if templ_7745c5c3_Var127 == nil {
2427 templ_7745c5c3_Var127 = templ.NopComponent
2428 }
2429 ctx = templ.ClearChildren(ctx)
2430 if c.Total > 0 {
2431 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 203, "<a class=\"ck-sum\" href=\"")
2432 if templ_7745c5c3_Err != nil {
2433 return templ_7745c5c3_Err
2434 }
2435 var templ_7745c5c3_Var128 templ.SafeURL
2436 templ_7745c5c3_Var128, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Href))
2437 if templ_7745c5c3_Err != nil {
2438 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 349, Col: 48}
2439 }
2440 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var128))
2441 if templ_7745c5c3_Err != nil {
2442 return templ_7745c5c3_Err
2443 }
2444 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 204, "\" title=\"")
2445 if templ_7745c5c3_Err != nil {
2446 return templ_7745c5c3_Err
2447 }
2448 var templ_7745c5c3_Var129 string
2449 templ_7745c5c3_Var129, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.Title)
2450 if templ_7745c5c3_Err != nil {
2451 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 349, Col: 66}
2452 }
2453 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var129)
2454 if templ_7745c5c3_Err != nil {
2455 return templ_7745c5c3_Err
2456 }
2457 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 205, "\">")
2458 if templ_7745c5c3_Err != nil {
2459 return templ_7745c5c3_Err
2460 }
2461 templ_7745c5c3_Err = CheckIcon(c.Kind, c.State).Render(ctx, templ_7745c5c3_Buffer)
2462 if templ_7745c5c3_Err != nil {
2463 return templ_7745c5c3_Err
2464 }
2465 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 206, "<span class=\"mute\">")
2466 if templ_7745c5c3_Err != nil {
2467 return templ_7745c5c3_Err
2468 }
2469 var templ_7745c5c3_Var130 string
2470 templ_7745c5c3_Var130, templ_7745c5c3_Err = templ.JoinStringErrs(c.Label)
2471 if templ_7745c5c3_Err != nil {
2472 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 351, Col: 31}
2473 }
2474 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var130))
2475 if templ_7745c5c3_Err != nil {
2476 return templ_7745c5c3_Err
2477 }
2478 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 207, "</span></a>")
2479 if templ_7745c5c3_Err != nil {
2480 return templ_7745c5c3_Err
2481 }
2482 }
2483 return nil
2484 })
2485}
2486
2487// MRChecks is the checks section of the rail of a merge request.
2488func MRChecks(c ChecksSection) templ.Component {
2489 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2490 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2491 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2492 return templ_7745c5c3_CtxErr
2493 }
2494 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2495 if !templ_7745c5c3_IsBuffer {
2496 defer func() {
2497 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2498 if templ_7745c5c3_Err == nil {
2499 templ_7745c5c3_Err = templ_7745c5c3_BufErr
2500 }
2501 }()
2502 }
2503 ctx = templ.InitializeContext(ctx)
2504 templ_7745c5c3_Var131 := templ.GetChildren(ctx)
2505 if templ_7745c5c3_Var131 == nil {
2506 templ_7745c5c3_Var131 = templ.NopComponent
2507 }
2508 ctx = templ.ClearChildren(ctx)
2509 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 208, "<section aria-labelledby=\"r-checks\" id=\"mr-checks\"><h2 id=\"r-checks\">Checks <span class=\"count\">")
2510 if templ_7745c5c3_Err != nil {
2511 return templ_7745c5c3_Err
2512 }
2513 var templ_7745c5c3_Var132 string
2514 templ_7745c5c3_Var132, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(c.Rows)))
2515 if templ_7745c5c3_Err != nil {
2516 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 359, Col: 66}
2517 }
2518 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var132))
2519 if templ_7745c5c3_Err != nil {
2520 return templ_7745c5c3_Err
2521 }
2522 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 209, "</span></h2>")
2523 if templ_7745c5c3_Err != nil {
2524 return templ_7745c5c3_Err
2525 }
2526 if len(c.Rows) == 0 {
2527 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 210, "<p class=\"dim\">no checks</p>")
2528 if templ_7745c5c3_Err != nil {
2529 return templ_7745c5c3_Err
2530 }
2531 } else {
2532 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 211, "<ul class=\"checks\">")
2533 if templ_7745c5c3_Err != nil {
2534 return templ_7745c5c3_Err
2535 }
2536 for _, r := range c.Rows {
2537 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 212, "<li>")
2538 if templ_7745c5c3_Err != nil {
2539 return templ_7745c5c3_Err
2540 }
2541 templ_7745c5c3_Err = CheckIcon(r.Kind, r.State).Render(ctx, templ_7745c5c3_Buffer)
2542 if templ_7745c5c3_Err != nil {
2543 return templ_7745c5c3_Err
2544 }
2545 if r.Href != "" {
2546 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 213, "<a href=\"")
2547 if templ_7745c5c3_Err != nil {
2548 return templ_7745c5c3_Err
2549 }
2550 var templ_7745c5c3_Var133 templ.SafeURL
2551 templ_7745c5c3_Var133, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(r.Href))
2552 if templ_7745c5c3_Err != nil {
2553 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 368, Col: 38}
2554 }
2555 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var133))
2556 if templ_7745c5c3_Err != nil {
2557 return templ_7745c5c3_Err
2558 }
2559 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 214, "\">")
2560 if templ_7745c5c3_Err != nil {
2561 return templ_7745c5c3_Err
2562 }
2563 var templ_7745c5c3_Var134 string
2564 templ_7745c5c3_Var134, templ_7745c5c3_Err = templ.JoinStringErrs(r.Name)
2565 if templ_7745c5c3_Err != nil {
2566 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 368, Col: 49}
2567 }
2568 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var134))
2569 if templ_7745c5c3_Err != nil {
2570 return templ_7745c5c3_Err
2571 }
2572 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 215, "</a> ")
2573 if templ_7745c5c3_Err != nil {
2574 return templ_7745c5c3_Err
2575 }
2576 } else {
2577 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 216, "<span>")
2578 if templ_7745c5c3_Err != nil {
2579 return templ_7745c5c3_Err
2580 }
2581 var templ_7745c5c3_Var135 string
2582 templ_7745c5c3_Var135, templ_7745c5c3_Err = templ.JoinStringErrs(r.Name)
2583 if templ_7745c5c3_Err != nil {
2584 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 370, Col: 21}
2585 }
2586 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var135))
2587 if templ_7745c5c3_Err != nil {
2588 return templ_7745c5c3_Err
2589 }
2590 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 217, "</span> ")
2591 if templ_7745c5c3_Err != nil {
2592 return templ_7745c5c3_Err
2593 }
2594 }
2595 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 218, "<span class=\"dim\">")
2596 if templ_7745c5c3_Err != nil {
2597 return templ_7745c5c3_Err
2598 }
2599 var templ_7745c5c3_Var136 string
2600 templ_7745c5c3_Var136, templ_7745c5c3_Err = templ.JoinStringErrs(r.State)
2601 if templ_7745c5c3_Err != nil {
2602 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 372, Col: 33}
2603 }
2604 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var136))
2605 if templ_7745c5c3_Err != nil {
2606 return templ_7745c5c3_Err
2607 }
2608 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 219, "</span> ")
2609 if templ_7745c5c3_Err != nil {
2610 return templ_7745c5c3_Err
2611 }
2612 if r.Waiting {
2613 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 220, "<span class=\"mute\">waiting for a runner</span>")
2614 if templ_7745c5c3_Err != nil {
2615 return templ_7745c5c3_Err
2616 }
2617 }
2618 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 221, "</li>")
2619 if templ_7745c5c3_Err != nil {
2620 return templ_7745c5c3_Err
2621 }
2622 }
2623 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 222, "</ul>")
2624 if templ_7745c5c3_Err != nil {
2625 return templ_7745c5c3_Err
2626 }
2627 }
2628 if c.Note != "" {
2629 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 223, "<p class=\"mute\">")
2630 if templ_7745c5c3_Err != nil {
2631 return templ_7745c5c3_Err
2632 }
2633 var templ_7745c5c3_Var137 string
2634 templ_7745c5c3_Var137, templ_7745c5c3_Err = templ.JoinStringErrs(c.Note)
2635 if templ_7745c5c3_Err != nil {
2636 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/actions.templ`, Line: 381, Col: 27}
2637 }
2638 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var137))
2639 if templ_7745c5c3_Err != nil {
2640 return templ_7745c5c3_Err
2641 }
2642 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 224, "</p>")
2643 if templ_7745c5c3_Err != nil {
2644 return templ_7745c5c3_Err
2645 }
2646 }
2647 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 225, "</section>")
2648 if templ_7745c5c3_Err != nil {
2649 return templ_7745c5c3_Err
2650 }
2651 return nil
2652 })
2653}
2654
2655var _ = templruntime.GeneratedTemplate