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, "\"><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: 19, 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: 20, 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: 21, 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: 22, 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: 23, 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></head><body data-ref=\"")
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.RefPath)
160 if templ_7745c5c3_Err != nil {
161 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 26, Col: 23}
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, "\" data-sha=\"")
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.SHA)
173 if templ_7745c5c3_Err != nil {
174 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 27, Col: 19}
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, "\" data-sel=\"\" data-nav=\"\"")
181 if templ_7745c5c3_Err != nil {
182 return templ_7745c5c3_Err
183 }
184 if l.PathsURL != "" {
185 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, " data-paths=\"")
186 if templ_7745c5c3_Err != nil {
187 return templ_7745c5c3_Err
188 }
189 var templ_7745c5c3_Var13 string
190 templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.PathsURL)
191 if templ_7745c5c3_Err != nil {
192 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 31, Col: 27}
193 }
194 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13)
195 if templ_7745c5c3_Err != nil {
196 return templ_7745c5c3_Err
197 }
198 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "\" data-blob=\"")
199 if templ_7745c5c3_Err != nil {
200 return templ_7745c5c3_Err
201 }
202 var templ_7745c5c3_Var14 string
203 templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.BlobBase)
204 if templ_7745c5c3_Err != nil {
205 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 32, Col: 26}
206 }
207 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14)
208 if templ_7745c5c3_Err != nil {
209 return templ_7745c5c3_Err
210 }
211 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "\"")
212 if templ_7745c5c3_Err != nil {
213 return templ_7745c5c3_Err
214 }
215 }
216 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "><a class=\"skip\" href=\"#main\">skip to content</a>")
217 if templ_7745c5c3_Err != nil {
218 return templ_7745c5c3_Err
219 }
220 templ_7745c5c3_Err = Header(l).Render(ctx, templ_7745c5c3_Buffer)
221 if templ_7745c5c3_Err != nil {
222 return templ_7745c5c3_Err
223 }
224 var templ_7745c5c3_Var15 = []any{"work", templ.KV("has-rail", l.HasRail && rail != nil)}
225 templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var15...)
226 if templ_7745c5c3_Err != nil {
227 return templ_7745c5c3_Err
228 }
229 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "<div class=\"")
230 if templ_7745c5c3_Err != nil {
231 return templ_7745c5c3_Err
232 }
233 var templ_7745c5c3_Var16 string
234 templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.ResolveAttributeValue(templ.CSSClasses(templ_7745c5c3_Var15).String())
235 if templ_7745c5c3_Err != nil {
236 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 1, Col: 0}
237 }
238 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var16)
239 if templ_7745c5c3_Err != nil {
240 return templ_7745c5c3_Err
241 }
242 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "\">")
243 if templ_7745c5c3_Err != nil {
244 return templ_7745c5c3_Err
245 }
246 if l.Lede != "" {
247 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "<section class=\"work-lede\" aria-label=\"Description\"><p class=\"lede\">")
248 if templ_7745c5c3_Err != nil {
249 return templ_7745c5c3_Err
250 }
251 var templ_7745c5c3_Var17 string
252 templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(l.Lede)
253 if templ_7745c5c3_Err != nil {
254 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 39, Col: 81}
255 }
256 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
257 if templ_7745c5c3_Err != nil {
258 return templ_7745c5c3_Err
259 }
260 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "</p></section>")
261 if templ_7745c5c3_Err != nil {
262 return templ_7745c5c3_Err
263 }
264 }
265 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "<main id=\"main\" tabindex=\"-1\">")
266 if templ_7745c5c3_Err != nil {
267 return templ_7745c5c3_Err
268 }
269 templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer)
270 if templ_7745c5c3_Err != nil {
271 return templ_7745c5c3_Err
272 }
273 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</main>")
274 if templ_7745c5c3_Err != nil {
275 return templ_7745c5c3_Err
276 }
277 if l.HasRail && rail != nil {
278 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<aside class=\"rail\" aria-label=\"Context\">")
279 if templ_7745c5c3_Err != nil {
280 return templ_7745c5c3_Err
281 }
282 templ_7745c5c3_Err = rail.Render(ctx, templ_7745c5c3_Buffer)
283 if templ_7745c5c3_Err != nil {
284 return templ_7745c5c3_Err
285 }
286 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "</aside>")
287 if templ_7745c5c3_Err != nil {
288 return templ_7745c5c3_Err
289 }
290 }
291 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "</div>")
292 if templ_7745c5c3_Err != nil {
293 return templ_7745c5c3_Err
294 }
295 templ_7745c5c3_Err = Footer(l).Render(ctx, templ_7745c5c3_Buffer)
296 if templ_7745c5c3_Err != nil {
297 return templ_7745c5c3_Err
298 }
299 templ_7745c5c3_Err = Hint(l).Render(ctx, templ_7745c5c3_Buffer)
300 if templ_7745c5c3_Err != nil {
301 return templ_7745c5c3_Err
302 }
303 templ_7745c5c3_Err = OverlayHelp().Render(ctx, templ_7745c5c3_Buffer)
304 if templ_7745c5c3_Err != nil {
305 return templ_7745c5c3_Err
306 }
307 templ_7745c5c3_Err = OverlayRefs(l).Render(ctx, templ_7745c5c3_Buffer)
308 if templ_7745c5c3_Err != nil {
309 return templ_7745c5c3_Err
310 }
311 templ_7745c5c3_Err = OverlayCmd(l.Cmd).Render(ctx, templ_7745c5c3_Buffer)
312 if templ_7745c5c3_Err != nil {
313 return templ_7745c5c3_Err
314 }
315 templ_7745c5c3_Err = Keys().Render(ctx, templ_7745c5c3_Buffer)
316 if templ_7745c5c3_Err != nil {
317 return templ_7745c5c3_Err
318 }
319 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "</body></html>")
320 if templ_7745c5c3_Err != nil {
321 return templ_7745c5c3_Err
322 }
323 return nil
324 })
325}
326
327// Header is the page header: the instance, the path, the ref switcher, the
328// "go to" palette and the owner; inside a repository, the tabs below.
329func Header(l Layout) templ.Component {
330 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
331 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
332 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
333 return templ_7745c5c3_CtxErr
334 }
335 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
336 if !templ_7745c5c3_IsBuffer {
337 defer func() {
338 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
339 if templ_7745c5c3_Err == nil {
340 templ_7745c5c3_Err = templ_7745c5c3_BufErr
341 }
342 }()
343 }
344 ctx = templ.InitializeContext(ctx)
345 templ_7745c5c3_Var18 := templ.GetChildren(ctx)
346 if templ_7745c5c3_Var18 == nil {
347 templ_7745c5c3_Var18 = templ.NopComponent
348 }
349 ctx = templ.ClearChildren(ctx)
350 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "<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\">")
351 if templ_7745c5c3_Err != nil {
352 return templ_7745c5c3_Err
353 }
354 var templ_7745c5c3_Var19 string
355 templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(l.Instance)
356 if templ_7745c5c3_Err != nil {
357 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 67, Col: 41}
358 }
359 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
360 if templ_7745c5c3_Err != nil {
361 return templ_7745c5c3_Err
362 }
363 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "</span></a> ")
364 if templ_7745c5c3_Err != nil {
365 return templ_7745c5c3_Err
366 }
367 if len(l.Crumbs) > 0 {
368 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "<nav class=\"crumbs\" aria-label=\"Path\"><ol>")
369 if templ_7745c5c3_Err != nil {
370 return templ_7745c5c3_Err
371 }
372 for _, c := range l.Crumbs {
373 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "<li>")
374 if templ_7745c5c3_Err != nil {
375 return templ_7745c5c3_Err
376 }
377 if c.Href != "" {
378 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "<a href=\"")
379 if templ_7745c5c3_Err != nil {
380 return templ_7745c5c3_Err
381 }
382 var templ_7745c5c3_Var20 templ.SafeURL
383 templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Href))
384 if templ_7745c5c3_Err != nil {
385 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 76, Col: 38}
386 }
387 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
388 if templ_7745c5c3_Err != nil {
389 return templ_7745c5c3_Err
390 }
391 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "\"")
392 if templ_7745c5c3_Err != nil {
393 return templ_7745c5c3_Err
394 }
395 if c.Current {
396 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, " aria-current=\"page\"")
397 if templ_7745c5c3_Err != nil {
398 return templ_7745c5c3_Err
399 }
400 }
401 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, ">")
402 if templ_7745c5c3_Err != nil {
403 return templ_7745c5c3_Err
404 }
405 var templ_7745c5c3_Var21 string
406 templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(c.Label)
407 if templ_7745c5c3_Err != nil {
408 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 80, Col: 19}
409 }
410 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
411 if templ_7745c5c3_Err != nil {
412 return templ_7745c5c3_Err
413 }
414 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "</a>")
415 if templ_7745c5c3_Err != nil {
416 return templ_7745c5c3_Err
417 }
418 } else {
419 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "<span")
420 if templ_7745c5c3_Err != nil {
421 return templ_7745c5c3_Err
422 }
423 if c.Current {
424 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, " aria-current=\"page\"")
425 if templ_7745c5c3_Err != nil {
426 return templ_7745c5c3_Err
427 }
428 }
429 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, ">")
430 if templ_7745c5c3_Err != nil {
431 return templ_7745c5c3_Err
432 }
433 var templ_7745c5c3_Var22 string
434 templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(c.Label)
435 if templ_7745c5c3_Err != nil {
436 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 86, Col: 19}
437 }
438 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
439 if templ_7745c5c3_Err != nil {
440 return templ_7745c5c3_Err
441 }
442 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "</span>")
443 if templ_7745c5c3_Err != nil {
444 return templ_7745c5c3_Err
445 }
446 }
447 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "</li>")
448 if templ_7745c5c3_Err != nil {
449 return templ_7745c5c3_Err
450 }
451 }
452 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "</ol></nav>")
453 if templ_7745c5c3_Err != nil {
454 return templ_7745c5c3_Err
455 }
456 }
457 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "<div class=\"hdr-acts\">")
458 if templ_7745c5c3_Err != nil {
459 return templ_7745c5c3_Err
460 }
461 if l.Ref != "" {
462 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "<button type=\"button\" class=\"btn ref\" aria-haspopup=\"dialog\" aria-controls=\"panel-refs\" aria-keyshortcuts=\"b\" title=\"switch branch or tag (b)\" hx-on:click=\"document.body.dispatchEvent(new CustomEvent('k-refs'))\"><span class=\"ico i-branch\" aria-hidden=\"true\"></span> <span class=\"ref-name\">")
463 if templ_7745c5c3_Err != nil {
464 return templ_7745c5c3_Err
465 }
466 var templ_7745c5c3_Var23 string
467 templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(l.Ref)
468 if templ_7745c5c3_Err != nil {
469 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 105, Col: 36}
470 }
471 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
472 if templ_7745c5c3_Err != nil {
473 return templ_7745c5c3_Err
474 }
475 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "</span> <span class=\"sha\">")
476 if templ_7745c5c3_Err != nil {
477 return templ_7745c5c3_Err
478 }
479 var templ_7745c5c3_Var24 string
480 templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(l.Short)
481 if templ_7745c5c3_Err != nil {
482 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 106, Col: 33}
483 }
484 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
485 if templ_7745c5c3_Err != nil {
486 return templ_7745c5c3_Err
487 }
488 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "</span></button> ")
489 if templ_7745c5c3_Err != nil {
490 return templ_7745c5c3_Err
491 }
492 }
493 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "<button type=\"button\" class=\"btn search\" aria-haspopup=\"dialog\" aria-controls=\"panel-cmd\" aria-keyshortcuts=\"Control+K :\" title=\"go to a section, ref, file or repo (ctrl k or :)\" hx-on:click=\"document.body.dispatchEvent(new CustomEvent('k-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\" aria-haspopup=\"dialog\" aria-controls=\"panel-help\" aria-keyshortcuts=\"?\" aria-label=\"Keyboard shortcuts\" title=\"keyboard shortcuts (?)\" hx-on:click=\"document.body.dispatchEvent(new CustomEvent('k-help'))\">?</button> ")
494 if templ_7745c5c3_Err != nil {
495 return templ_7745c5c3_Err
496 }
497 if SignedIn(ctx) {
498 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "<form class=\"owner\" method=\"post\" action=\"/-/logout\"><span class=\"owner-badge\" title=\"signed in as the owner\">owner</span> <button type=\"submit\" class=\"btn\" title=\"sign out of this browser\">Sign out</button></form>")
499 if templ_7745c5c3_Err != nil {
500 return templ_7745c5c3_Err
501 }
502 }
503 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "</div></div>")
504 if templ_7745c5c3_Err != nil {
505 return templ_7745c5c3_Err
506 }
507 if len(l.Sections) > 0 {
508 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "<nav class=\"tabs\" aria-label=\"Sections\"><ul>")
509 if templ_7745c5c3_Err != nil {
510 return templ_7745c5c3_Err
511 }
512 for _, s := range l.Sections {
513 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "<li><a href=\"")
514 if templ_7745c5c3_Err != nil {
515 return templ_7745c5c3_Err
516 }
517 var templ_7745c5c3_Var25 templ.SafeURL
518 templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(s.Href))
519 if templ_7745c5c3_Err != nil {
520 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 137, Col: 36}
521 }
522 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
523 if templ_7745c5c3_Err != nil {
524 return templ_7745c5c3_Err
525 }
526 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "\" data-key=\"")
527 if templ_7745c5c3_Err != nil {
528 return templ_7745c5c3_Err
529 }
530 var templ_7745c5c3_Var26 string
531 templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.ResolveAttributeValue(s.Key)
532 if templ_7745c5c3_Err != nil {
533 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 138, Col: 24}
534 }
535 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var26)
536 if templ_7745c5c3_Err != nil {
537 return templ_7745c5c3_Err
538 }
539 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "\" aria-keyshortcuts=\"")
540 if templ_7745c5c3_Err != nil {
541 return templ_7745c5c3_Err
542 }
543 var templ_7745c5c3_Var27 string
544 templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.ResolveAttributeValue(s.Key)
545 if templ_7745c5c3_Err != nil {
546 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 139, Col: 33}
547 }
548 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var27)
549 if templ_7745c5c3_Err != nil {
550 return templ_7745c5c3_Err
551 }
552 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "\"")
553 if templ_7745c5c3_Err != nil {
554 return templ_7745c5c3_Err
555 }
556 if s.Current {
557 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, " aria-current=\"page\"")
558 if templ_7745c5c3_Err != nil {
559 return templ_7745c5c3_Err
560 }
561 }
562 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, ">")
563 if templ_7745c5c3_Err != nil {
564 return templ_7745c5c3_Err
565 }
566 var templ_7745c5c3_Var28 string
567 templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(s.Label)
568 if templ_7745c5c3_Err != nil {
569 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 143, Col: 17}
570 }
571 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
572 if templ_7745c5c3_Err != nil {
573 return templ_7745c5c3_Err
574 }
575 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "<kbd aria-hidden=\"true\">")
576 if templ_7745c5c3_Err != nil {
577 return templ_7745c5c3_Err
578 }
579 var templ_7745c5c3_Var29 string
580 templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(s.Key)
581 if templ_7745c5c3_Err != nil {
582 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 143, Col: 50}
583 }
584 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
585 if templ_7745c5c3_Err != nil {
586 return templ_7745c5c3_Err
587 }
588 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "</kbd></a></li>")
589 if templ_7745c5c3_Err != nil {
590 return templ_7745c5c3_Err
591 }
592 }
593 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "</ul></nav>")
594 if templ_7745c5c3_Err != nil {
595 return templ_7745c5c3_Err
596 }
597 }
598 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "</header>")
599 if templ_7745c5c3_Err != nil {
600 return templ_7745c5c3_Err
601 }
602 return nil
603 })
604}
605
606// Footer is the version and the link to the source of the running version,
607// which the AGPL §13 asks every user of the service to be offered.
608func Footer(l Layout) templ.Component {
609 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
610 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
611 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
612 return templ_7745c5c3_CtxErr
613 }
614 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
615 if !templ_7745c5c3_IsBuffer {
616 defer func() {
617 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
618 if templ_7745c5c3_Err == nil {
619 templ_7745c5c3_Err = templ_7745c5c3_BufErr
620 }
621 }()
622 }
623 ctx = templ.InitializeContext(ctx)
624 templ_7745c5c3_Var30 := templ.GetChildren(ctx)
625 if templ_7745c5c3_Var30 == nil {
626 templ_7745c5c3_Var30 = templ.NopComponent
627 }
628 ctx = templ.ClearChildren(ctx)
629 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "<footer class=\"foot\"><span>ermite ")
630 if templ_7745c5c3_Err != nil {
631 return templ_7745c5c3_Err
632 }
633 var templ_7745c5c3_Var31 string
634 templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(l.Version)
635 if templ_7745c5c3_Err != nil {
636 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 156, Col: 26}
637 }
638 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
639 if templ_7745c5c3_Err != nil {
640 return templ_7745c5c3_Err
641 }
642 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "</span> <a href=\"")
643 if templ_7745c5c3_Err != nil {
644 return templ_7745c5c3_Err
645 }
646 var templ_7745c5c3_Var32 templ.SafeURL
647 templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(l.SourceURL))
648 if templ_7745c5c3_Err != nil {
649 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 157, Col: 38}
650 }
651 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
652 if templ_7745c5c3_Err != nil {
653 return templ_7745c5c3_Err
654 }
655 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "\" rel=\"noopener\" title=\"source of this version (AGPL-3.0-or-later)\">source</a> <span class=\"foot-keys\"><kbd>?</kbd> keyboard shortcuts</span></footer>")
656 if templ_7745c5c3_Err != nil {
657 return templ_7745c5c3_Err
658 }
659 return nil
660 })
661}
662
663// Hint is the floating badge at the bottom right. It shows only what the
664// keyboard just did or what needs attention: the row position while j/k
665// move, the selected lines of a file, a flash message (permalink copied) and
666// a lost event stream. Empty, it takes no room.
667func Hint(l Layout) templ.Component {
668 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
669 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
670 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
671 return templ_7745c5c3_CtxErr
672 }
673 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
674 if !templ_7745c5c3_IsBuffer {
675 defer func() {
676 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
677 if templ_7745c5c3_Err == nil {
678 templ_7745c5c3_Err = templ_7745c5c3_BufErr
679 }
680 }()
681 }
682 ctx = templ.InitializeContext(ctx)
683 templ_7745c5c3_Var33 := templ.GetChildren(ctx)
684 if templ_7745c5c3_Var33 == nil {
685 templ_7745c5c3_Var33 = templ.NopComponent
686 }
687 ctx = templ.ClearChildren(ctx)
688 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "<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>")
689 if templ_7745c5c3_Err != nil {
690 return templ_7745c5c3_Err
691 }
692 templ_7745c5c3_Err = Live(l).Render(ctx, templ_7745c5c3_Buffer)
693 if templ_7745c5c3_Err != nil {
694 return templ_7745c5c3_Err
695 }
696 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "</div>")
697 if templ_7745c5c3_Err != nil {
698 return templ_7745c5c3_Err
699 }
700 return nil
701 })
702}
703
704var _ = templruntime.GeneratedTemplate