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><meta name=\"theme-color\" media=\"(prefers-color-scheme: light)\" content=\"#ffffff\"><meta name=\"theme-color\" media=\"(prefers-color-scheme: dark)\" content=\"#0c0c0c\"><meta name=\"apple-mobile-web-app-title\" content=\"ermite\"><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: 19, 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=\"apple-touch-icon\" 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.AppleIcon))
69 if templ_7745c5c3_Err != nil {
70 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 20, Col: 72}
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, "\"><link rel=\"manifest\" 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.Manifest))
82 if templ_7745c5c3_Err != nil {
83 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 21, Col: 63}
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, "\"><link rel=\"preload\" href=\"")
90 if templ_7745c5c3_Err != nil {
91 return templ_7745c5c3_Err
92 }
93 var templ_7745c5c3_Var6 templ.SafeURL
94 templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(l.Assets.Font))
95 if templ_7745c5c3_Err != nil {
96 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 22, Col: 58}
97 }
98 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(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, "\" as=\"font\" type=\"font/woff2\" crossorigin><link rel=\"stylesheet\" href=\"")
103 if templ_7745c5c3_Err != nil {
104 return templ_7745c5c3_Err
105 }
106 var templ_7745c5c3_Var7 templ.SafeURL
107 templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(l.Assets.CSS))
108 if templ_7745c5c3_Err != nil {
109 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 23, Col: 60}
110 }
111 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(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, "\"><meta name=\"htmx-config\" content='{\"history\":false,\"includeIndicatorCSS\":false,\"extensions\":\"sse, hx-live\"}'><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.HTMX)
121 if templ_7745c5c3_Err != nil {
122 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 25, Col: 30}
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.Live)
134 if templ_7745c5c3_Err != nil {
135 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 26, Col: 30}
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.SSE)
147 if templ_7745c5c3_Err != nil {
148 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 27, Col: 29}
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.Store)
160 if templ_7745c5c3_Err != nil {
161 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 28, Col: 31}
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, "\"></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.App)
173 if templ_7745c5c3_Err != nil {
174 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 29, 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><script src=\"")
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.Assets.Files)
186 if templ_7745c5c3_Err != nil {
187 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 30, Col: 31}
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, "\" defer></script><script src=\"")
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.Assets.Passkey)
199 if templ_7745c5c3_Err != nil {
200 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 31, Col: 33}
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, "\" defer></script><script src=\"")
207 if templ_7745c5c3_Err != nil {
208 return templ_7745c5c3_Err
209 }
210 var templ_7745c5c3_Var15 string
211 templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.Log)
212 if templ_7745c5c3_Err != nil {
213 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 32, Col: 29}
214 }
215 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var15)
216 if templ_7745c5c3_Err != nil {
217 return templ_7745c5c3_Err
218 }
219 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "\" defer></script>")
220 if templ_7745c5c3_Err != nil {
221 return templ_7745c5c3_Err
222 }
223 if l.Lazy {
224 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<script src=\"")
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.Assets.Lazy)
230 if templ_7745c5c3_Err != nil {
231 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 34, Col: 31}
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, "\" defer></script>")
238 if templ_7745c5c3_Err != nil {
239 return templ_7745c5c3_Err
240 }
241 }
242 if l.MR {
243 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<script src=\"")
244 if templ_7745c5c3_Err != nil {
245 return templ_7745c5c3_Err
246 }
247 var templ_7745c5c3_Var17 string
248 templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.MR)
249 if templ_7745c5c3_Err != nil {
250 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 37, Col: 29}
251 }
252 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var17)
253 if templ_7745c5c3_Err != nil {
254 return templ_7745c5c3_Err
255 }
256 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "\" defer></script>")
257 if templ_7745c5c3_Err != nil {
258 return templ_7745c5c3_Err
259 }
260 }
261 if l.IssueForm {
262 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<script src=\"")
263 if templ_7745c5c3_Err != nil {
264 return templ_7745c5c3_Err
265 }
266 var templ_7745c5c3_Var18 string
267 templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.IssueForm)
268 if templ_7745c5c3_Err != nil {
269 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 40, Col: 36}
270 }
271 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var18)
272 if templ_7745c5c3_Err != nil {
273 return templ_7745c5c3_Err
274 }
275 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "\" defer></script>")
276 if templ_7745c5c3_Err != nil {
277 return templ_7745c5c3_Err
278 }
279 }
280 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</head><body data-ref=\"")
281 if templ_7745c5c3_Err != nil {
282 return templ_7745c5c3_Err
283 }
284 var templ_7745c5c3_Var19 string
285 templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.RefPath)
286 if templ_7745c5c3_Err != nil {
287 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 44, Col: 23}
288 }
289 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var19)
290 if templ_7745c5c3_Err != nil {
291 return templ_7745c5c3_Err
292 }
293 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "\" data-sha=\"")
294 if templ_7745c5c3_Err != nil {
295 return templ_7745c5c3_Err
296 }
297 var templ_7745c5c3_Var20 string
298 templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.SHA)
299 if templ_7745c5c3_Err != nil {
300 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 45, Col: 19}
301 }
302 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var20)
303 if templ_7745c5c3_Err != nil {
304 return templ_7745c5c3_Err
305 }
306 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "\" data-sel=\"\" data-nav=\"\"")
307 if templ_7745c5c3_Err != nil {
308 return templ_7745c5c3_Err
309 }
310 if l.PathsURL != "" {
311 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, " data-paths=\"")
312 if templ_7745c5c3_Err != nil {
313 return templ_7745c5c3_Err
314 }
315 var templ_7745c5c3_Var21 string
316 templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.PathsURL)
317 if templ_7745c5c3_Err != nil {
318 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 49, Col: 27}
319 }
320 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var21)
321 if templ_7745c5c3_Err != nil {
322 return templ_7745c5c3_Err
323 }
324 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "\" data-blob=\"")
325 if templ_7745c5c3_Err != nil {
326 return templ_7745c5c3_Err
327 }
328 var templ_7745c5c3_Var22 string
329 templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.BlobBase)
330 if templ_7745c5c3_Err != nil {
331 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 50, Col: 26}
332 }
333 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var22)
334 if templ_7745c5c3_Err != nil {
335 return templ_7745c5c3_Err
336 }
337 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "\"")
338 if templ_7745c5c3_Err != nil {
339 return templ_7745c5c3_Err
340 }
341 }
342 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "><a class=\"skip\" href=\"#main\">skip to content</a>")
343 if templ_7745c5c3_Err != nil {
344 return templ_7745c5c3_Err
345 }
346 templ_7745c5c3_Err = Header(l).Render(ctx, templ_7745c5c3_Buffer)
347 if templ_7745c5c3_Err != nil {
348 return templ_7745c5c3_Err
349 }
350 var templ_7745c5c3_Var23 = []any{"work", templ.KV("has-rail", l.HasRail && rail != nil)}
351 templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var23...)
352 if templ_7745c5c3_Err != nil {
353 return templ_7745c5c3_Err
354 }
355 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "<div class=\"")
356 if templ_7745c5c3_Err != nil {
357 return templ_7745c5c3_Err
358 }
359 var templ_7745c5c3_Var24 string
360 templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.ResolveAttributeValue(templ.CSSClasses(templ_7745c5c3_Var23).String())
361 if templ_7745c5c3_Err != nil {
362 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 1, Col: 0}
363 }
364 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24)
365 if templ_7745c5c3_Err != nil {
366 return templ_7745c5c3_Err
367 }
368 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "\">")
369 if templ_7745c5c3_Err != nil {
370 return templ_7745c5c3_Err
371 }
372 if l.Lede != "" {
373 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "<section class=\"work-lede\" aria-label=\"Description\"><p class=\"lede\">")
374 if templ_7745c5c3_Err != nil {
375 return templ_7745c5c3_Err
376 }
377 var templ_7745c5c3_Var25 string
378 templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(l.Lede)
379 if templ_7745c5c3_Err != nil {
380 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 57, Col: 81}
381 }
382 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
383 if templ_7745c5c3_Err != nil {
384 return templ_7745c5c3_Err
385 }
386 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "</p></section>")
387 if templ_7745c5c3_Err != nil {
388 return templ_7745c5c3_Err
389 }
390 }
391 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "<main id=\"main\" tabindex=\"-1\">")
392 if templ_7745c5c3_Err != nil {
393 return templ_7745c5c3_Err
394 }
395 templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer)
396 if templ_7745c5c3_Err != nil {
397 return templ_7745c5c3_Err
398 }
399 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "</main>")
400 if templ_7745c5c3_Err != nil {
401 return templ_7745c5c3_Err
402 }
403 if l.HasRail && rail != nil {
404 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "<aside class=\"rail\" aria-label=\"Context\">")
405 if templ_7745c5c3_Err != nil {
406 return templ_7745c5c3_Err
407 }
408 templ_7745c5c3_Err = rail.Render(ctx, templ_7745c5c3_Buffer)
409 if templ_7745c5c3_Err != nil {
410 return templ_7745c5c3_Err
411 }
412 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "</aside>")
413 if templ_7745c5c3_Err != nil {
414 return templ_7745c5c3_Err
415 }
416 }
417 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "</div>")
418 if templ_7745c5c3_Err != nil {
419 return templ_7745c5c3_Err
420 }
421 templ_7745c5c3_Err = Footer(l).Render(ctx, templ_7745c5c3_Buffer)
422 if templ_7745c5c3_Err != nil {
423 return templ_7745c5c3_Err
424 }
425 templ_7745c5c3_Err = Hint(l).Render(ctx, templ_7745c5c3_Buffer)
426 if templ_7745c5c3_Err != nil {
427 return templ_7745c5c3_Err
428 }
429 templ_7745c5c3_Err = OverlayHelp(l.MR).Render(ctx, templ_7745c5c3_Buffer)
430 if templ_7745c5c3_Err != nil {
431 return templ_7745c5c3_Err
432 }
433 templ_7745c5c3_Err = OverlayRefs(l).Render(ctx, templ_7745c5c3_Buffer)
434 if templ_7745c5c3_Err != nil {
435 return templ_7745c5c3_Err
436 }
437 templ_7745c5c3_Err = OverlayCmd(l.Cmd).Render(ctx, templ_7745c5c3_Buffer)
438 if templ_7745c5c3_Err != nil {
439 return templ_7745c5c3_Err
440 }
441 templ_7745c5c3_Err = Keys().Render(ctx, templ_7745c5c3_Buffer)
442 if templ_7745c5c3_Err != nil {
443 return templ_7745c5c3_Err
444 }
445 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "</body></html>")
446 if templ_7745c5c3_Err != nil {
447 return templ_7745c5c3_Err
448 }
449 return nil
450 })
451}
452
453// Header is the page header: the logo (home), the path, the ref switcher,
454// the "go to" palette and the owner; inside a repository, the tabs below.
455func Header(l Layout) templ.Component {
456 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
457 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
458 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
459 return templ_7745c5c3_CtxErr
460 }
461 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
462 if !templ_7745c5c3_IsBuffer {
463 defer func() {
464 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
465 if templ_7745c5c3_Err == nil {
466 templ_7745c5c3_Err = templ_7745c5c3_BufErr
467 }
468 }()
469 }
470 ctx = templ.InitializeContext(ctx)
471 templ_7745c5c3_Var26 := templ.GetChildren(ctx)
472 if templ_7745c5c3_Var26 == nil {
473 templ_7745c5c3_Var26 = templ.NopComponent
474 }
475 ctx = templ.ClearChildren(ctx)
476 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "<header class=\"hdr\"><div class=\"hdr-top\"><a class=\"brand\" href=\"/\" data-g=\"h\" aria-label=\"home\" title=\"home (g h)\"><span class=\"brand-mark\" aria-hidden=\"true\"></span></a> ")
477 if templ_7745c5c3_Err != nil {
478 return templ_7745c5c3_Err
479 }
480 if l.Inbox != nil {
481 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "<a class=\"btn inbox-btn\" href=\"")
482 if templ_7745c5c3_Err != nil {
483 return templ_7745c5c3_Err
484 }
485 var templ_7745c5c3_Var27 templ.SafeURL
486 templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(l.Inbox.Href))
487 if templ_7745c5c3_Err != nil {
488 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 89, Col: 39}
489 }
490 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
491 if templ_7745c5c3_Err != nil {
492 return templ_7745c5c3_Err
493 }
494 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "\" title=\"inbox\"><span class=\"ico i-mailbox\" aria-hidden=\"true\"></span> Inbox ")
495 if templ_7745c5c3_Err != nil {
496 return templ_7745c5c3_Err
497 }
498 if l.Inbox.Count >= 0 {
499 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "<span class=\"count\">")
500 if templ_7745c5c3_Err != nil {
501 return templ_7745c5c3_Err
502 }
503 var templ_7745c5c3_Var28 string
504 templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(l.Inbox.Count))
505 if templ_7745c5c3_Err != nil {
506 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 95, Col: 47}
507 }
508 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
509 if templ_7745c5c3_Err != nil {
510 return templ_7745c5c3_Err
511 }
512 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "</span>")
513 if templ_7745c5c3_Err != nil {
514 return templ_7745c5c3_Err
515 }
516 }
517 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "</a> ")
518 if templ_7745c5c3_Err != nil {
519 return templ_7745c5c3_Err
520 }
521 }
522 if len(l.Crumbs) > 0 {
523 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "<nav class=\"crumbs\" aria-label=\"Path\"><ol>")
524 if templ_7745c5c3_Err != nil {
525 return templ_7745c5c3_Err
526 }
527 for _, c := range l.Crumbs {
528 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "<li>")
529 if templ_7745c5c3_Err != nil {
530 return templ_7745c5c3_Err
531 }
532 if c.Href != "" {
533 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "<a href=\"")
534 if templ_7745c5c3_Err != nil {
535 return templ_7745c5c3_Err
536 }
537 var templ_7745c5c3_Var29 templ.SafeURL
538 templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Href))
539 if templ_7745c5c3_Err != nil {
540 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 106, Col: 38}
541 }
542 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
543 if templ_7745c5c3_Err != nil {
544 return templ_7745c5c3_Err
545 }
546 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "\"")
547 if templ_7745c5c3_Err != nil {
548 return templ_7745c5c3_Err
549 }
550 if c.Current {
551 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, " aria-current=\"page\"")
552 if templ_7745c5c3_Err != nil {
553 return templ_7745c5c3_Err
554 }
555 }
556 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, ">")
557 if templ_7745c5c3_Err != nil {
558 return templ_7745c5c3_Err
559 }
560 var templ_7745c5c3_Var30 string
561 templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(c.Label)
562 if templ_7745c5c3_Err != nil {
563 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 110, Col: 19}
564 }
565 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
566 if templ_7745c5c3_Err != nil {
567 return templ_7745c5c3_Err
568 }
569 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "</a>")
570 if templ_7745c5c3_Err != nil {
571 return templ_7745c5c3_Err
572 }
573 } else {
574 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "<span")
575 if templ_7745c5c3_Err != nil {
576 return templ_7745c5c3_Err
577 }
578 if c.Current {
579 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, " aria-current=\"page\"")
580 if templ_7745c5c3_Err != nil {
581 return templ_7745c5c3_Err
582 }
583 }
584 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, ">")
585 if templ_7745c5c3_Err != nil {
586 return templ_7745c5c3_Err
587 }
588 var templ_7745c5c3_Var31 string
589 templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(c.Label)
590 if templ_7745c5c3_Err != nil {
591 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 116, Col: 19}
592 }
593 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
594 if templ_7745c5c3_Err != nil {
595 return templ_7745c5c3_Err
596 }
597 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "</span>")
598 if templ_7745c5c3_Err != nil {
599 return templ_7745c5c3_Err
600 }
601 }
602 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "</li>")
603 if templ_7745c5c3_Err != nil {
604 return templ_7745c5c3_Err
605 }
606 }
607 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "</ol></nav>")
608 if templ_7745c5c3_Err != nil {
609 return templ_7745c5c3_Err
610 }
611 }
612 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "<div class=\"hdr-acts\">")
613 if templ_7745c5c3_Err != nil {
614 return templ_7745c5c3_Err
615 }
616 if l.Ref != "" {
617 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "<a class=\"btn ref\" href=\"")
618 if templ_7745c5c3_Err != nil {
619 return templ_7745c5c3_Err
620 }
621 var templ_7745c5c3_Var32 templ.SafeURL
622 templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(repoHref(l.Repo, "refs")))
623 if templ_7745c5c3_Err != nil {
624 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 127, Col: 52}
625 }
626 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
627 if templ_7745c5c3_Err != nil {
628 return templ_7745c5c3_Err
629 }
630 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "\" 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\">")
631 if templ_7745c5c3_Err != nil {
632 return templ_7745c5c3_Err
633 }
634 var templ_7745c5c3_Var33 string
635 templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(l.Ref)
636 if templ_7745c5c3_Err != nil {
637 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 133, Col: 36}
638 }
639 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33))
640 if templ_7745c5c3_Err != nil {
641 return templ_7745c5c3_Err
642 }
643 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "</span> <span class=\"sha\">")
644 if templ_7745c5c3_Err != nil {
645 return templ_7745c5c3_Err
646 }
647 var templ_7745c5c3_Var34 string
648 templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(l.Short)
649 if templ_7745c5c3_Err != nil {
650 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 134, Col: 33}
651 }
652 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34))
653 if templ_7745c5c3_Err != nil {
654 return templ_7745c5c3_Err
655 }
656 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "</span></a> ")
657 if templ_7745c5c3_Err != nil {
658 return templ_7745c5c3_Err
659 }
660 }
661 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "<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> ")
662 if templ_7745c5c3_Err != nil {
663 return templ_7745c5c3_Err
664 }
665 if SignedIn(ctx) {
666 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "<form class=\"owner\" method=\"post\" action=\"/-/logout\"><span class=\"owner-badge\" title=\"signed in as the owner\"><span class=\"ico i-user\" aria-hidden=\"true\"></span>")
667 if templ_7745c5c3_Err != nil {
668 return templ_7745c5c3_Err
669 }
670 var templ_7745c5c3_Var35 string
671 templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(l.Owner)
672 if templ_7745c5c3_Err != nil {
673 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 153, Col: 123}
674 }
675 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
676 if templ_7745c5c3_Err != nil {
677 return templ_7745c5c3_Err
678 }
679 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "</span> ")
680 if templ_7745c5c3_Err != nil {
681 return templ_7745c5c3_Err
682 }
683 if l.Passkeys {
684 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "<a class=\"btn icon\" href=\"/-/passkeys\" aria-label=\"Passkeys\" title=\"passkeys: add or remove the passkeys that sign you in\"><span class=\"ico i-key\" aria-hidden=\"true\"></span></a> ")
685 if templ_7745c5c3_Err != nil {
686 return templ_7745c5c3_Err
687 }
688 }
689 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "<button type=\"submit\" class=\"btn icon\" aria-label=\"Sign out\" title=\"sign out of this browser\"><span class=\"ico i-log-out\" aria-hidden=\"true\"></span></button></form>")
690 if templ_7745c5c3_Err != nil {
691 return templ_7745c5c3_Err
692 }
693 } else if l.Passkeys {
694 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "<a class=\"btn icon\" href=\"/-/login\" aria-label=\"Sign in\" title=\"sign in with a passkey\"><span class=\"ico i-log-in\" aria-hidden=\"true\"></span></a>")
695 if templ_7745c5c3_Err != nil {
696 return templ_7745c5c3_Err
697 }
698 }
699 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "</div></div>")
700 if templ_7745c5c3_Err != nil {
701 return templ_7745c5c3_Err
702 }
703 if len(l.Sections) > 0 {
704 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, "<nav class=\"tabs\" aria-label=\"Sections\"><ul>")
705 if templ_7745c5c3_Err != nil {
706 return templ_7745c5c3_Err
707 }
708 for _, s := range l.Sections {
709 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "<li><a href=\"")
710 if templ_7745c5c3_Err != nil {
711 return templ_7745c5c3_Err
712 }
713 var templ_7745c5c3_Var36 templ.SafeURL
714 templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(s.Href))
715 if templ_7745c5c3_Err != nil {
716 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 170, Col: 36}
717 }
718 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36))
719 if templ_7745c5c3_Err != nil {
720 return templ_7745c5c3_Err
721 }
722 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "\" data-key=\"")
723 if templ_7745c5c3_Err != nil {
724 return templ_7745c5c3_Err
725 }
726 var templ_7745c5c3_Var37 string
727 templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.ResolveAttributeValue(s.Key)
728 if templ_7745c5c3_Err != nil {
729 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 171, Col: 24}
730 }
731 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var37)
732 if templ_7745c5c3_Err != nil {
733 return templ_7745c5c3_Err
734 }
735 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, "\" aria-keyshortcuts=\"")
736 if templ_7745c5c3_Err != nil {
737 return templ_7745c5c3_Err
738 }
739 var templ_7745c5c3_Var38 string
740 templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.ResolveAttributeValue(s.Key)
741 if templ_7745c5c3_Err != nil {
742 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 172, Col: 33}
743 }
744 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var38)
745 if templ_7745c5c3_Err != nil {
746 return templ_7745c5c3_Err
747 }
748 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 74, "\"")
749 if templ_7745c5c3_Err != nil {
750 return templ_7745c5c3_Err
751 }
752 if s.Current {
753 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 75, " aria-current=\"page\"")
754 if templ_7745c5c3_Err != nil {
755 return templ_7745c5c3_Err
756 }
757 }
758 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 76, ">")
759 if templ_7745c5c3_Err != nil {
760 return templ_7745c5c3_Err
761 }
762 var templ_7745c5c3_Var39 string
763 templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(s.Label)
764 if templ_7745c5c3_Err != nil {
765 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 177, Col: 17}
766 }
767 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39))
768 if templ_7745c5c3_Err != nil {
769 return templ_7745c5c3_Err
770 }
771 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 77, " ")
772 if templ_7745c5c3_Err != nil {
773 return templ_7745c5c3_Err
774 }
775 if s.Count != "" {
776 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 78, "<span class=\"count\">")
777 if templ_7745c5c3_Err != nil {
778 return templ_7745c5c3_Err
779 }
780 var templ_7745c5c3_Var40 string
781 templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.JoinStringErrs(s.Count)
782 if templ_7745c5c3_Err != nil {
783 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 179, Col: 38}
784 }
785 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var40))
786 if templ_7745c5c3_Err != nil {
787 return templ_7745c5c3_Err
788 }
789 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 79, "<span class=\"sr\">")
790 if templ_7745c5c3_Err != nil {
791 return templ_7745c5c3_Err
792 }
793 var templ_7745c5c3_Var41 string
794 templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(" open")
795 if templ_7745c5c3_Err != nil {
796 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 179, Col: 66}
797 }
798 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41))
799 if templ_7745c5c3_Err != nil {
800 return templ_7745c5c3_Err
801 }
802 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 80, "</span></span> ")
803 if templ_7745c5c3_Err != nil {
804 return templ_7745c5c3_Err
805 }
806 }
807 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 81, "<kbd aria-hidden=\"true\">")
808 if templ_7745c5c3_Err != nil {
809 return templ_7745c5c3_Err
810 }
811 var templ_7745c5c3_Var42 string
812 templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinStringErrs(s.Key)
813 if templ_7745c5c3_Err != nil {
814 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 181, Col: 39}
815 }
816 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42))
817 if templ_7745c5c3_Err != nil {
818 return templ_7745c5c3_Err
819 }
820 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 82, "</kbd></a></li>")
821 if templ_7745c5c3_Err != nil {
822 return templ_7745c5c3_Err
823 }
824 }
825 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 83, "</ul></nav>")
826 if templ_7745c5c3_Err != nil {
827 return templ_7745c5c3_Err
828 }
829 }
830 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 84, "</header>")
831 if templ_7745c5c3_Err != nil {
832 return templ_7745c5c3_Err
833 }
834 return nil
835 })
836}
837
838// Footer is the version and the link to the source of the running version,
839// which the AGPL §13 asks every user of the service to be offered.
840func Footer(l Layout) templ.Component {
841 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
842 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
843 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
844 return templ_7745c5c3_CtxErr
845 }
846 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
847 if !templ_7745c5c3_IsBuffer {
848 defer func() {
849 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
850 if templ_7745c5c3_Err == nil {
851 templ_7745c5c3_Err = templ_7745c5c3_BufErr
852 }
853 }()
854 }
855 ctx = templ.InitializeContext(ctx)
856 templ_7745c5c3_Var43 := templ.GetChildren(ctx)
857 if templ_7745c5c3_Var43 == nil {
858 templ_7745c5c3_Var43 = templ.NopComponent
859 }
860 ctx = templ.ClearChildren(ctx)
861 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 85, "<footer class=\"foot\"><span>ermite ")
862 if templ_7745c5c3_Err != nil {
863 return templ_7745c5c3_Err
864 }
865 var templ_7745c5c3_Var44 string
866 templ_7745c5c3_Var44, templ_7745c5c3_Err = templ.JoinStringErrs(l.Version)
867 if templ_7745c5c3_Err != nil {
868 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 195, Col: 26}
869 }
870 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var44))
871 if templ_7745c5c3_Err != nil {
872 return templ_7745c5c3_Err
873 }
874 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 86, "</span> <a href=\"")
875 if templ_7745c5c3_Err != nil {
876 return templ_7745c5c3_Err
877 }
878 var templ_7745c5c3_Var45 templ.SafeURL
879 templ_7745c5c3_Var45, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(l.SourceURL))
880 if templ_7745c5c3_Err != nil {
881 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 196, Col: 38}
882 }
883 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var45))
884 if templ_7745c5c3_Err != nil {
885 return templ_7745c5c3_Err
886 }
887 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 87, "\" rel=\"noopener\" title=\"source of this version (AGPL-3.0-or-later)\">source</a> <button type=\"button\" class=\"foot-keys\" data-js data-fire=\"help\" aria-haspopup=\"dialog\" aria-controls=\"panel-help\" aria-keyshortcuts=\"?\"><kbd aria-hidden=\"true\">?</kbd> keyboard shortcuts</button></footer>")
888 if templ_7745c5c3_Err != nil {
889 return templ_7745c5c3_Err
890 }
891 return nil
892 })
893}
894
895// Hint is the floating badge at the bottom right. It shows only what the
896// keyboard just did or what needs attention: the row position while j/k
897// move, the selected lines of a file, a flash message (permalink copied) and
898// a lost event stream. Empty, it takes no room.
899func Hint(l Layout) templ.Component {
900 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
901 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
902 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
903 return templ_7745c5c3_CtxErr
904 }
905 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
906 if !templ_7745c5c3_IsBuffer {
907 defer func() {
908 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
909 if templ_7745c5c3_Err == nil {
910 templ_7745c5c3_Err = templ_7745c5c3_BufErr
911 }
912 }()
913 }
914 ctx = templ.InitializeContext(ctx)
915 templ_7745c5c3_Var46 := templ.GetChildren(ctx)
916 if templ_7745c5c3_Var46 == nil {
917 templ_7745c5c3_Var46 = templ.NopComponent
918 }
919 ctx = templ.ClearChildren(ctx)
920 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 88, "<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>")
921 if templ_7745c5c3_Err != nil {
922 return templ_7745c5c3_Err
923 }
924 templ_7745c5c3_Err = Live(l).Render(ctx, templ_7745c5c3_Buffer)
925 if templ_7745c5c3_Err != nil {
926 return templ_7745c5c3_Err
927 }
928 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 89, "</div>")
929 if templ_7745c5c3_Err != nil {
930 return templ_7745c5c3_Err
931 }
932 return nil
933 })
934}
935
936var _ = templruntime.GeneratedTemplate