534 lines
		
	
	
		
			23 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			534 lines
		
	
	
		
			23 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
// Code generated by templ - DO NOT EDIT.
 | 
						|
 | 
						|
// templ: version: v0.3.833
 | 
						|
package views
 | 
						|
 | 
						|
//lint:file-ignore SA4006 This context is only used if a nested component is present.
 | 
						|
 | 
						|
import "github.com/a-h/templ"
 | 
						|
import templruntime "github.com/a-h/templ/runtime"
 | 
						|
 | 
						|
import (
 | 
						|
	"git.32bit.cafe/32bitcafe/guestbook/internal/forms"
 | 
						|
	"git.32bit.cafe/32bitcafe/guestbook/internal/models"
 | 
						|
)
 | 
						|
 | 
						|
func UserLogin(title string, data CommonData, form forms.UserLoginForm) templ.Component {
 | 
						|
	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
 | 
						|
		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
 | 
						|
		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
 | 
						|
			return templ_7745c5c3_CtxErr
 | 
						|
		}
 | 
						|
		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
 | 
						|
		if !templ_7745c5c3_IsBuffer {
 | 
						|
			defer func() {
 | 
						|
				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
 | 
						|
				if templ_7745c5c3_Err == nil {
 | 
						|
					templ_7745c5c3_Err = templ_7745c5c3_BufErr
 | 
						|
				}
 | 
						|
			}()
 | 
						|
		}
 | 
						|
		ctx = templ.InitializeContext(ctx)
 | 
						|
		templ_7745c5c3_Var1 := templ.GetChildren(ctx)
 | 
						|
		if templ_7745c5c3_Var1 == nil {
 | 
						|
			templ_7745c5c3_Var1 = templ.NopComponent
 | 
						|
		}
 | 
						|
		ctx = templ.ClearChildren(ctx)
 | 
						|
		templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
 | 
						|
			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
 | 
						|
			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
 | 
						|
			if !templ_7745c5c3_IsBuffer {
 | 
						|
				defer func() {
 | 
						|
					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
 | 
						|
					if templ_7745c5c3_Err == nil {
 | 
						|
						templ_7745c5c3_Err = templ_7745c5c3_BufErr
 | 
						|
					}
 | 
						|
				}()
 | 
						|
			}
 | 
						|
			ctx = templ.InitializeContext(ctx)
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<h1>Login</h1><form action=\"/users/login\" method=\"POST\" novalidate><input type=\"hidden\" name=\"csrf_token\" value=\"")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			var templ_7745c5c3_Var3 string
 | 
						|
			templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(data.CSRFToken)
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/users.templ`, Line: 12, Col: 64}
 | 
						|
			}
 | 
						|
			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\"> ")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			for _, error := range form.NonFieldErrors {
 | 
						|
				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<div class=\"error\">")
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ_7745c5c3_Err
 | 
						|
				}
 | 
						|
				var templ_7745c5c3_Var4 string
 | 
						|
				templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(error)
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/users.templ`, Line: 14, Col: 30}
 | 
						|
				}
 | 
						|
				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ_7745c5c3_Err
 | 
						|
				}
 | 
						|
				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</div>")
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ_7745c5c3_Err
 | 
						|
				}
 | 
						|
			}
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<div><label>Email: </label>")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			error, exists := form.FieldErrors["email"]
 | 
						|
			if exists {
 | 
						|
				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "<label class=\"error\">")
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ_7745c5c3_Err
 | 
						|
				}
 | 
						|
				var templ_7745c5c3_Var5 string
 | 
						|
				templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(error)
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/users.templ`, Line: 20, Col: 33}
 | 
						|
				}
 | 
						|
				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ_7745c5c3_Err
 | 
						|
				}
 | 
						|
				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</label> ")
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ_7745c5c3_Err
 | 
						|
				}
 | 
						|
			}
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "<input type=\"email\" name=\"email\" value=\"")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			var templ_7745c5c3_Var6 string
 | 
						|
			templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(form.Email)
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/users.templ`, Line: 22, Col: 55}
 | 
						|
			}
 | 
						|
			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "\"></div><div><label>Password: </label>")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			error, exists = form.FieldErrors["password"]
 | 
						|
			if exists {
 | 
						|
				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "<label class=\"error\">")
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ_7745c5c3_Err
 | 
						|
				}
 | 
						|
				var templ_7745c5c3_Var7 string
 | 
						|
				templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(error)
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/users.templ`, Line: 28, Col: 33}
 | 
						|
				}
 | 
						|
				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ_7745c5c3_Err
 | 
						|
				}
 | 
						|
				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</label> ")
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ_7745c5c3_Err
 | 
						|
				}
 | 
						|
			}
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "<input type=\"password\" name=\"password\"></div><div><input type=\"submit\" value=\"login\"></div></form>")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			return nil
 | 
						|
		})
 | 
						|
		templ_7745c5c3_Err = base(title, data).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
 | 
						|
		if templ_7745c5c3_Err != nil {
 | 
						|
			return templ_7745c5c3_Err
 | 
						|
		}
 | 
						|
		return nil
 | 
						|
	})
 | 
						|
}
 | 
						|
 | 
						|
func UserRegistration(title string, data CommonData, form forms.UserRegistrationForm) templ.Component {
 | 
						|
	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
 | 
						|
		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
 | 
						|
		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
 | 
						|
			return templ_7745c5c3_CtxErr
 | 
						|
		}
 | 
						|
		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
 | 
						|
		if !templ_7745c5c3_IsBuffer {
 | 
						|
			defer func() {
 | 
						|
				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
 | 
						|
				if templ_7745c5c3_Err == nil {
 | 
						|
					templ_7745c5c3_Err = templ_7745c5c3_BufErr
 | 
						|
				}
 | 
						|
			}()
 | 
						|
		}
 | 
						|
		ctx = templ.InitializeContext(ctx)
 | 
						|
		templ_7745c5c3_Var8 := templ.GetChildren(ctx)
 | 
						|
		if templ_7745c5c3_Var8 == nil {
 | 
						|
			templ_7745c5c3_Var8 = templ.NopComponent
 | 
						|
		}
 | 
						|
		ctx = templ.ClearChildren(ctx)
 | 
						|
		templ_7745c5c3_Var9 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
 | 
						|
			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
 | 
						|
			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
 | 
						|
			if !templ_7745c5c3_IsBuffer {
 | 
						|
				defer func() {
 | 
						|
					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
 | 
						|
					if templ_7745c5c3_Err == nil {
 | 
						|
						templ_7745c5c3_Err = templ_7745c5c3_BufErr
 | 
						|
					}
 | 
						|
				}()
 | 
						|
			}
 | 
						|
			ctx = templ.InitializeContext(ctx)
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "<h1>User Registration</h1><form action=\"/users/register\" method=\"post\"><input type=\"hidden\" name=\"csrf_token\" value=\"")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			var templ_7745c5c3_Var10 string
 | 
						|
			templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(data.CSRFToken)
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/users.templ`, Line: 43, Col: 64}
 | 
						|
			}
 | 
						|
			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "\"><div>")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			error, exists := form.FieldErrors["name"]
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "<label for=\"username\">Username: </label> ")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			if exists {
 | 
						|
				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<label class=\"error\">")
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ_7745c5c3_Err
 | 
						|
				}
 | 
						|
				var templ_7745c5c3_Var11 string
 | 
						|
				templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(error)
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/users.templ`, Line: 48, Col: 33}
 | 
						|
				}
 | 
						|
				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ_7745c5c3_Err
 | 
						|
				}
 | 
						|
				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</label> ")
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ_7745c5c3_Err
 | 
						|
				}
 | 
						|
			}
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<input type=\"text\" name=\"username\" id=\"username\" value=\"")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			var templ_7745c5c3_Var12 string
 | 
						|
			templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(form.Name)
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/users.templ`, Line: 50, Col: 70}
 | 
						|
			}
 | 
						|
			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "\" required></div><div>")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			error, exists = form.FieldErrors["email"]
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<label for=\"email\">Email: </label> ")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			if exists {
 | 
						|
				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "<label class=\"error\">")
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ_7745c5c3_Err
 | 
						|
				}
 | 
						|
				var templ_7745c5c3_Var13 string
 | 
						|
				templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(error)
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/users.templ`, Line: 56, Col: 33}
 | 
						|
				}
 | 
						|
				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ_7745c5c3_Err
 | 
						|
				}
 | 
						|
				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</label> ")
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ_7745c5c3_Err
 | 
						|
				}
 | 
						|
			}
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<input type=\"text\" name=\"email\" id=\"email\" value=\"")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			var templ_7745c5c3_Var14 string
 | 
						|
			templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(form.Email)
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/users.templ`, Line: 58, Col: 65}
 | 
						|
			}
 | 
						|
			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "\" required></div><div>")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			error, exists = form.FieldErrors["password"]
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<label for=\"password\">Password: </label> ")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			if exists {
 | 
						|
				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "<label class=\"error\">")
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ_7745c5c3_Err
 | 
						|
				}
 | 
						|
				var templ_7745c5c3_Var15 string
 | 
						|
				templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(error)
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/users.templ`, Line: 64, Col: 33}
 | 
						|
				}
 | 
						|
				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ_7745c5c3_Err
 | 
						|
				}
 | 
						|
				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "</label> ")
 | 
						|
				if templ_7745c5c3_Err != nil {
 | 
						|
					return templ_7745c5c3_Err
 | 
						|
				}
 | 
						|
			}
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "<input type=\"password\" name=\"password\" id=\"password\"></div><div><input type=\"submit\" value=\"Register\"></div></form>")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			return nil
 | 
						|
		})
 | 
						|
		templ_7745c5c3_Err = base(title, data).Render(templ.WithChildren(ctx, templ_7745c5c3_Var9), templ_7745c5c3_Buffer)
 | 
						|
		if templ_7745c5c3_Err != nil {
 | 
						|
			return templ_7745c5c3_Err
 | 
						|
		}
 | 
						|
		return nil
 | 
						|
	})
 | 
						|
}
 | 
						|
 | 
						|
func UserProfile(title string, data CommonData, user models.User) templ.Component {
 | 
						|
	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
 | 
						|
		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
 | 
						|
		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
 | 
						|
			return templ_7745c5c3_CtxErr
 | 
						|
		}
 | 
						|
		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
 | 
						|
		if !templ_7745c5c3_IsBuffer {
 | 
						|
			defer func() {
 | 
						|
				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
 | 
						|
				if templ_7745c5c3_Err == nil {
 | 
						|
					templ_7745c5c3_Err = templ_7745c5c3_BufErr
 | 
						|
				}
 | 
						|
			}()
 | 
						|
		}
 | 
						|
		ctx = templ.InitializeContext(ctx)
 | 
						|
		templ_7745c5c3_Var16 := templ.GetChildren(ctx)
 | 
						|
		if templ_7745c5c3_Var16 == nil {
 | 
						|
			templ_7745c5c3_Var16 = templ.NopComponent
 | 
						|
		}
 | 
						|
		ctx = templ.ClearChildren(ctx)
 | 
						|
		templ_7745c5c3_Var17 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
 | 
						|
			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
 | 
						|
			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
 | 
						|
			if !templ_7745c5c3_IsBuffer {
 | 
						|
				defer func() {
 | 
						|
					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
 | 
						|
					if templ_7745c5c3_Err == nil {
 | 
						|
						templ_7745c5c3_Err = templ_7745c5c3_BufErr
 | 
						|
					}
 | 
						|
				}()
 | 
						|
			}
 | 
						|
			ctx = templ.InitializeContext(ctx)
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "<h1>")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			var templ_7745c5c3_Var18 string
 | 
						|
			templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(user.Username)
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/users.templ`, Line: 77, Col: 21}
 | 
						|
			}
 | 
						|
			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "</h1><p>")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			var templ_7745c5c3_Var19 string
 | 
						|
			templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(user.Email)
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/users.templ`, Line: 78, Col: 17}
 | 
						|
			}
 | 
						|
			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "</p>")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			return nil
 | 
						|
		})
 | 
						|
		templ_7745c5c3_Err = base(title, data).Render(templ.WithChildren(ctx, templ_7745c5c3_Var17), templ_7745c5c3_Buffer)
 | 
						|
		if templ_7745c5c3_Err != nil {
 | 
						|
			return templ_7745c5c3_Err
 | 
						|
		}
 | 
						|
		return nil
 | 
						|
	})
 | 
						|
}
 | 
						|
 | 
						|
func UserSettingsView(data CommonData, timezones []string) templ.Component {
 | 
						|
	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
 | 
						|
		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
 | 
						|
		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
 | 
						|
			return templ_7745c5c3_CtxErr
 | 
						|
		}
 | 
						|
		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
 | 
						|
		if !templ_7745c5c3_IsBuffer {
 | 
						|
			defer func() {
 | 
						|
				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
 | 
						|
				if templ_7745c5c3_Err == nil {
 | 
						|
					templ_7745c5c3_Err = templ_7745c5c3_BufErr
 | 
						|
				}
 | 
						|
			}()
 | 
						|
		}
 | 
						|
		ctx = templ.InitializeContext(ctx)
 | 
						|
		templ_7745c5c3_Var20 := templ.GetChildren(ctx)
 | 
						|
		if templ_7745c5c3_Var20 == nil {
 | 
						|
			templ_7745c5c3_Var20 = templ.NopComponent
 | 
						|
		}
 | 
						|
		ctx = templ.ClearChildren(ctx)
 | 
						|
		user := data.CurrentUser
 | 
						|
		templ_7745c5c3_Var21 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
 | 
						|
			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
 | 
						|
			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
 | 
						|
			if !templ_7745c5c3_IsBuffer {
 | 
						|
				defer func() {
 | 
						|
					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
 | 
						|
					if templ_7745c5c3_Err == nil {
 | 
						|
						templ_7745c5c3_Err = templ_7745c5c3_BufErr
 | 
						|
					}
 | 
						|
				}()
 | 
						|
			}
 | 
						|
			ctx = templ.InitializeContext(ctx)
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "<div><h1>User Settings</h1><form hx-put=\"/users/settings\"><input type=\"hidden\" name=\"csrf_token\" value=\"")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			var templ_7745c5c3_Var22 string
 | 
						|
			templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(data.CSRFToken)
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/users.templ`, Line: 88, Col: 65}
 | 
						|
			}
 | 
						|
			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "\"> <label>Local Timezone</label> <select name=\"timezones\" id=\"timezone-select\">")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			for _, tz := range timezones {
 | 
						|
				if tz == user.Settings.LocalTimezone.String() {
 | 
						|
					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "<option value=\"")
 | 
						|
					if templ_7745c5c3_Err != nil {
 | 
						|
						return templ_7745c5c3_Err
 | 
						|
					}
 | 
						|
					var templ_7745c5c3_Var23 string
 | 
						|
					templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(tz)
 | 
						|
					if templ_7745c5c3_Err != nil {
 | 
						|
						return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/users.templ`, Line: 93, Col: 25}
 | 
						|
					}
 | 
						|
					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
 | 
						|
					if templ_7745c5c3_Err != nil {
 | 
						|
						return templ_7745c5c3_Err
 | 
						|
					}
 | 
						|
					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "\" selected=\"true\">")
 | 
						|
					if templ_7745c5c3_Err != nil {
 | 
						|
						return templ_7745c5c3_Err
 | 
						|
					}
 | 
						|
					var templ_7745c5c3_Var24 string
 | 
						|
					templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(tz)
 | 
						|
					if templ_7745c5c3_Err != nil {
 | 
						|
						return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/users.templ`, Line: 93, Col: 48}
 | 
						|
					}
 | 
						|
					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
 | 
						|
					if templ_7745c5c3_Err != nil {
 | 
						|
						return templ_7745c5c3_Err
 | 
						|
					}
 | 
						|
					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "</option>")
 | 
						|
					if templ_7745c5c3_Err != nil {
 | 
						|
						return templ_7745c5c3_Err
 | 
						|
					}
 | 
						|
				} else {
 | 
						|
					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "<option value=\"")
 | 
						|
					if templ_7745c5c3_Err != nil {
 | 
						|
						return templ_7745c5c3_Err
 | 
						|
					}
 | 
						|
					var templ_7745c5c3_Var25 string
 | 
						|
					templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(tz)
 | 
						|
					if templ_7745c5c3_Err != nil {
 | 
						|
						return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/users.templ`, Line: 95, Col: 25}
 | 
						|
					}
 | 
						|
					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
 | 
						|
					if templ_7745c5c3_Err != nil {
 | 
						|
						return templ_7745c5c3_Err
 | 
						|
					}
 | 
						|
					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "\">")
 | 
						|
					if templ_7745c5c3_Err != nil {
 | 
						|
						return templ_7745c5c3_Err
 | 
						|
					}
 | 
						|
					var templ_7745c5c3_Var26 string
 | 
						|
					templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(tz)
 | 
						|
					if templ_7745c5c3_Err != nil {
 | 
						|
						return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/users.templ`, Line: 95, Col: 32}
 | 
						|
					}
 | 
						|
					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
 | 
						|
					if templ_7745c5c3_Err != nil {
 | 
						|
						return templ_7745c5c3_Err
 | 
						|
					}
 | 
						|
					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "</option>")
 | 
						|
					if templ_7745c5c3_Err != nil {
 | 
						|
						return templ_7745c5c3_Err
 | 
						|
					}
 | 
						|
				}
 | 
						|
			}
 | 
						|
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "</select> <input type=\"submit\" value=\"Submit\"></form></div>")
 | 
						|
			if templ_7745c5c3_Err != nil {
 | 
						|
				return templ_7745c5c3_Err
 | 
						|
			}
 | 
						|
			return nil
 | 
						|
		})
 | 
						|
		templ_7745c5c3_Err = base("User Settings", data).Render(templ.WithChildren(ctx, templ_7745c5c3_Var21), templ_7745c5c3_Buffer)
 | 
						|
		if templ_7745c5c3_Err != nil {
 | 
						|
			return templ_7745c5c3_Err
 | 
						|
		}
 | 
						|
		return nil
 | 
						|
	})
 | 
						|
}
 | 
						|
 | 
						|
var _ = templruntime.GeneratedTemplate
 |