1// Code generated by templ - DO NOT EDIT.
2
3// templ: version: v0.3.1020
4// SPDX-License-Identifier: AGPL-3.0-or-later
5
6package web
7
8//lint:file-ignore SA4006 This context is only used if a nested component is present.
9
10import "github.com/a-h/templ"
11import templruntime "github.com/a-h/templ/runtime"
12
13// Shell is the page: head, the header, the work area (content and rail), the
14// footer, the hint badge, the overlays and the key map. The content is the
15// children.
16func Shell(l Layout, rail templ.Component) templ.Component {
17 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
18 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
19 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
20 return templ_7745c5c3_CtxErr
21 }
22 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
23 if !templ_7745c5c3_IsBuffer {
24 defer func() {
25 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
26 if templ_7745c5c3_Err == nil {
27 templ_7745c5c3_Err = templ_7745c5c3_BufErr
28 }
29 }()
30 }
31 ctx = templ.InitializeContext(ctx)
32 templ_7745c5c3_Var1 := templ.GetChildren(ctx)
33 if templ_7745c5c3_Var1 == nil {
34 templ_7745c5c3_Var1 = templ.NopComponent
35 }
36 ctx = templ.ClearChildren(ctx)
37 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><meta name=\"color-scheme\" content=\"light dark\"><title>")
38 if templ_7745c5c3_Err != nil {
39 return templ_7745c5c3_Err
40 }
41 var templ_7745c5c3_Var2 string
42 templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(l.Title)
43 if templ_7745c5c3_Err != nil {
44 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 15, Col: 19}
45 }
46 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
47 if templ_7745c5c3_Err != nil {
48 return templ_7745c5c3_Err
49 }
50 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</title><link rel=\"icon\" type=\"image/svg+xml\" href=\"")
51 if templ_7745c5c3_Err != nil {
52 return templ_7745c5c3_Err
53 }
54 var templ_7745c5c3_Var3 templ.SafeURL
55 templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(l.Assets.Icon))
56 if templ_7745c5c3_Err != nil {
57 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 16, Col: 76}
58 }
59 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
60 if templ_7745c5c3_Err != nil {
61 return templ_7745c5c3_Err
62 }
63 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\"><link rel=\"preload\" href=\"")
64 if templ_7745c5c3_Err != nil {
65 return templ_7745c5c3_Err
66 }
67 var templ_7745c5c3_Var4 templ.SafeURL
68 templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(l.Assets.Font))
69 if templ_7745c5c3_Err != nil {
70 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 17, Col: 58}
71 }
72 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
73 if templ_7745c5c3_Err != nil {
74 return templ_7745c5c3_Err
75 }
76 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\" as=\"font\" type=\"font/woff2\" crossorigin><link rel=\"stylesheet\" href=\"")
77 if templ_7745c5c3_Err != nil {
78 return templ_7745c5c3_Err
79 }
80 var templ_7745c5c3_Var5 templ.SafeURL
81 templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(l.Assets.CSS))
82 if templ_7745c5c3_Err != nil {
83 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 18, Col: 60}
84 }
85 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
86 if templ_7745c5c3_Err != nil {
87 return templ_7745c5c3_Err
88 }
89 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "\"><meta name=\"htmx-config\" content='{\"history\":false,\"includeIndicatorCSS\":false,\"extensions\":\"sse, hx-live\"}'><script src=\"")
90 if templ_7745c5c3_Err != nil {
91 return templ_7745c5c3_Err
92 }
93 var templ_7745c5c3_Var6 string
94 templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.HTMX)
95 if templ_7745c5c3_Err != nil {
96 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 20, Col: 30}
97 }
98 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var6)
99 if templ_7745c5c3_Err != nil {
100 return templ_7745c5c3_Err
101 }
102 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "\" defer></script><script src=\"")
103 if templ_7745c5c3_Err != nil {
104 return templ_7745c5c3_Err
105 }
106 var templ_7745c5c3_Var7 string
107 templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.Live)
108 if templ_7745c5c3_Err != nil {
109 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 21, Col: 30}
110 }
111 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7)
112 if templ_7745c5c3_Err != nil {
113 return templ_7745c5c3_Err
114 }
115 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "\" defer></script><script src=\"")
116 if templ_7745c5c3_Err != nil {
117 return templ_7745c5c3_Err
118 }
119 var templ_7745c5c3_Var8 string
120 templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.SSE)
121 if templ_7745c5c3_Err != nil {
122 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 22, Col: 29}
123 }
124 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8)
125 if templ_7745c5c3_Err != nil {
126 return templ_7745c5c3_Err
127 }
128 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "\" defer></script><script src=\"")
129 if templ_7745c5c3_Err != nil {
130 return templ_7745c5c3_Err
131 }
132 var templ_7745c5c3_Var9 string
133 templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.App)
134 if templ_7745c5c3_Err != nil {
135 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 23, Col: 29}
136 }
137 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
138 if templ_7745c5c3_Err != nil {
139 return templ_7745c5c3_Err
140 }
141 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "\" defer></script><script src=\"")
142 if templ_7745c5c3_Err != nil {
143 return templ_7745c5c3_Err
144 }
145 var templ_7745c5c3_Var10 string
146 templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.Files)
147 if templ_7745c5c3_Err != nil {
148 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 24, Col: 31}
149 }
150 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10)
151 if templ_7745c5c3_Err != nil {
152 return templ_7745c5c3_Err
153 }
154 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "\" defer></script><script src=\"")
155 if templ_7745c5c3_Err != nil {
156 return templ_7745c5c3_Err
157 }
158 var templ_7745c5c3_Var11 string
159 templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.Passkey)
160 if templ_7745c5c3_Err != nil {
161 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 25, Col: 33}
162 }
163 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11)
164 if templ_7745c5c3_Err != nil {
165 return templ_7745c5c3_Err
166 }
167 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "\" defer></script><script src=\"")
168 if templ_7745c5c3_Err != nil {
169 return templ_7745c5c3_Err
170 }
171 var templ_7745c5c3_Var12 string
172 templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.Log)
173 if templ_7745c5c3_Err != nil {
174 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 26, Col: 29}
175 }
176 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12)
177 if templ_7745c5c3_Err != nil {
178 return templ_7745c5c3_Err
179 }
180 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "\" defer></script></head><body data-ref=\"")
181 if templ_7745c5c3_Err != nil {
182 return templ_7745c5c3_Err
183 }
184 var templ_7745c5c3_Var13 string
185 templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.RefPath)
186 if templ_7745c5c3_Err != nil {
187 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 29, Col: 23}
188 }
189 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13)
190 if templ_7745c5c3_Err != nil {
191 return templ_7745c5c3_Err
192 }
193 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "\" data-sha=\"")
194 if templ_7745c5c3_Err != nil {
195 return templ_7745c5c3_Err
196 }
197 var templ_7745c5c3_Var14 string
198 templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.SHA)
199 if templ_7745c5c3_Err != nil {
200 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 30, Col: 19}
201 }
202 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14)
203 if templ_7745c5c3_Err != nil {
204 return templ_7745c5c3_Err
205 }
206 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "\" data-sel=\"\" data-nav=\"\"")
207 if templ_7745c5c3_Err != nil {
208 return templ_7745c5c3_Err
209 }
210 if l.PathsURL != "" {
211 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, " data-paths=\"")
212 if templ_7745c5c3_Err != nil {
213 return templ_7745c5c3_Err
214 }
215 var templ_7745c5c3_Var15 string
216 templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.PathsURL)
217 if templ_7745c5c3_Err != nil {
218 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 34, Col: 27}
219 }
220 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var15)
221 if templ_7745c5c3_Err != nil {
222 return templ_7745c5c3_Err
223 }
224 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "\" data-blob=\"")
225 if templ_7745c5c3_Err != nil {
226 return templ_7745c5c3_Err
227 }
228 var templ_7745c5c3_Var16 string
229 templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.BlobBase)
230 if templ_7745c5c3_Err != nil {
231 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 35, Col: 26}
232 }
233 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var16)
234 if templ_7745c5c3_Err != nil {
235 return templ_7745c5c3_Err
236 }
237 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "\"")
238 if templ_7745c5c3_Err != nil {
239 return templ_7745c5c3_Err
240 }
241 }
242 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "><a class=\"skip\" href=\"#main\">skip to content</a>")
243 if templ_7745c5c3_Err != nil {
244 return templ_7745c5c3_Err
245 }
246 templ_7745c5c3_Err = Header(l).Render(ctx, templ_7745c5c3_Buffer)
247 if templ_7745c5c3_Err != nil {
248 return templ_7745c5c3_Err
249 }
250 var templ_7745c5c3_Var17 = []any{"work", templ.KV("has-rail", l.HasRail && rail != nil)}
251 templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var17...)
252 if templ_7745c5c3_Err != nil {
253 return templ_7745c5c3_Err
254 }
255 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "<div class=\"")
256 if templ_7745c5c3_Err != nil {
257 return templ_7745c5c3_Err
258 }
259 var templ_7745c5c3_Var18 string
260 templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.ResolveAttributeValue(templ.CSSClasses(templ_7745c5c3_Var17).String())
261 if templ_7745c5c3_Err != nil {
262 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 1, Col: 0}
263 }
264 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var18)
265 if templ_7745c5c3_Err != nil {
266 return templ_7745c5c3_Err
267 }
268 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "\">")
269 if templ_7745c5c3_Err != nil {
270 return templ_7745c5c3_Err
271 }
272 if l.Lede != "" {
273 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "<section class=\"work-lede\" aria-label=\"Description\"><p class=\"lede\">")
274 if templ_7745c5c3_Err != nil {
275 return templ_7745c5c3_Err
276 }
277 var templ_7745c5c3_Var19 string
278 templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(l.Lede)
279 if templ_7745c5c3_Err != nil {
280 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 42, Col: 81}
281 }
282 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
283 if templ_7745c5c3_Err != nil {
284 return templ_7745c5c3_Err
285 }
286 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</p></section>")
287 if templ_7745c5c3_Err != nil {
288 return templ_7745c5c3_Err
289 }
290 }
291 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<main id=\"main\" tabindex=\"-1\">")
292 if templ_7745c5c3_Err != nil {
293 return templ_7745c5c3_Err
294 }
295 templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer)
296 if templ_7745c5c3_Err != nil {
297 return templ_7745c5c3_Err
298 }
299 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "</main>")
300 if templ_7745c5c3_Err != nil {
301 return templ_7745c5c3_Err
302 }
303 if l.HasRail && rail != nil {
304 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<aside class=\"rail\" aria-label=\"Context\">")
305 if templ_7745c5c3_Err != nil {
306 return templ_7745c5c3_Err
307 }
308 templ_7745c5c3_Err = rail.Render(ctx, templ_7745c5c3_Buffer)
309 if templ_7745c5c3_Err != nil {
310 return templ_7745c5c3_Err
311 }
312 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "</aside>")
313 if templ_7745c5c3_Err != nil {
314 return templ_7745c5c3_Err
315 }
316 }
317 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "</div>")
318 if templ_7745c5c3_Err != nil {
319 return templ_7745c5c3_Err
320 }
321 templ_7745c5c3_Err = Footer(l).Render(ctx, templ_7745c5c3_Buffer)
322 if templ_7745c5c3_Err != nil {
323 return templ_7745c5c3_Err
324 }
325 templ_7745c5c3_Err = Hint(l).Render(ctx, templ_7745c5c3_Buffer)
326 if templ_7745c5c3_Err != nil {
327 return templ_7745c5c3_Err
328 }
329 templ_7745c5c3_Err = OverlayHelp().Render(ctx, templ_7745c5c3_Buffer)
330 if templ_7745c5c3_Err != nil {
331 return templ_7745c5c3_Err
332 }
333 templ_7745c5c3_Err = OverlayRefs(l).Render(ctx, templ_7745c5c3_Buffer)
334 if templ_7745c5c3_Err != nil {
335 return templ_7745c5c3_Err
336 }
337 templ_7745c5c3_Err = OverlayCmd(l.Cmd).Render(ctx, templ_7745c5c3_Buffer)
338 if templ_7745c5c3_Err != nil {
339 return templ_7745c5c3_Err
340 }
341 templ_7745c5c3_Err = Keys().Render(ctx, templ_7745c5c3_Buffer)
342 if templ_7745c5c3_Err != nil {
343 return templ_7745c5c3_Err
344 }
345 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "</body></html>")
346 if templ_7745c5c3_Err != nil {
347 return templ_7745c5c3_Err
348 }
349 return nil
350 })
351}
352
353// Header is the page header: the instance, the path, the ref switcher, the
354// "go to" palette and the owner; inside a repository, the tabs below.
355func Header(l Layout) templ.Component {
356 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
357 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
358 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
359 return templ_7745c5c3_CtxErr
360 }
361 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
362 if !templ_7745c5c3_IsBuffer {
363 defer func() {
364 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
365 if templ_7745c5c3_Err == nil {
366 templ_7745c5c3_Err = templ_7745c5c3_BufErr
367 }
368 }()
369 }
370 ctx = templ.InitializeContext(ctx)
371 templ_7745c5c3_Var20 := templ.GetChildren(ctx)
372 if templ_7745c5c3_Var20 == nil {
373 templ_7745c5c3_Var20 = templ.NopComponent
374 }
375 ctx = templ.ClearChildren(ctx)
376 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "<header class=\"hdr\"><div class=\"hdr-top\"><a class=\"brand\" href=\"/\" data-g=\"h\" title=\"home (g h)\"><span class=\"brand-mark\" aria-hidden=\"true\"></span> <span class=\"brand-name\">")
377 if templ_7745c5c3_Err != nil {
378 return templ_7745c5c3_Err
379 }
380 var templ_7745c5c3_Var21 string
381 templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(l.Instance)
382 if templ_7745c5c3_Err != nil {
383 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 70, Col: 41}
384 }
385 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
386 if templ_7745c5c3_Err != nil {
387 return templ_7745c5c3_Err
388 }
389 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "</span></a> ")
390 if templ_7745c5c3_Err != nil {
391 return templ_7745c5c3_Err
392 }
393 if len(l.Crumbs) > 0 {
394 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "<nav class=\"crumbs\" aria-label=\"Path\"><ol>")
395 if templ_7745c5c3_Err != nil {
396 return templ_7745c5c3_Err
397 }
398 for _, c := range l.Crumbs {
399 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "<li>")
400 if templ_7745c5c3_Err != nil {
401 return templ_7745c5c3_Err
402 }
403 if c.Href != "" {
404 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "<a href=\"")
405 if templ_7745c5c3_Err != nil {
406 return templ_7745c5c3_Err
407 }
408 var templ_7745c5c3_Var22 templ.SafeURL
409 templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Href))
410 if templ_7745c5c3_Err != nil {
411 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 79, Col: 38}
412 }
413 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
414 if templ_7745c5c3_Err != nil {
415 return templ_7745c5c3_Err
416 }
417 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "\"")
418 if templ_7745c5c3_Err != nil {
419 return templ_7745c5c3_Err
420 }
421 if c.Current {
422 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, " aria-current=\"page\"")
423 if templ_7745c5c3_Err != nil {
424 return templ_7745c5c3_Err
425 }
426 }
427 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, ">")
428 if templ_7745c5c3_Err != nil {
429 return templ_7745c5c3_Err
430 }
431 var templ_7745c5c3_Var23 string
432 templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(c.Label)
433 if templ_7745c5c3_Err != nil {
434 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 83, Col: 19}
435 }
436 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
437 if templ_7745c5c3_Err != nil {
438 return templ_7745c5c3_Err
439 }
440 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "</a>")
441 if templ_7745c5c3_Err != nil {
442 return templ_7745c5c3_Err
443 }
444 } else {
445 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "<span")
446 if templ_7745c5c3_Err != nil {
447 return templ_7745c5c3_Err
448 }
449 if c.Current {
450 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, " aria-current=\"page\"")
451 if templ_7745c5c3_Err != nil {
452 return templ_7745c5c3_Err
453 }
454 }
455 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, ">")
456 if templ_7745c5c3_Err != nil {
457 return templ_7745c5c3_Err
458 }
459 var templ_7745c5c3_Var24 string
460 templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(c.Label)
461 if templ_7745c5c3_Err != nil {
462 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 89, Col: 19}
463 }
464 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
465 if templ_7745c5c3_Err != nil {
466 return templ_7745c5c3_Err
467 }
468 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "</span>")
469 if templ_7745c5c3_Err != nil {
470 return templ_7745c5c3_Err
471 }
472 }
473 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "</li>")
474 if templ_7745c5c3_Err != nil {
475 return templ_7745c5c3_Err
476 }
477 }
478 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "</ol></nav>")
479 if templ_7745c5c3_Err != nil {
480 return templ_7745c5c3_Err
481 }
482 }
483 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "<div class=\"hdr-acts\">")
484 if templ_7745c5c3_Err != nil {
485 return templ_7745c5c3_Err
486 }
487 if l.Ref != "" {
488 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "<a class=\"btn ref\" href=\"")
489 if templ_7745c5c3_Err != nil {
490 return templ_7745c5c3_Err
491 }
492 var templ_7745c5c3_Var25 templ.SafeURL
493 templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(repoHref(l.Repo, "refs")))
494 if templ_7745c5c3_Err != nil {
495 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 100, Col: 52}
496 }
497 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
498 if templ_7745c5c3_Err != nil {
499 return templ_7745c5c3_Err
500 }
501 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "\" data-fire=\"refs\" aria-keyshortcuts=\"b\" title=\"switch branch or tag (b)\"><span class=\"ico i-branch\" aria-hidden=\"true\"></span> <span class=\"ref-name\">")
502 if templ_7745c5c3_Err != nil {
503 return templ_7745c5c3_Err
504 }
505 var templ_7745c5c3_Var26 string
506 templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(l.Ref)
507 if templ_7745c5c3_Err != nil {
508 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 106, Col: 36}
509 }
510 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
511 if templ_7745c5c3_Err != nil {
512 return templ_7745c5c3_Err
513 }
514 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "</span> <span class=\"sha\">")
515 if templ_7745c5c3_Err != nil {
516 return templ_7745c5c3_Err
517 }
518 var templ_7745c5c3_Var27 string
519 templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(l.Short)
520 if templ_7745c5c3_Err != nil {
521 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 107, Col: 33}
522 }
523 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
524 if templ_7745c5c3_Err != nil {
525 return templ_7745c5c3_Err
526 }
527 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "</span></a> ")
528 if templ_7745c5c3_Err != nil {
529 return templ_7745c5c3_Err
530 }
531 }
532 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "<button type=\"button\" class=\"btn search\" data-js aria-haspopup=\"dialog\" aria-controls=\"panel-cmd\" aria-keyshortcuts=\"Control+K :\" title=\"go to a section, ref, file or repo (ctrl k or :)\" data-fire=\"cmd\"><span class=\"ico i-search\" aria-hidden=\"true\"></span> <span class=\"search-label\">Go to…</span> <kbd aria-hidden=\"true\">ctrl k</kbd></button> <button type=\"button\" class=\"btn icon\" data-js data-fire=\"help\" aria-haspopup=\"dialog\" aria-controls=\"panel-help\" aria-keyshortcuts=\"?\" aria-label=\"Keyboard shortcuts\" title=\"keyboard shortcuts (?)\">?</button> ")
533 if templ_7745c5c3_Err != nil {
534 return templ_7745c5c3_Err
535 }
536 if SignedIn(ctx) {
537 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "<form class=\"owner\" method=\"post\" action=\"/-/logout\"><span class=\"owner-badge\" title=\"signed in as the owner\">owner</span> ")
538 if templ_7745c5c3_Err != nil {
539 return templ_7745c5c3_Err
540 }
541 if l.Passkeys {
542 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "<a class=\"btn\" href=\"/-/passkeys\" title=\"add or remove the passkeys that sign you in\">Passkeys</a> ")
543 if templ_7745c5c3_Err != nil {
544 return templ_7745c5c3_Err
545 }
546 }
547 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "<button type=\"submit\" class=\"btn\" title=\"sign out of this browser\">Sign out</button></form>")
548 if templ_7745c5c3_Err != nil {
549 return templ_7745c5c3_Err
550 }
551 } else if l.Passkeys {
552 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "<a class=\"btn\" href=\"/-/login\" title=\"sign in with a passkey\">Sign in</a>")
553 if templ_7745c5c3_Err != nil {
554 return templ_7745c5c3_Err
555 }
556 }
557 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "</div></div>")
558 if templ_7745c5c3_Err != nil {
559 return templ_7745c5c3_Err
560 }
561 if len(l.Sections) > 0 {
562 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "<nav class=\"tabs\" aria-label=\"Sections\"><ul>")
563 if templ_7745c5c3_Err != nil {
564 return templ_7745c5c3_Err
565 }
566 for _, s := range l.Sections {
567 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "<li><a href=\"")
568 if templ_7745c5c3_Err != nil {
569 return templ_7745c5c3_Err
570 }
571 var templ_7745c5c3_Var28 templ.SafeURL
572 templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(s.Href))
573 if templ_7745c5c3_Err != nil {
574 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 144, Col: 36}
575 }
576 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
577 if templ_7745c5c3_Err != nil {
578 return templ_7745c5c3_Err
579 }
580 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "\" data-key=\"")
581 if templ_7745c5c3_Err != nil {
582 return templ_7745c5c3_Err
583 }
584 var templ_7745c5c3_Var29 string
585 templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.ResolveAttributeValue(s.Key)
586 if templ_7745c5c3_Err != nil {
587 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 145, Col: 24}
588 }
589 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var29)
590 if templ_7745c5c3_Err != nil {
591 return templ_7745c5c3_Err
592 }
593 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "\" aria-keyshortcuts=\"")
594 if templ_7745c5c3_Err != nil {
595 return templ_7745c5c3_Err
596 }
597 var templ_7745c5c3_Var30 string
598 templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.ResolveAttributeValue(s.Key)
599 if templ_7745c5c3_Err != nil {
600 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 146, Col: 33}
601 }
602 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var30)
603 if templ_7745c5c3_Err != nil {
604 return templ_7745c5c3_Err
605 }
606 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "\"")
607 if templ_7745c5c3_Err != nil {
608 return templ_7745c5c3_Err
609 }
610 if s.Current {
611 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, " aria-current=\"page\"")
612 if templ_7745c5c3_Err != nil {
613 return templ_7745c5c3_Err
614 }
615 }
616 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, ">")
617 if templ_7745c5c3_Err != nil {
618 return templ_7745c5c3_Err
619 }
620 var templ_7745c5c3_Var31 string
621 templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(s.Label)
622 if templ_7745c5c3_Err != nil {
623 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 150, Col: 17}
624 }
625 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
626 if templ_7745c5c3_Err != nil {
627 return templ_7745c5c3_Err
628 }
629 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "<kbd aria-hidden=\"true\">")
630 if templ_7745c5c3_Err != nil {
631 return templ_7745c5c3_Err
632 }
633 var templ_7745c5c3_Var32 string
634 templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(s.Key)
635 if templ_7745c5c3_Err != nil {
636 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 150, Col: 50}
637 }
638 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
639 if templ_7745c5c3_Err != nil {
640 return templ_7745c5c3_Err
641 }
642 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "</kbd></a></li>")
643 if templ_7745c5c3_Err != nil {
644 return templ_7745c5c3_Err
645 }
646 }
647 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "</ul></nav>")
648 if templ_7745c5c3_Err != nil {
649 return templ_7745c5c3_Err
650 }
651 }
652 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "</header>")
653 if templ_7745c5c3_Err != nil {
654 return templ_7745c5c3_Err
655 }
656 return nil
657 })
658}
659
660// Footer is the version and the link to the source of the running version,
661// which the AGPL §13 asks every user of the service to be offered.
662func Footer(l Layout) templ.Component {
663 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
664 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
665 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
666 return templ_7745c5c3_CtxErr
667 }
668 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
669 if !templ_7745c5c3_IsBuffer {
670 defer func() {
671 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
672 if templ_7745c5c3_Err == nil {
673 templ_7745c5c3_Err = templ_7745c5c3_BufErr
674 }
675 }()
676 }
677 ctx = templ.InitializeContext(ctx)
678 templ_7745c5c3_Var33 := templ.GetChildren(ctx)
679 if templ_7745c5c3_Var33 == nil {
680 templ_7745c5c3_Var33 = templ.NopComponent
681 }
682 ctx = templ.ClearChildren(ctx)
683 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "<footer class=\"foot\"><span>ermite ")
684 if templ_7745c5c3_Err != nil {
685 return templ_7745c5c3_Err
686 }
687 var templ_7745c5c3_Var34 string
688 templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(l.Version)
689 if templ_7745c5c3_Err != nil {
690 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 163, Col: 26}
691 }
692 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34))
693 if templ_7745c5c3_Err != nil {
694 return templ_7745c5c3_Err
695 }
696 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "</span> <a href=\"")
697 if templ_7745c5c3_Err != nil {
698 return templ_7745c5c3_Err
699 }
700 var templ_7745c5c3_Var35 templ.SafeURL
701 templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(l.SourceURL))
702 if templ_7745c5c3_Err != nil {
703 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 164, Col: 38}
704 }
705 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
706 if templ_7745c5c3_Err != nil {
707 return templ_7745c5c3_Err
708 }
709 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "\" rel=\"noopener\" title=\"source of this version (AGPL-3.0-or-later)\">source</a> <span class=\"foot-keys\"><kbd>?</kbd> keyboard shortcuts</span></footer>")
710 if templ_7745c5c3_Err != nil {
711 return templ_7745c5c3_Err
712 }
713 return nil
714 })
715}
716
717// Hint is the floating badge at the bottom right. It shows only what the
718// keyboard just did or what needs attention: the row position while j/k
719// move, the selected lines of a file, a flash message (permalink copied) and
720// a lost event stream. Empty, it takes no room.
721func Hint(l Layout) templ.Component {
722 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
723 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
724 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
725 return templ_7745c5c3_CtxErr
726 }
727 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
728 if !templ_7745c5c3_IsBuffer {
729 defer func() {
730 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
731 if templ_7745c5c3_Err == nil {
732 templ_7745c5c3_Err = templ_7745c5c3_BufErr
733 }
734 }()
735 }
736 ctx = templ.InitializeContext(ctx)
737 templ_7745c5c3_Var36 := templ.GetChildren(ctx)
738 if templ_7745c5c3_Var36 == nil {
739 templ_7745c5c3_Var36 = templ.NopComponent
740 }
741 ctx = templ.ClearChildren(ctx)
742 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "<div class=\"hint\" role=\"status\" aria-live=\"polite\"><span class=\"hint-nav\" :text=\"document.body.dataset.nav || ''\"></span> <span class=\"hint-sel\" :text=\"document.body.dataset.sel ? document.body.dataset.sel + ' · y permalink' : ''\"></span> <span class=\"hint-flash\" :text=\"document.body.dataset.flash || ''\"></span>")
743 if templ_7745c5c3_Err != nil {
744 return templ_7745c5c3_Err
745 }
746 templ_7745c5c3_Err = Live(l).Render(ctx, templ_7745c5c3_Buffer)
747 if templ_7745c5c3_Err != nil {
748 return templ_7745c5c3_Err
749 }
750 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, "</div>")
751 if templ_7745c5c3_Err != nil {
752 return templ_7745c5c3_Err
753 }
754 return nil
755 })
756}
757
758var _ = templruntime.GeneratedTemplate