From 39660d978304ebce08a9200f4ef63c0013cab7ac Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Wed, 21 Aug 2024 14:10:15 -0400 Subject: cmd/hdrwtch: closer to implementation Signed-off-by: Xe Iaso --- cmd/hdrwtch/web_templ.go | 75 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 23 deletions(-) (limited to 'cmd/hdrwtch/web_templ.go') diff --git a/cmd/hdrwtch/web_templ.go b/cmd/hdrwtch/web_templ.go index 0107d0f..9f47e35 100644 --- a/cmd/hdrwtch/web_templ.go +++ b/cmd/hdrwtch/web_templ.go @@ -8,7 +8,10 @@ package main import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -import "within.website/x/htmx" +import ( + "fmt" + "within.website/x/htmx" +) func telegramWidget(botUsername string, avatarSize string, redirectURL string, requestAccess string) templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { @@ -35,7 +38,7 @@ func telegramWidget(botUsername string, avatarSize string, redirectURL string, r var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(botUsername) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `web.templ`, Line: 6, Col: 100} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `web.templ`, Line: 9, Col: 100} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -48,7 +51,7 @@ func telegramWidget(botUsername string, avatarSize string, redirectURL string, r var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(avatarSize) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `web.templ`, Line: 6, Col: 125} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `web.templ`, Line: 9, Col: 125} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -61,7 +64,7 @@ func telegramWidget(botUsername string, avatarSize string, redirectURL string, r var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(redirectURL) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `web.templ`, Line: 6, Col: 155} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `web.templ`, Line: 9, Col: 155} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -74,7 +77,7 @@ func telegramWidget(botUsername string, avatarSize string, redirectURL string, r var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(requestAccess) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `web.templ`, Line: 6, Col: 193} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `web.templ`, Line: 9, Col: 193} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -139,7 +142,7 @@ func base(title string, head, navbar, body templ.Component) templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `web.templ`, Line: 21, Col: 17} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `web.templ`, Line: 24, Col: 17} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -159,7 +162,7 @@ func base(title string, head, navbar, body templ.Component) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -176,7 +179,7 @@ func base(title string, head, navbar, body templ.Component) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `web.templ`, Line: 33, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `web.templ`, Line: 37, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { @@ -220,7 +223,7 @@ func loginPage(redirURL string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = telegramWidget(*botUsername, "large", redirURL, "read").Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = telegramWidget(*botUsername, "large", redirURL, "write").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -246,7 +249,7 @@ func anonNavBar(showLogin bool) templ.Component { templ_7745c5c3_Var11 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("