From a363560cf417bd5df2e871b976026e1b0ed3f8d8 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Wed, 18 Oct 2023 02:35:18 +0300 Subject: [PATCH] feat: make user id field a disabled input in admin view --- internal/components/adminpartials.templ | 2 +- internal/components/adminpartials_templ.go | 45 +++++++++++----------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/internal/components/adminpartials.templ b/internal/components/adminpartials.templ index 9bc0fd2..6df8c0e 100644 --- a/internal/components/adminpartials.templ +++ b/internal/components/adminpartials.templ @@ -23,7 +23,7 @@ templ AdminPartialUsersList(users []db.User) {
- { user.Id } +
diff --git a/internal/components/adminpartials_templ.go b/internal/components/adminpartials_templ.go index fcde86e..a3b0fd6 100644 --- a/internal/components/adminpartials_templ.go +++ b/internal/components/adminpartials_templ.go @@ -57,21 +57,20 @@ func AdminPartialUsersList(users []db.User) templ.Component { return err } for _, user := range users { - _, err = templBuffer.WriteString("
") + _, err = templBuffer.WriteString("
") + _, err = templBuffer.WriteString("\" disabled>
") if err != nil { return err } - var var_6 string = user.Email - _, err = templBuffer.WriteString(templ.EscapeString(var_6)) + var var_5 string = user.Email + _, err = templBuffer.WriteString(templ.EscapeString(var_5)) if err != nil { return err } @@ -79,8 +78,8 @@ func AdminPartialUsersList(users []db.User) templ.Component { if err != nil { return err } - var var_7 string = strconv.FormatBool(user.IsAdmin) - _, err = templBuffer.WriteString(templ.EscapeString(var_7)) + var var_6 string = strconv.FormatBool(user.IsAdmin) + _, err = templBuffer.WriteString(templ.EscapeString(var_6)) if err != nil { return err } @@ -108,17 +107,17 @@ func AdminPartialDomainsList(domains []db.Domain) templ.Component { defer templ.ReleaseBuffer(templBuffer) } ctx = templ.InitializeContext(ctx) - var_8 := templ.GetChildren(ctx) - if var_8 == nil { - var_8 = templ.NopComponent + var_7 := templ.GetChildren(ctx) + if var_7 == nil { + var_7 = templ.NopComponent } ctx = templ.ClearChildren(ctx) _, err = templBuffer.WriteString("
") if err != nil { return err } - var_9 := `Id` - _, err = templBuffer.WriteString(var_9) + var_8 := `Id` + _, err = templBuffer.WriteString(var_8) if err != nil { return err } @@ -126,8 +125,8 @@ func AdminPartialDomainsList(domains []db.Domain) templ.Component { if err != nil { return err } - var_10 := `Domain` - _, err = templBuffer.WriteString(var_10) + var_9 := `Domain` + _, err = templBuffer.WriteString(var_9) if err != nil { return err } @@ -135,8 +134,8 @@ func AdminPartialDomainsList(domains []db.Domain) templ.Component { if err != nil { return err } - var_11 := `A Record` - _, err = templBuffer.WriteString(var_11) + var_10 := `A Record` + _, err = templBuffer.WriteString(var_10) if err != nil { return err } @@ -144,8 +143,8 @@ func AdminPartialDomainsList(domains []db.Domain) templ.Component { if err != nil { return err } - var_12 := `Owner (ID/Email)` - _, err = templBuffer.WriteString(var_12) + var_11 := `Owner (ID/Email)` + _, err = templBuffer.WriteString(var_11) if err != nil { return err } @@ -166,8 +165,8 @@ func AdminPartialDomainsList(domains []db.Domain) templ.Component { if err != nil { return err } - var var_13 string = domain.Domain - _, err = templBuffer.WriteString(templ.EscapeString(var_13)) + var var_12 string = domain.Domain + _, err = templBuffer.WriteString(templ.EscapeString(var_12)) if err != nil { return err } @@ -175,8 +174,8 @@ func AdminPartialDomainsList(domains []db.Domain) templ.Component { if err != nil { return err } - var var_14 string = domain.A - _, err = templBuffer.WriteString(templ.EscapeString(var_14)) + var var_13 string = domain.A + _, err = templBuffer.WriteString(templ.EscapeString(var_13)) if err != nil { return err } -- 2.44.1