main / internal/interface/web/templates/repo_home_templ.go
4.3 KB · Go Raw
1// Code generated by templ - DO NOT EDIT.
2
3// templ: version: v0.3.865
4package templates
5
6//lint:file-ignore SA4006 This context is only used if a nested component is present.
7
8import "github.com/a-h/templ"
9import templruntime "github.com/a-h/templ/runtime"
10
11import "gitgud/internal/domain"
12
13func RepoHome(user *domain.User, repo *domain.Repository) templ.Component {
14 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
15 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
16 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
17 return templ_7745c5c3_CtxErr
18 }
19 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
20 if !templ_7745c5c3_IsBuffer {
21 defer func() {
22 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
23 if templ_7745c5c3_Err == nil {
24 templ_7745c5c3_Err = templ_7745c5c3_BufErr
25 }
26 }()
27 }
28 ctx = templ.InitializeContext(ctx)
29 templ_7745c5c3_Var1 := templ.GetChildren(ctx)
30 if templ_7745c5c3_Var1 == nil {
31 templ_7745c5c3_Var1 = templ.NopComponent
32 }
33 ctx = templ.ClearChildren(ctx)
34 templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
35 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
36 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
37 if !templ_7745c5c3_IsBuffer {
38 defer func() {
39 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
40 if templ_7745c5c3_Err == nil {
41 templ_7745c5c3_Err = templ_7745c5c3_BufErr
42 }
43 }()
44 }
45 ctx = templ.InitializeContext(ctx)
46 templ_7745c5c3_Err = repoHeader(repo, "code").Render(ctx, templ_7745c5c3_Buffer)
47 if templ_7745c5c3_Err != nil {
48 return templ_7745c5c3_Err
49 }
50 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, " ")
51 if templ_7745c5c3_Err != nil {
52 return templ_7745c5c3_Err
53 }
54 if repo.Description != "" {
55 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "<p class=\"mb-6 text-sm text-muted\">")
56 if templ_7745c5c3_Err != nil {
57 return templ_7745c5c3_Err
58 }
59 var templ_7745c5c3_Var3 string
60 templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(repo.Description)
61 if templ_7745c5c3_Err != nil {
62 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/interface/web/templates/repo_home.templ`, Line: 9, Col: 56}
63 }
64 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
65 if templ_7745c5c3_Err != nil {
66 return templ_7745c5c3_Err
67 }
68 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</p>")
69 if templ_7745c5c3_Err != nil {
70 return templ_7745c5c3_Err
71 }
72 }
73 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, " <div class=\"card overflow-hidden\"><div class=\"border-b border-line px-5 py-3\"><h2 class=\"font-semibold text-ink\">Quick setup</h2><p class=\"meta mt-0.5\">This repository is empty. Push your first commit to get started.</p></div><div class=\"bg-panel2 p-5\"><pre class=\"overflow-x-auto font-mono text-xs leading-relaxed text-muted\">")
74 if templ_7745c5c3_Err != nil {
75 return templ_7745c5c3_Err
76 }
77 var templ_7745c5c3_Var4 string
78 templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(cloneInstructions(repo))
79 if templ_7745c5c3_Err != nil {
80 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/interface/web/templates/repo_home.templ`, Line: 17, Col: 103}
81 }
82 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
83 if templ_7745c5c3_Err != nil {
84 return templ_7745c5c3_Err
85 }
86 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "</pre></div></div>")
87 if templ_7745c5c3_Err != nil {
88 return templ_7745c5c3_Err
89 }
90 return nil
91 })
92 templ_7745c5c3_Err = Layout(repo.OwnerName+"/"+repo.Name+" · gitgud", user).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
93 if templ_7745c5c3_Err != nil {
94 return templ_7745c5c3_Err
95 }
96 return nil
97 })
98}
99
100var _ = templruntime.GeneratedTemplate