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