@Image(ImageAttrs{ @@ -26,46 +28,233 @@ templ (v Account) Profile() { Width: 250, Height: 250, Extra: templ.Attributes{ - "class": "profile avatar", + "class": "avatar", }, }) -

{ v.Account.Name }

-

{ v.Account.Callsign().Call }

+

{ v.Account.Name }

+

{ v.Account.Callsign().Call }

+ @Can("edit", v.Account) { +
+ Edit profile + + } +
    +
  • + @Icon(IconAttrs{Name: "at", FixedWidth: true}) + ryan@faerman.net +
  • + @Can("view-location", v.Account) { +
  • + @Icon(IconAttrs{Name: "location-dot", FixedWidth: true}) + { StateAbbreviationToName(v.Account.Callsign().State) }, { v.Account.Callsign().Country } +
  • + } +
  • + @Icon(IconAttrs{Name: "id-card", FixedWidth: true}) + Technician +
  • +
- @templ.Raw(v.Account.About) +
-
- - @Can("edit", v.Account) { - - Edit Profile - +
+ if v.Account.About != "" { +

Profile

+
+ @templ.Raw(v.Account.About) +
+ } else { +

We'd love to tell you more about { v.Account.Name }, but they haven't shared anything.

} - @Can("view-metrics") { -

Here are some metrics

+ @Can("view-activity-graph", v.Account) { + @ActivityGraph() }
} } -templ (v Account) Edit() { +templ (v Account) Settings(section string, settings any) { @Page(v.Nav()) { -
+
+ @Image(ImageAttrs{ + URL: GravatarURL(ctx, v.Account, 48), + Width: 48, + Height: 48, + Extra: templ.Attributes{ + "class": "avatar", + }, + }) +

{ v.Account.Name }

+

Settings for your personal profile

+
+
+
- Editing { v.Account.Name }! - @v.EditForm() + + switch section { + case "profile": + @v.EditForm() + case "privacy": + @v.PrivacyForm(settings.(models.PrivacySettings)) + case "avatar": + @v.AvatarForm() + case "appearance": + @v.AppearanceForm(settings.(models.AppearanceSettings)) + case "clubs": + @v.MembershipOverview(models.AccountKindClub) + case "organizations": + @v.MembershipOverview(models.AccountKindOrganization) + }
- - - View Profile - + + switch section { + case "profile": + + View Public Profile + + case "privacy": + @v.PrivacyContext() + case "organizations": + @v.MembershipContext(models.AccountKindOrganization) + case "clubs": + @v.MembershipContext(models.AccountKindClub) + }
} } +templ (v Account) PrivacyForm(val models.PrivacySettings) { + @Form("privacy", FormAttrs{ + Action: named.URLFor("settings-save", "privacy"), + + }) { + @InputRadioGroup("location", InputAttrs{ + Label: "Show location on profile?", + Values: []InputValue{ + {Value: "public", Label: "Yes", HelpText: "Anyone can see your location"}, + {Value: "protected", Label: "Users Only", HelpText: "Only users with an account will see your location"}, + {Value: "private", Label: "No", HelpText: "Your location won't be directly visible on your profile"}, + }, + Value: val.Location, + HelpText: "Control how your location is shared.", + }) + @InputRadioGroup("visibility", InputAttrs{ + Label: "Profile visiblity", + Values: []InputValue{ + {Value: "public", Label: "Yes", HelpText: "Anyone can see your profile"}, + {Value: "protected", Label: "Users Only", HelpText: "Only users with an account can see your profile"}, + {Value: "private", Label: "Private", HelpText: "Don't show up in any search results"}, + }, + Value: val.Visiblility, + HelpText: "Manage overall profile visiblity.", + }) + @InputSubmit(InputAttrs{ + Value: "Save", + }) + } +} + +templ (v Account) AppearanceForm(val models.AppearanceSettings) { + @Form("appearance", FormAttrs{ + Action: named.URLFor("settings-save", "appearance"), + }) { + @InputRadioGroup("activity-graphs", InputAttrs{ + Label: "Activity Graph", + Values: []InputValue{ + {Value: "on", Label: "Enable activity graphs", HelpText: "Show the activity graph on your profile?"}, + {Value: "off", Label: "Disable Activity Graph", HelpText: "Show the activity graph on your profile?"}, + }, + Value: val.ActivityGraphs, + }) + @InputSubmit(InputAttrs{ + Value: "Save", + }) + } +} + +templ (v Account) PrivacyContext() { +
+ A note about privacy +

+ It's important to remember that, while we will do our best to enforce + these privacy settings, your callsign is an identifier with the FCC or + other government agency. +

+

+ Government records are generally publicly available and + much of the information will be accessible according to the laws in your country. +

+
+} + +templ (v Account) AvatarForm() { +

+ Your avatar is managed with gravatar, a service that links your + email address with an image of your choosing. +

+} + +templ (v Account) MembershipOverview(kind models.AccountKind) { + if len(v.Memberships) == 0 { + Looks like you don't have any memberships yet. + Wanna join a club? + + Create a club + + } else { +

{ kind.String() } Memberships

+
+ for _, m := range v.Memberships { +
+ + { m.Target.Name } + + { m.Role.Name } +
+ Settings + Leave +
+
+ } +
+ } +} + +templ (v Account) MembershipContext(kind models.AccountKind) { + + Create a { kind.String() } + +} + type AccountEditFormInput struct { Name string About string diff --git a/internal/views/account_templ.go b/internal/views/account_templ.go index cf4c376..58439ca 100644 --- a/internal/views/account_templ.go +++ b/internal/views/account_templ.go @@ -14,15 +14,17 @@ import "github.com/ryanfaerman/netctl/internal/models" import "github.com/ryanfaerman/netctl/web/named" type Account struct { - Account *models.Account + Account *models.Account + Clubs []*models.Membership + Organizations []*models.Membership + Memberships []*models.Membership + FlashTitle string + FlashMessage string } func (v Account) Nav() Menu { return Menu{ {Value: "Profile", URL: named.URLFor("account-profile", v.Account.Callsign().Call), Icon: IconAttrs{Name: "file-lines"}}, - {Value: "Billing", URL: "#", Icon: IconAttrs{Name: "list-check"}}, - {Value: "Reports", URL: "#", Icon: IconAttrs{Name: "receipt"}}, - {Value: "Settings", URL: "#", Icon: IconAttrs{Name: "sliders"}}, } } @@ -45,7 +47,7 @@ func (v Account) Profile() templ.Component { templ_7745c5c3_Buffer = templ.GetBuffer() defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -54,84 +56,134 @@ func (v Account) Profile() templ.Component { Width: 250, Height: 250, Extra: templ.Attributes{ - "class": "profile avatar", + "class": "avatar", }, }).Render(ctx, templ_7745c5c3_Buffer) 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 } var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(v.Account.Name) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/account.templ`, Line: 31, Col: 25} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/account.templ`, Line: 33, Col: 46} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) 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 } var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(v.Account.Callsign().Call) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/account.templ`, Line: 32, Col: 36} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/account.templ`, Line: 34, Col: 53} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) 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 } - templ_7745c5c3_Err = templ.Raw(v.Account.About).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Var5 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var7 := `Edit profile` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = Can("edit", v.Account).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + templ_7745c5c3_Var8 := `ryan@faerman.net` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var6 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var9 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { templ_7745c5c3_Buffer = templ.GetBuffer() defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var7 templ.SafeURL = templ.URL(named.URLFor("account-edit", v.Account.Callsign().Call)) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var7))) + templ_7745c5c3_Err = Icon(IconAttrs{Name: "location-dot", FixedWidth: true}).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"button\">") + var templ_7745c5c3_Var10 string + templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(StateAbbreviationToName(v.Account.Callsign().State)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/account.templ`, Line: 48, Col: 61} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var8 := `Edit Profile` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8) + templ_7745c5c3_Var11 := `, ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + var templ_7745c5c3_Var12 string + templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(v.Account.Callsign().Country) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/account.templ`, Line: 48, Col: 95} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -140,22 +192,86 @@ func (v Account) Profile() templ.Component { } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = Can("edit", v.Account).Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = Can("view-location", v.Account).Render(templ.WithChildren(ctx, templ_7745c5c3_Var9), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var9 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) - if !templ_7745c5c3_IsBuffer { - templ_7745c5c3_Buffer = templ.GetBuffer() - defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
  • ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Icon(IconAttrs{Name: "id-card", FixedWidth: true}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var13 := `Technician` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
  • ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if v.Account.About != "" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var15 := `Profile` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var15) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ.Raw(v.Account.About).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var10 := `Here are some metrics` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10) + templ_7745c5c3_Var16 := `We'd love to tell you more about ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var16) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var17 string + templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(v.Account.Name) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/account.templ`, Line: 73, Col: 57} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var18 := `, but they haven't shared anything.` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var18) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -163,12 +279,23 @@ func (v Account) Profile() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } + } + templ_7745c5c3_Var19 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + templ_7745c5c3_Err = ActivityGraph().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } if !templ_7745c5c3_IsBuffer { _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = Can("view-metrics").Render(templ.WithChildren(ctx, templ_7745c5c3_Var9), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = Can("view-activity-graph", v.Account).Render(templ.WithChildren(ctx, templ_7745c5c3_Var19), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -192,7 +319,7 @@ func (v Account) Profile() templ.Component { }) } -func (v Account) Edit() templ.Component { +func (v Account) Settings(section string, settings any) templ.Component { return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { @@ -200,41 +327,90 @@ func (v Account) Edit() templ.Component { defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var11 := templ.GetChildren(ctx) - if templ_7745c5c3_Var11 == nil { - templ_7745c5c3_Var11 = templ.NopComponent + templ_7745c5c3_Var20 := templ.GetChildren(ctx) + if templ_7745c5c3_Var20 == nil { + templ_7745c5c3_Var20 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var12 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var21 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { templ_7745c5c3_Buffer = templ.GetBuffer() defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var13 := `Editing ` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13) + templ_7745c5c3_Err = Image(ImageAttrs{ + URL: GravatarURL(ctx, v.Account, 48), + Width: 48, + Height: 48, + Extra: templ.Attributes{ + "class": "avatar", + }, + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var22 string + templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(v.Account.Name) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/account.templ`, Line: 94, Col: 44} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var23 := `Settings for your personal profile` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var23) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/account.templ`, Line: 55, Col: 28} + return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) + templ_7745c5c3_Err = Nav("", Menu{ + {Value: "Public Profile", URL: named.URLFor("settings", "profile"), Icon: IconAttrs{Name: "user", FixedWidth: true}}, + {Value: "Privacy", URL: named.URLFor("settings", "privacy"), Icon: IconAttrs{Name: "shield-halved", FixedWidth: true}}, + {Value: "Avatar", URL: named.URLFor("settings", "avatar"), Icon: IconAttrs{Name: "image", Kind: "regular", FixedWidth: true}}, + {Value: "Appearance", URL: named.URLFor("settings", "appearance"), Icon: IconAttrs{Name: "paintbrush", Kind: "solid", FixedWidth: true}}, + }).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var15 := `!` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var15) + templ_7745c5c3_Err = Nav("Access", Menu{ + {Value: "Billing & Plans", URL: named.URLFor("settings", "billing"), Icon: IconAttrs{Name: "credit-card", FixedWidth: true}}, + {Value: "Emails", URL: named.URLFor("settings", "emails"), Icon: IconAttrs{Name: "envelope", FixedWidth: true}}, + {Value: "Sessions", URL: named.URLFor("settings", "sessions"), Icon: IconAttrs{Name: "tower-broadcast", FixedWidth: true}}, + {Value: "Organizations", URL: named.URLFor("settings", "organizations"), Icon: IconAttrs{Name: "landmark", FixedWidth: true}}, + {Value: "Clubs", URL: named.URLFor("settings", "clubs"), Icon: IconAttrs{Name: "people-group", FixedWidth: true}}, + }).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = v.EditForm().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = Nav("Archives", Menu{ + {Value: "Checkins", URL: "#", Icon: IconAttrs{Name: "list-check", FixedWidth: true}}, + {Value: "Security Logs", URL: "#", Icon: IconAttrs{Name: "scroll", FixedWidth: true}}, + }).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -242,30 +418,234 @@ func (v Account) Edit() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var16 := ` sidebar ` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var16) + templ_7745c5c3_Var25 := ` main content ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var25) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("-->") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("-->
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + switch section { + case "profile": + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var28 := `View Public Profile` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var28) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + case "privacy": + templ_7745c5c3_Err = v.PrivacyContext().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + case "organizations": + templ_7745c5c3_Err = v.MembershipContext(models.AccountKindOrganization).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + case "clubs": + templ_7745c5c3_Err = v.MembershipContext(models.AccountKindClub).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = Page(v.Nav()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var21), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func (v Account) PrivacyForm(val models.PrivacySettings) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var29 := templ.GetChildren(ctx) + if templ_7745c5c3_Var29 == nil { + templ_7745c5c3_Var29 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var30 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + templ_7745c5c3_Err = InputRadioGroup("location", InputAttrs{ + Label: "Show location on profile?", + Values: []InputValue{ + {Value: "public", Label: "Yes", HelpText: "Anyone can see your location"}, + {Value: "protected", Label: "Users Only", HelpText: "Only users with an account will see your location"}, + {Value: "private", Label: "No", HelpText: "Your location won't be directly visible on your profile"}, + }, + Value: val.Location, + HelpText: "Control how your location is shared.", + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = InputRadioGroup("visibility", InputAttrs{ + Label: "Profile visiblity", + Values: []InputValue{ + {Value: "public", Label: "Yes", HelpText: "Anyone can see your profile"}, + {Value: "protected", Label: "Users Only", HelpText: "Only users with an account can see your profile"}, + {Value: "private", Label: "Private", HelpText: "Don't show up in any search results"}, + }, + Value: val.Visiblility, + HelpText: "Manage overall profile visiblity.", + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = InputSubmit(InputAttrs{ + Value: "Save", + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = Form("privacy", FormAttrs{ + Action: named.URLFor("settings-save", "privacy"), + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var30), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func (v Account) AppearanceForm(val models.AppearanceSettings) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var31 := templ.GetChildren(ctx) + if templ_7745c5c3_Var31 == nil { + templ_7745c5c3_Var31 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var32 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + templ_7745c5c3_Err = InputRadioGroup("activity-graphs", InputAttrs{ + Label: "Activity Graph", + Values: []InputValue{ + {Value: "on", Label: "Enable activity graphs", HelpText: "Show the activity graph on your profile?"}, + {Value: "off", Label: "Disable Activity Graph", HelpText: "Show the activity graph on your profile?"}, + }, + Value: val.ActivityGraphs, + }).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var18 := `View Profile` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var18) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + templ_7745c5c3_Err = InputSubmit(InputAttrs{ + Value: "Save", + }).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -274,7 +654,319 @@ func (v Account) Edit() templ.Component { } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = Page(v.Nav()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var12), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = Form("appearance", FormAttrs{ + Action: named.URLFor("settings-save", "appearance"), + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var32), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func (v Account) PrivacyContext() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var33 := templ.GetChildren(ctx) + if templ_7745c5c3_Var33 == nil { + templ_7745c5c3_Var33 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var34 := `A note about privacy` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var34) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var35 := `It's important to remember that, while we will do our best to enforce ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var35) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var36 := `these privacy settings, your callsign is an identifier with the FCC or ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var36) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var37 := `other government agency.` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var37) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var38 := `Government records are generally publicly available and ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var38) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var39 := `much of the information will be accessible according to the laws in your country.` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var39) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func (v Account) AvatarForm() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var40 := templ.GetChildren(ctx) + if templ_7745c5c3_Var40 == nil { + templ_7745c5c3_Var40 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var41 := `Your avatar is managed with gravatar, a service that links your ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var41) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var42 := `email address with an image of your choosing.` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var42) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func (v Account) MembershipOverview(kind models.AccountKind) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var43 := templ.GetChildren(ctx) + if templ_7745c5c3_Var43 == nil { + templ_7745c5c3_Var43 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if len(v.Memberships) == 0 { + templ_7745c5c3_Var44 := `Looks like you don't have any memberships yet.` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var44) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var45 := `Wanna join a club?` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var45) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var47 := `Create a club` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var47) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var48 string + templ_7745c5c3_Var48, templ_7745c5c3_Err = templ.JoinStringErrs(kind.String()) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/account.templ`, Line: 233, Col: 21} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var48)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var49 := `Memberships` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var49) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for _, m := range v.Memberships { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var50 string + templ_7745c5c3_Var50, templ_7745c5c3_Err = templ.JoinStringErrs(m.Target.Name) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/account.templ`, Line: 238, Col: 21} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var50)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var51 string + templ_7745c5c3_Var51, templ_7745c5c3_Err = templ.JoinStringErrs(m.Role.Name) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/account.templ`, Line: 240, Col: 43} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var51)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func (v Account) MembershipContext(kind models.AccountKind) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var54 := templ.GetChildren(ctx) + if templ_7745c5c3_Var54 == nil { + templ_7745c5c3_Var54 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var56 := `Create a ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var56) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var57 string + templ_7745c5c3_Var57, templ_7745c5c3_Err = templ.JoinStringErrs(kind.String()) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/account.templ`, Line: 253, Col: 26} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var57)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -303,9 +995,9 @@ func (v Account) EditForm() templ.Component { defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var19 := templ.GetChildren(ctx) - if templ_7745c5c3_Var19 == nil { - templ_7745c5c3_Var19 = templ.NopComponent + templ_7745c5c3_Var58 := templ.GetChildren(ctx) + if templ_7745c5c3_Var58 == nil { + templ_7745c5c3_Var58 = templ.NopComponent } ctx = templ.ClearChildren(ctx) templ_7745c5c3_Err = v.EditFormWithErrors( @@ -333,12 +1025,12 @@ func (v Account) EditFormWithErrors(input AccountEditFormInput, inputErrs Accoun defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var20 := templ.GetChildren(ctx) - if templ_7745c5c3_Var20 == nil { - templ_7745c5c3_Var20 = templ.NopComponent + templ_7745c5c3_Var59 := templ.GetChildren(ctx) + if templ_7745c5c3_Var59 == nil { + templ_7745c5c3_Var59 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var21 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var60 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { templ_7745c5c3_Buffer = templ.GetBuffer() @@ -384,7 +1076,7 @@ func (v Account) EditFormWithErrors(input AccountEditFormInput, inputErrs Accoun }) templ_7745c5c3_Err = Form("edit-account", FormAttrs{ Action: named.URLFor("account-edit-save", v.Account.Callsign().Call), - }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var21), templ_7745c5c3_Buffer) + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var60), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/internal/views/activity.templ b/internal/views/activity.templ new file mode 100644 index 0000000..21d23b7 --- /dev/null +++ b/internal/views/activity.templ @@ -0,0 +1,51 @@ +package views + +templ ActivityGraph() { +
    +
    +

    Activity

    +
    +
    +
      +
    1. Feb
    2. +
    3. Mar
    4. +
    5. Apr
    6. +
    7. May
    8. +
    9. Jun
    10. +
    11. Jul
    12. +
    13. Aug
    14. +
    15. Sep
    16. +
    17. Oct
    18. +
    19. Nov
    20. +
    21. Dec
    22. +
    23. Jan
    24. +
    +
      +
    1. Mon
    2. +
    3. Wed
    4. +
    5. Fri
    6. +
    +
    + for i :=0; i <= 364; i++ { +
    + } +
    +
    + Less +
    +
    +
    +
    +
    + More +
    +
    +
    +} diff --git a/internal/views/activity_templ.go b/internal/views/activity_templ.go new file mode 100644 index 0000000..fce7067 --- /dev/null +++ b/internal/views/activity_templ.go @@ -0,0 +1,225 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.513 +package views + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +func ActivityGraph() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + 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_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var2 := `Activity` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var2) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    1. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var3 := `Feb` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var3) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    2. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var4 := `Mar` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var4) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    3. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var5 := `Apr` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var5) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    4. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var6 := `May` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var6) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    5. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var7 := `Jun` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    6. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var8 := `Jul` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    7. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var9 := `Aug` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    8. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var10 := `Sep` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    9. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var11 := `Oct` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    10. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var12 := `Nov` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    11. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var13 := `Dec` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    12. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var14 := `Jan` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    1. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var15 := `Mon` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var15) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    2. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var16 := `Wed` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var16) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    3. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var17 := `Fri` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var17) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for i := 0; i <= 364; i++ { + var templ_7745c5c3_Var18 = []any{"day", + templ.KV("skip-3", i == 0), + templ.KV("activity-4", i%3 == 0), + templ.KV("activity-3", i%4 == 0), + templ.KV("activity-2", i%5 == 0), + templ.KV("activity-1", i%6 == 0)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var18...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var19 := `Less` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var19) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var20 := `More` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var20) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} diff --git a/internal/views/input.templ b/internal/views/input.templ index d7722c6..e453d89 100644 --- a/internal/views/input.templ +++ b/internal/views/input.templ @@ -16,9 +16,21 @@ func (i InputType) String() string { return string(i) } +type InputValue struct { + Value string + Checked bool + Label string + Name string + HelpText string +} + type InputAttrs struct { - Label string - Value string + Label string + Value string + Checked bool + + Values []InputValue + HelpText string Placeholder string Error string @@ -32,6 +44,8 @@ type InputAttrs struct { MarkdownPreviewBody string Height string + + HX templ.Attributes } func (a InputAttrs) HasLabel() bool { return len(a.Label) > 0 } @@ -66,6 +80,7 @@ templ Form(id string, attrs FormAttrs) { } if !attrs.DisableHTMX && attrs.HasAction() { hx-post={ attrs.Action } + hx-swap="innerHTML" hx-swap-oob="true" } { attrs.HX... } @@ -96,6 +111,7 @@ templ Input(kind InputType, name string, attrs InputAttrs) { if attrs.DisableAutocomplete { autocomplete="off" } + { attrs.HX... } />
    if attrs.HasHelpText() { @@ -210,7 +226,7 @@ templ InputTextArea(name string, attrs InputAttrs) { { attrs.Value } if attrs.MarkdownModePreview { -
    +
    if attrs.MarkdownPreviewBody != "" { @templ.Raw(attrs.MarkdownPreviewBody) } else { @@ -233,8 +249,82 @@ templ InputTextArea(name string, attrs InputAttrs) {
    } +templ InputRadioGroup(name string, attrs InputAttrs) { +
    +
    + if attrs.HasLabel() { + { attrs.Label } + } +
    + if attrs.HasHelpText() { +
    { attrs.HelpText }
    + } + if attrs.HasError() { +
    { attrs.Error }
    + } +
    + for _, option := range attrs.Values { +
    + + + if option.HelpText != "" { +
    { option.HelpText }
    + } +
    + } +
    +
    +} + +templ InputCheckboxGroup(name string, attrs InputAttrs) { +
    +
    + if attrs.HasLabel() { + { attrs.Label } + } +
    + if attrs.HasHelpText() { +
    { attrs.HelpText }
    + } + if attrs.HasError() { +
    { attrs.Error }
    + } +
    + for _, option := range attrs.Values { +
    + + + if option.HelpText != "" { +
    { option.HelpText }
    + } +
    + } +
    +
    +} + templ InputSubmit(attrs InputAttrs) { -
    +
    0 } @@ -131,7 +145,7 @@ func Form(id string, attrs FormAttrs) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap-oob=\"true\"") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"innerHTML\" hx-swap-oob=\"true\"") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -219,7 +233,7 @@ func Input(kind InputType, name string, attrs InputAttrs) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(attrs.Label) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 82, Col: 36} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 97, Col: 36} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -292,6 +306,10 @@ func Input(kind InputType, name string, attrs InputAttrs) templ.Component { return templ_7745c5c3_Err } } + templ_7745c5c3_Err = templ.RenderAttributes(ctx, templ_7745c5c3_Buffer, attrs.HX) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(">
    ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err @@ -304,7 +322,7 @@ func Input(kind InputType, name string, attrs InputAttrs) templ.Component { var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(attrs.HelpText) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 101, Col: 43} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 117, Col: 43} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { @@ -323,7 +341,7 @@ func Input(kind InputType, name string, attrs InputAttrs) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(attrs.Error) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 104, Col: 44} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 120, Col: 44} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -463,7 +481,7 @@ func Select(name string, attrs InputAttrs) templ.Component { var templ_7745c5c3_Var13 string templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(attrs.Label) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 125, Col: 36} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 141, Col: 36} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) if templ_7745c5c3_Err != nil { @@ -511,7 +529,7 @@ func Select(name string, attrs InputAttrs) templ.Component { var templ_7745c5c3_Var14 string templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(option) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 130, Col: 47} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 146, Col: 47} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) if templ_7745c5c3_Err != nil { @@ -537,7 +555,7 @@ func Select(name string, attrs InputAttrs) templ.Component { var templ_7745c5c3_Var15 string templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(option) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 132, Col: 38} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 148, Col: 38} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) if templ_7745c5c3_Err != nil { @@ -561,7 +579,7 @@ func Select(name string, attrs InputAttrs) templ.Component { var templ_7745c5c3_Var16 string templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(attrs.HelpText) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 137, Col: 42} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 153, Col: 42} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) if templ_7745c5c3_Err != nil { @@ -580,7 +598,7 @@ func Select(name string, attrs InputAttrs) templ.Component { var templ_7745c5c3_Var17 string templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(attrs.Error) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 140, Col: 43} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 156, Col: 43} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) if templ_7745c5c3_Err != nil { @@ -656,7 +674,7 @@ func InputTextArea(name string, attrs InputAttrs) templ.Component { var templ_7745c5c3_Var20 string templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(attrs.Label) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 148, Col: 36} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 164, Col: 36} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) if templ_7745c5c3_Err != nil { @@ -918,7 +936,7 @@ func InputTextArea(name string, attrs InputAttrs) templ.Component { var templ_7745c5c3_Var27 string templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(attrs.Value) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 209, Col: 18} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 225, Col: 18} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27)) if templ_7745c5c3_Err != nil { @@ -929,7 +947,7 @@ func InputTextArea(name string, attrs InputAttrs) templ.Component { return templ_7745c5c3_Err } if attrs.MarkdownModePreview { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -970,7 +988,7 @@ func InputTextArea(name string, attrs InputAttrs) templ.Component { var templ_7745c5c3_Var29 string templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(attrs.HelpText) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 224, Col: 22} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 240, Col: 22} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29)) if templ_7745c5c3_Err != nil { @@ -989,7 +1007,7 @@ func InputTextArea(name string, attrs InputAttrs) templ.Component { var templ_7745c5c3_Var30 string templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(attrs.Error) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 228, Col: 45} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 244, Col: 45} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30)) if templ_7745c5c3_Err != nil { @@ -1011,7 +1029,7 @@ func InputTextArea(name string, attrs InputAttrs) templ.Component { }) } -func InputSubmit(attrs InputAttrs) templ.Component { +func InputRadioGroup(name string, attrs InputAttrs) templ.Component { return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { @@ -1024,7 +1042,379 @@ func InputSubmit(attrs InputAttrs) templ.Component { templ_7745c5c3_Var31 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if attrs.HasLabel() { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var33 string + templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(attrs.Label) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 255, Col: 25} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if attrs.HasHelpText() { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var34 string + templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(attrs.HelpText) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 259, Col: 44} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + if attrs.HasError() { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var35 string + templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(attrs.Error) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 262, Col: 45} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for _, option := range attrs.Values { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if option.HelpText != "" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var37 string + templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(option.HelpText) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 280, Col: 46} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func InputCheckboxGroup(name string, attrs InputAttrs) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var38 := templ.GetChildren(ctx) + if templ_7745c5c3_Var38 == nil { + templ_7745c5c3_Var38 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var templ_7745c5c3_Var39 = []any{"input-group checkbox-group", templ.KV("error", attrs.HasError())} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var39...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if attrs.HasLabel() { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var40 string + templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.JoinStringErrs(attrs.Label) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 292, Col: 25} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var40)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if attrs.HasHelpText() { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var41 string + templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(attrs.HelpText) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 296, Col: 44} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + if attrs.HasError() { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var42 string + templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinStringErrs(attrs.Error) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 299, Col: 45} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for _, option := range attrs.Values { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if option.HelpText != "" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var44 string + templ_7745c5c3_Var44, templ_7745c5c3_Err = templ.JoinStringErrs(option.HelpText) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/input.templ`, Line: 317, Col: 46} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var44)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func InputSubmit(attrs InputAttrs) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var45 := templ.GetChildren(ctx) + if templ_7745c5c3_Var45 == nil { + templ_7745c5c3_Var45 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    + + +
    + } +} + +templ (v Membership) SlugField(slug, err string) { +
    + @InputText("slug", InputAttrs{ + Label: "Organization ID", + HelpText: "This is used in URLs and must be globally unique", + Error: err, + Value: slug, + HX: templ.Attributes{ + "hx-post": named.URLFor("group-check-slug", v.Kind.String()), + "hx-trigger": "input changed delay:500ms", + "hx-target": "#slug-check", + "hx-swap": "outerHTML", + }, + }) +
    +} diff --git a/internal/views/memberships_templ.go b/internal/views/memberships_templ.go new file mode 100644 index 0000000..3bad309 --- /dev/null +++ b/internal/views/memberships_templ.go @@ -0,0 +1,189 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.513 +package views + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +import "github.com/ryanfaerman/netctl/internal/models" +import "github.com/ryanfaerman/netctl/web/named" + +type Membership struct { + Kind models.AccountKind +} + +func (v Membership) Create() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + 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 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var3 := `Create a new organization` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var3) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var4 := `An organization is a loose collection of stations, joined ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var4) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var5 := `together in a common cause. This could be for a local traffic net, ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var5) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var6 := `rag-chewing, or emergency preparedness.` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var6) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var7 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + templ_7745c5c3_Err = InputText("name", InputAttrs{ + Label: "Name", + HelpText: "What should your organization be called?", + DisableAutocomplete: true, + HX: templ.Attributes{ + "hx-post": named.URLFor("group-check-slug", v.Kind.String()), + "hx-trigger": "input changed delay:500ms", + "hx-target": "#slug-check", + "hx-swap": "outerHTML", + }, + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = v.SlugField("", "").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = InputSubmit(InputAttrs{ + Value: "Create", + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = Form("group-create", FormAttrs{ + Action: named.URLFor("group-create", v.Kind.String()), + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var7), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = BarePage().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func (v Membership) SlugField(slug, err string) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + 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_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = InputText("slug", InputAttrs{ + Label: "Organization ID", + HelpText: "This is used in URLs and must be globally unique", + Error: err, + Value: slug, + HX: templ.Attributes{ + "hx-post": named.URLFor("group-check-slug", v.Kind.String()), + "hx-trigger": "input changed delay:500ms", + "hx-target": "#slug-check", + "hx-swap": "outerHTML", + }, + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} diff --git a/internal/views/navigation.templ b/internal/views/navigation.templ index 1e8835f..4f61612 100644 --- a/internal/views/navigation.templ +++ b/internal/views/navigation.templ @@ -201,7 +201,7 @@ templ LeftNavHeader() {
    } -func LeftNav() SideMenu { +func LeftNav(ctx context.Context) SideMenu { return SideMenu{ Header: LeftNavHeader(), OnRight: false, @@ -233,7 +233,7 @@ templ RightNavHeader() { { CurrentAccount(ctx).Callsign().Call } } -func RightNav() SideMenu { +func RightNav(ctx context.Context) SideMenu { return SideMenu{ Header: RightNavHeader(), OnRight: true, @@ -242,8 +242,8 @@ func RightNav() SideMenu { {Value: "Your Profile", URL: named.URLFor("account-profile-self"), Icon: IconAttrs{Name: "user"}}, {Value: "Your Logbooks", URL: "#", Icon: IconAttrs{Name: "book"}}, {Value: "Your Nets", URL: "#", Icon: IconAttrs{Name: "users-rectangle"}}, - {Value: "Your Clubs", URL: "#", Icon: IconAttrs{Name: "people-group"}}, - {Value: "Settings", URL: "#", Icon: IconAttrs{Name: "sliders"}}, + {Value: "Your Clubs", URL: named.URLFor("settings", "clubs"), Icon: IconAttrs{Name: "people-group"}}, + {Value: "Settings", URL: named.URLFor("settings", "profile"), Icon: IconAttrs{Name: "sliders"}, CanAction: "edit", CanResource: CurrentAccount(ctx)}, }, { {Value: "Net Control Docs", URL: "#", Icon: IconAttrs{Name: "book-open"}}, @@ -256,85 +256,15 @@ func RightNav() SideMenu { } } -templ SlideOver(side string) { -
    -
    - +templ Nav(section string, m Menu) { +
    + if section != "" { +

    { section }

    + } +
      + for _, item := range m { + @item.Item() + } +
    } diff --git a/internal/views/navigation_templ.go b/internal/views/navigation_templ.go index b39143c..42ac782 100644 --- a/internal/views/navigation_templ.go +++ b/internal/views/navigation_templ.go @@ -483,7 +483,7 @@ func LeftNavHeader() templ.Component { }) } -func LeftNav() SideMenu { +func LeftNav(ctx context.Context) SideMenu { return SideMenu{ Header: LeftNavHeader(), OnRight: false, @@ -565,7 +565,7 @@ func RightNavHeader() templ.Component { }) } -func RightNav() SideMenu { +func RightNav(ctx context.Context) SideMenu { return SideMenu{ Header: RightNavHeader(), OnRight: true, @@ -574,8 +574,8 @@ func RightNav() SideMenu { {Value: "Your Profile", URL: named.URLFor("account-profile-self"), Icon: IconAttrs{Name: "user"}}, {Value: "Your Logbooks", URL: "#", Icon: IconAttrs{Name: "book"}}, {Value: "Your Nets", URL: "#", Icon: IconAttrs{Name: "users-rectangle"}}, - {Value: "Your Clubs", URL: "#", Icon: IconAttrs{Name: "people-group"}}, - {Value: "Settings", URL: "#", Icon: IconAttrs{Name: "sliders"}}, + {Value: "Your Clubs", URL: named.URLFor("settings", "clubs"), Icon: IconAttrs{Name: "people-group"}}, + {Value: "Settings", URL: named.URLFor("settings", "profile"), Icon: IconAttrs{Name: "sliders"}, CanAction: "edit", CanResource: CurrentAccount(ctx)}, }, { {Value: "Net Control Docs", URL: "#", Icon: IconAttrs{Name: "book-open"}}, @@ -588,7 +588,7 @@ func RightNav() SideMenu { } } -func SlideOver(side string) templ.Component { +func Nav(section string, m Menu) templ.Component { return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { @@ -601,170 +601,40 @@ func SlideOver(side string) templ.Component { templ_7745c5c3_Var20 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var21 := `Ryan Faerman` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var21) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var22 := `KQ4JXI` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var22) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = IconSolid("xmark").Render(ctx, templ_7745c5c3_Buffer) - 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 } diff --git a/internal/views/net.templ b/internal/views/net.templ index d72720a..2120d9c 100644 --- a/internal/views/net.templ +++ b/internal/views/net.templ @@ -105,14 +105,18 @@ templ (n Net) Show() { } else { Sessions - @Form("new-session", FormAttrs{ - Action: named.URLFor("net-session-new", n.Net.StreamID), - HX: templ.Attributes{ - "hx-target": "body", - }, - }) { - @InputSubmit(InputAttrs{Value: "Start a Session"}) - } +
    +

    + Our purpose is to pass formal written traffic, announce amateur radio events, + deliver information on severe Weather, and to provide training for new + operators and net control stations. We also provide emergency communications, + or special sessions when necessary, and will assist agencies under Homeland + Security, such as FEMA and Broward County Emergency Management, and + the Broward County Emergency Coordinator, if called upon to do so. +

    +

    Thank you for visiting and we hope you will join us on the air.

    +
    + @ActivityGraph()
      for _, id := range n.Net.SessionIDs {
    • @@ -124,7 +128,98 @@ templ (n Net) Show() {
    }
    -
    +
    + +
    } } diff --git a/internal/views/net_templ.go b/internal/views/net_templ.go index 1b56955..784b09f 100644 --- a/internal/views/net_templ.go +++ b/internal/views/net_templ.go @@ -367,27 +367,74 @@ func (n Net) Show() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var21 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) - if !templ_7745c5c3_IsBuffer { - templ_7745c5c3_Buffer = templ.GetBuffer() - defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) - } - templ_7745c5c3_Err = InputSubmit(InputAttrs{Value: "Start a Session"}).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if !templ_7745c5c3_IsBuffer { - _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) - } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = Form("new-session", FormAttrs{ - Action: named.URLFor("net-session-new", n.Net.StreamID), - HX: templ.Attributes{ - "hx-target": "body", - }, - }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var21), templ_7745c5c3_Buffer) + } + templ_7745c5c3_Var21 := `Our purpose is to pass formal written traffic, announce amateur radio events, ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var21) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var22 := `deliver information on severe Weather, and to provide training for new ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var22) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var23 := `operators and net control stations. We also provide emergency communications, ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var23) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var24 := `or special sessions when necessary, and will assist agencies under Homeland ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var25 := `Security, such as FEMA and Broward County Emergency Management, and ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var25) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var26 := `the Broward County Emergency Coordinator, if called upon to do so.` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var26) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var27 := `Thank you for visiting and we hope you will join us on the air.` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var27) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = ActivityGraph().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -400,8 +447,8 @@ func (n Net) Show() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var22 templ.SafeURL = templ.URL(named.URLFor("net-session-show", id)) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var22))) + var templ_7745c5c3_Var28 templ.SafeURL = templ.URL(named.URLFor("net-session-show", id)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var28))) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -409,12 +456,12 @@ func (n Net) Show() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var23 string - templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(n.Net.Sessions[id].CreatedAt.Format("2006-01-02 15:04:05")) + var templ_7745c5c3_Var29 string + templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(n.Net.Sessions[id].CreatedAt.Format("2006-01-02 15:04:05")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 119, Col: 69} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 123, Col: 69} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -428,7 +475,411 @@ func (n Net) Show() templ.Component { 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 + } + templ_7745c5c3_Var30 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + templ_7745c5c3_Err = InputSubmit(InputAttrs{Value: "Start a Session"}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = Form("new-session", FormAttrs{ + Action: named.URLFor("net-session-new", n.Net.StreamID), + HX: templ.Attributes{ + "hx-target": "body", + }, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var30), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var31 := `Management Team` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var31) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var32 := `Manager` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var32) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var33 := `Ken Polkerson [W44BUG]` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var33) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var34 := `Regional Liasons` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var34) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var35 := `Arthur McCallister [W4BUG]` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var35) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var36 := `Arthur McCallister [W4BUG]` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var36) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var37 := `Arthur McCallister [W4BUG]` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var37) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var38 := `Controllers` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var38) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var39 := `Arthur McCallister [W4BUG]` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var39) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var40 := `Arthur McCallister [W4BUG]` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var40) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var41 := `Arthur McCallister [W4BUG]` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var41) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var42 := `Arthur McCallister [W4BUG]` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var42) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var43 := `Schedule` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var43) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var44 := `Monday` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var44) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var45 := `18:00 EST` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var45) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var46 := `Tuesday` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var46) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var47 := `18:00 EST` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var47) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var48 := `Wednesday` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var48) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var49 := `18:00 EST` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var49) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var50 := `Thursday` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var50) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var51 := `18:00 EST` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var51) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var52 := `Friday` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var52) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var53 := `18:00 EST` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var53) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var54 := `Sat - Sun` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var54) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var55 := `NO NET` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var55) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var56 := `Radio Settings` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var56) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var57 := `Type` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var57) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var58 := `Primary` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var58) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var59 := `Frequency` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var59) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = IconSolid("arrow-down").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var60 := `146.610` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var60) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = IconSolid("arrow-up").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var61 := `146.010` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var61) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var62 := `Tone` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var62) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var63 := `110.9` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var63) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var64 := `Type` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var64) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var65 := `Backup` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var65) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var66 := `Frequency` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var66) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = IconSolid("arrow-down").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var67 := `146.790` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var67) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = IconSolid("arrow-up").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var68 := `146.190` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var68) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var69 := `Tone` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var69) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var70 := `88.5` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var70) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -456,12 +907,12 @@ func (v Net) SingleNetSession(streamID string) templ.Component { defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var24 := templ.GetChildren(ctx) - if templ_7745c5c3_Var24 == nil { - templ_7745c5c3_Var24 = templ.NopComponent + templ_7745c5c3_Var71 := templ.GetChildren(ctx) + if templ_7745c5c3_Var71 == nil { + templ_7745c5c3_Var71 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var25 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var72 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { templ_7745c5c3_Buffer = templ.GetBuffer() @@ -471,7 +922,7 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var26 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var73 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { templ_7745c5c3_Buffer = templ.GetBuffer() @@ -494,11 +945,11 @@ func (v Net) SingleNetSession(streamID string) templ.Component { } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = Can("perform-checkins", v.Net).Render(templ.WithChildren(ctx, templ_7745c5c3_Var26), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = Can("perform-checkins", v.Net).Render(templ.WithChildren(ctx, templ_7745c5c3_Var73), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var27 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var74 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { templ_7745c5c3_Buffer = templ.GetBuffer() @@ -508,8 +959,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var28 := `Check-ins` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var28) + templ_7745c5c3_Var75 := `Check-ins` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var75) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -517,8 +968,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var29 := `Only registered Net Control stations are permitted to receive check-ins to this net.` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var29) + templ_7745c5c3_Var76 := `Only registered Net Control stations are permitted to receive check-ins to this net.` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var76) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -531,12 +982,12 @@ func (v Net) SingleNetSession(streamID string) templ.Component { } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = Cannot("perform-checkins", v.Net).Render(templ.WithChildren(ctx, templ_7745c5c3_Var27), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = Cannot("perform-checkins", v.Net).Render(templ.WithChildren(ctx, templ_7745c5c3_Var74), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var30 = []any{templ.KV("stickable", UserCan(ctx, "perform-checkins", v.Net))} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var30...) + var templ_7745c5c3_Var77 = []any{templ.KV("stickable", UserCan(ctx, "perform-checkins", v.Net))} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var77...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -552,7 +1003,7 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ.CSSClasses(templ_7745c5c3_Var30).String())) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ.CSSClasses(templ_7745c5c3_Var77).String())) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -568,7 +1019,7 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var31 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var78 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { templ_7745c5c3_Buffer = templ.GetBuffer() @@ -578,8 +1029,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var32 := `Timeline` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var32) + templ_7745c5c3_Var79 := `Timeline` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var79) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -602,7 +1053,7 @@ func (v Net) SingleNetSession(streamID string) templ.Component { } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = FeatureFlag("net.session.timeline").Render(templ.WithChildren(ctx, templ_7745c5c3_Var31), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = FeatureFlag("net.session.timeline").Render(templ.WithChildren(ctx, templ_7745c5c3_Var78), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -610,12 +1061,12 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var33 string - templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(v.Net.Name) + var templ_7745c5c3_Var80 string + templ_7745c5c3_Var80, templ_7745c5c3_Err = templ.JoinStringErrs(v.Net.Name) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 173, Col: 19} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 268, Col: 19} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var80)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -623,12 +1074,12 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var34 string - templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(v.Session.CreatedAt.Format("Monday, January 2, 2006 15:04")) + var templ_7745c5c3_Var81 string + templ_7745c5c3_Var81, templ_7745c5c3_Err = templ.JoinStringErrs(v.Session.CreatedAt.Format("Monday, January 2, 2006 15:04")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 174, Col: 75} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 269, Col: 75} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var81)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -636,8 +1087,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var35 := `Description` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var35) + templ_7745c5c3_Var82 := `Description` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var82) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -645,8 +1096,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var36 := `Our purpose is to pass formal written traffic, announce amateur radio events, deliver ` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var36) + templ_7745c5c3_Var83 := `Our purpose is to pass formal written traffic, announce amateur radio events, deliver ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var83) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -654,8 +1105,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var37 := `information on severe Weather, and to provide training for new operators and net ` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var37) + templ_7745c5c3_Var84 := `information on severe Weather, and to provide training for new operators and net ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var84) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -663,8 +1114,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var38 := `control stations. We also provide emergency communications, or special sessions when ` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var38) + templ_7745c5c3_Var85 := `control stations. We also provide emergency communications, or special sessions when ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var85) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -672,8 +1123,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var39 := `necessary, and will assist agencies under Homeland Security, such as FEMA and Broward ` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var39) + templ_7745c5c3_Var86 := `necessary, and will assist agencies under Homeland Security, such as FEMA and Broward ` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var86) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -681,8 +1132,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var40 := `County Emergency Management, and the Broward County Emergency Coordinator, if called` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var40) + templ_7745c5c3_Var87 := `County Emergency Management, and the Broward County Emergency Coordinator, if called` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var87) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -690,8 +1141,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var41 := `upon to do so.` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var41) + templ_7745c5c3_Var88 := `upon to do so.` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var88) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -699,8 +1150,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var42 := `Thank you for visiting and we hope you will join us on the air.` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var42) + templ_7745c5c3_Var89 := `Thank you for visiting and we hope you will join us on the air.` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var89) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -708,8 +1159,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var43 := `Manager` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var43) + templ_7745c5c3_Var90 := `Manager` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var90) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -717,8 +1168,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var44 := `Ken Polkerson [W44BUG]` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var44) + templ_7745c5c3_Var91 := `Ken Polkerson [W44BUG]` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var91) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -726,8 +1177,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var45 := `Regional Liasons` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var45) + templ_7745c5c3_Var92 := `Regional Liasons` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var92) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -735,8 +1186,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var46 := `Arthur McCallister [W4BUG]` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var46) + templ_7745c5c3_Var93 := `Arthur McCallister [W4BUG]` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var93) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -744,8 +1195,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var47 := `Arthur McCallister [W4BUG]` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var47) + templ_7745c5c3_Var94 := `Arthur McCallister [W4BUG]` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var94) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -753,8 +1204,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var48 := `Arthur McCallister [W4BUG]` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var48) + templ_7745c5c3_Var95 := `Arthur McCallister [W4BUG]` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var95) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -762,8 +1213,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var49 := `Controllers` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var49) + templ_7745c5c3_Var96 := `Controllers` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var96) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -771,8 +1222,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var50 := `Arthur McCallister [W4BUG]` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var50) + templ_7745c5c3_Var97 := `Arthur McCallister [W4BUG]` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var97) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -780,8 +1231,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var51 := `Arthur McCallister [W4BUG]` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var51) + templ_7745c5c3_Var98 := `Arthur McCallister [W4BUG]` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var98) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -789,8 +1240,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var52 := `Arthur McCallister [W4BUG]` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var52) + templ_7745c5c3_Var99 := `Arthur McCallister [W4BUG]` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var99) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -798,8 +1249,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var53 := `Arthur McCallister [W4BUG]` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var53) + templ_7745c5c3_Var100 := `Arthur McCallister [W4BUG]` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var100) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -807,8 +1258,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var54 := `Schedule` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var54) + templ_7745c5c3_Var101 := `Schedule` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var101) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -816,8 +1267,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var55 := `Monday` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var55) + templ_7745c5c3_Var102 := `Monday` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var102) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -825,8 +1276,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var56 := `18:00 EST` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var56) + templ_7745c5c3_Var103 := `18:00 EST` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var103) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -834,8 +1285,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var57 := `Tuesday` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var57) + templ_7745c5c3_Var104 := `Tuesday` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var104) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -843,8 +1294,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var58 := `18:00 EST` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var58) + templ_7745c5c3_Var105 := `18:00 EST` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var105) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -852,8 +1303,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var59 := `Wednesday` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var59) + templ_7745c5c3_Var106 := `Wednesday` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var106) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -861,8 +1312,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var60 := `18:00 EST` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var60) + templ_7745c5c3_Var107 := `18:00 EST` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var107) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -870,8 +1321,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var61 := `Thursday` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var61) + templ_7745c5c3_Var108 := `Thursday` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var108) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -879,8 +1330,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var62 := `18:00 EST` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var62) + templ_7745c5c3_Var109 := `18:00 EST` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var109) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -888,8 +1339,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var63 := `Friday` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var63) + templ_7745c5c3_Var110 := `Friday` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var110) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -897,8 +1348,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var64 := `18:00 EST` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var64) + templ_7745c5c3_Var111 := `18:00 EST` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var111) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -906,8 +1357,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var65 := `Sat - Sun` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var65) + templ_7745c5c3_Var112 := `Sat - Sun` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var112) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -915,8 +1366,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var66 := `NO NET` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var66) + templ_7745c5c3_Var113 := `NO NET` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var113) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -924,8 +1375,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var67 := `Radio Settings` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var67) + templ_7745c5c3_Var114 := `Radio Settings` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var114) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -933,8 +1384,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var68 := `Type` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var68) + templ_7745c5c3_Var115 := `Type` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var115) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -942,8 +1393,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var69 := `Primary` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var69) + templ_7745c5c3_Var116 := `Primary` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var116) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -951,8 +1402,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var70 := `Frequency` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var70) + templ_7745c5c3_Var117 := `Frequency` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var117) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -964,8 +1415,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var71 := `146.610` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var71) + templ_7745c5c3_Var118 := `146.610` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var118) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -977,8 +1428,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var72 := `146.010` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var72) + templ_7745c5c3_Var119 := `146.010` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var119) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -986,8 +1437,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var73 := `Tone` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var73) + templ_7745c5c3_Var120 := `Tone` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var120) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -995,8 +1446,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var74 := `110.9` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var74) + templ_7745c5c3_Var121 := `110.9` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var121) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1004,8 +1455,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var75 := `Type` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var75) + templ_7745c5c3_Var122 := `Type` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var122) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1013,8 +1464,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var76 := `Backup` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var76) + templ_7745c5c3_Var123 := `Backup` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var123) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1022,8 +1473,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var77 := `Frequency` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var77) + templ_7745c5c3_Var124 := `Frequency` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var124) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1035,8 +1486,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var78 := `146.790` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var78) + templ_7745c5c3_Var125 := `146.790` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var125) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1048,8 +1499,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var79 := `146.190` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var79) + templ_7745c5c3_Var126 := `146.190` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var126) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1057,8 +1508,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var80 := `Tone` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var80) + templ_7745c5c3_Var127 := `Tone` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var127) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1066,8 +1517,8 @@ func (v Net) SingleNetSession(streamID string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var81 := `88.5` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var81) + templ_7745c5c3_Var128 := `88.5` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var128) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1085,7 +1536,7 @@ func (v Net) SingleNetSession(streamID string) templ.Component { {Value: "Check Ins", URL: named.URLFor("net-session-show", streamID), Icon: IconAttrs{Name: "list-check"}}, {Value: "Reports", URL: "#", Icon: IconAttrs{Name: "receipt"}}, {Value: "Settings", URL: "#", Icon: IconAttrs{Name: "sliders"}, CanAction: "edit", CanResource: v.Net}, - }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var25), templ_7745c5c3_Buffer) + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var72), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1104,12 +1555,12 @@ func (v Net) TrafficTable(streamID string) templ.Component { defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var82 := templ.GetChildren(ctx) - if templ_7745c5c3_Var82 == nil { - templ_7745c5c3_Var82 = templ.NopComponent + templ_7745c5c3_Var129 := templ.GetChildren(ctx) + if templ_7745c5c3_Var129 == nil { + templ_7745c5c3_Var129 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var83 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var130 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { templ_7745c5c3_Buffer = templ.GetBuffer() @@ -1140,7 +1591,7 @@ func (v Net) TrafficTable(streamID string) templ.Component { "Traffic Type", "Time In", }, - }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var83), templ_7745c5c3_Buffer) + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var130), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1171,9 +1622,9 @@ func (v Net) CheckinForm() templ.Component { defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var84 := templ.GetChildren(ctx) - if templ_7745c5c3_Var84 == nil { - templ_7745c5c3_Var84 = templ.NopComponent + templ_7745c5c3_Var131 := templ.GetChildren(ctx) + if templ_7745c5c3_Var131 == nil { + templ_7745c5c3_Var131 = templ.NopComponent } ctx = templ.ClearChildren(ctx) templ_7745c5c3_Err = v.CheckinFormWithErrors(CheckinFormInput{}, CheckinFormErrors{}).Render(ctx, templ_7745c5c3_Buffer) @@ -1195,12 +1646,12 @@ func (v Net) CheckinFormWithErrors(input CheckinFormInput, errs CheckinFormError defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var85 := templ.GetChildren(ctx) - if templ_7745c5c3_Var85 == nil { - templ_7745c5c3_Var85 = templ.NopComponent + templ_7745c5c3_Var132 := templ.GetChildren(ctx) + if templ_7745c5c3_Var132 == nil { + templ_7745c5c3_Var132 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var86 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var133 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { templ_7745c5c3_Buffer = templ.GetBuffer() @@ -1267,7 +1718,7 @@ func (v Net) CheckinFormWithErrors(input CheckinFormInput, errs CheckinFormError HX: templ.Attributes{ "hx-swap": "innerHTML", }, - }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var86), templ_7745c5c3_Buffer) + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var133), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1286,13 +1737,13 @@ func (n Net) CheckinRow(checkin models.NetCheckin, isNew ...bool) templ.Componen defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var87 := templ.GetChildren(ctx) - if templ_7745c5c3_Var87 == nil { - templ_7745c5c3_Var87 = templ.NopComponent + templ_7745c5c3_Var134 := templ.GetChildren(ctx) + if templ_7745c5c3_Var134 == nil { + templ_7745c5c3_Var134 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - var templ_7745c5c3_Var88 = []any{strings.ToLower(checkin.Kind.String())} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var88...) + var templ_7745c5c3_Var135 = []any{strings.ToLower(checkin.Kind.String())} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var135...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1308,7 +1759,7 @@ func (n Net) CheckinRow(checkin models.NetCheckin, isNew ...bool) templ.Componen if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ.CSSClasses(templ_7745c5c3_Var88).String())) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ.CSSClasses(templ_7745c5c3_Var135).String())) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1431,7 +1882,7 @@ func (n Net) CheckinRow(checkin models.NetCheckin, isNew ...bool) templ.Componen return templ_7745c5c3_Err } } else { - templ_7745c5c3_Var89 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var136 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { templ_7745c5c3_Buffer = templ.GetBuffer() @@ -1466,7 +1917,7 @@ func (n Net) CheckinRow(checkin models.NetCheckin, isNew ...bool) templ.Componen } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = Can("perform-checkins", n.Net).Render(templ.WithChildren(ctx, templ_7745c5c3_Var89), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = Can("perform-checkins", n.Net).Render(templ.WithChildren(ctx, templ_7745c5c3_Var136), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1474,7 +1925,7 @@ func (n Net) CheckinRow(checkin models.NetCheckin, isNew ...bool) templ.Componen if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var90 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var137 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { templ_7745c5c3_Buffer = templ.GetBuffer() @@ -1497,7 +1948,7 @@ func (n Net) CheckinRow(checkin models.NetCheckin, isNew ...bool) templ.Componen } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = Cannot("perform-checkins", n.Net).Render(templ.WithChildren(ctx, templ_7745c5c3_Var90), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = Cannot("perform-checkins", n.Net).Render(templ.WithChildren(ctx, templ_7745c5c3_Var137), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1506,8 +1957,8 @@ func (n Net) CheckinRow(checkin models.NetCheckin, isNew ...bool) templ.Componen if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var91 = []any{"callsign", templ.KV("is-verified", checkin.Verified), templ.KV("is-invalid", !checkin.Verified || checkin.Valid != nil)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var91...) + var templ_7745c5c3_Var138 = []any{"callsign", templ.KV("is-verified", checkin.Verified), templ.KV("is-invalid", !checkin.Verified || checkin.Valid != nil)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var138...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1515,7 +1966,7 @@ func (n Net) CheckinRow(checkin models.NetCheckin, isNew ...bool) templ.Componen if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ.CSSClasses(templ_7745c5c3_Var91).String())) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ.CSSClasses(templ_7745c5c3_Var138).String())) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1538,12 +1989,12 @@ func (n Net) CheckinRow(checkin models.NetCheckin, isNew ...bool) templ.Componen if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var92 string - templ_7745c5c3_Var92, templ_7745c5c3_Err = templ.JoinStringErrs(checkin.Callsign.AsHeard) + var templ_7745c5c3_Var139 string + templ_7745c5c3_Var139, templ_7745c5c3_Err = templ.JoinStringErrs(checkin.Callsign.AsHeard) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 422, Col: 30} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 517, Col: 30} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var92)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var139)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1552,29 +2003,29 @@ func (n Net) CheckinRow(checkin models.NetCheckin, isNew ...bool) templ.Componen return templ_7745c5c3_Err } if checkin.Name.AsHeard != "" { - var templ_7745c5c3_Var93 string - templ_7745c5c3_Var93, templ_7745c5c3_Err = templ.JoinStringErrs(checkin.Name.AsHeard) + var templ_7745c5c3_Var140 string + templ_7745c5c3_Var140, templ_7745c5c3_Err = templ.JoinStringErrs(checkin.Name.AsHeard) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 427, Col: 26} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 522, Col: 26} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var93)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var140)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else { if checkin.Name.AsLicensed != "" { - var templ_7745c5c3_Var94 string - templ_7745c5c3_Var94, templ_7745c5c3_Err = templ.JoinStringErrs(checkin.Name.AsLicensed) + var templ_7745c5c3_Var141 string + templ_7745c5c3_Var141, templ_7745c5c3_Err = templ.JoinStringErrs(checkin.Name.AsLicensed) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 430, Col: 30} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 525, Col: 30} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var94)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var141)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else { - templ_7745c5c3_Var95 := `UNKNOWN` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var95) + templ_7745c5c3_Var142 := `UNKNOWN` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var142) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1585,18 +2036,18 @@ func (n Net) CheckinRow(checkin models.NetCheckin, isNew ...bool) templ.Componen return templ_7745c5c3_Err } if checkin.Location.AsLicensed != "" { - var templ_7745c5c3_Var96 string - templ_7745c5c3_Var96, templ_7745c5c3_Err = templ.JoinStringErrs(checkin.Location.AsLicensed) + var templ_7745c5c3_Var143 string + templ_7745c5c3_Var143, templ_7745c5c3_Err = templ.JoinStringErrs(checkin.Location.AsLicensed) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 438, Col: 33} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 533, Col: 33} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var96)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var143)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else { - templ_7745c5c3_Var97 := `UNKNOWN` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var97) + templ_7745c5c3_Var144 := `UNKNOWN` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var144) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1605,12 +2056,12 @@ func (n Net) CheckinRow(checkin models.NetCheckin, isNew ...bool) templ.Componen if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var98 string - templ_7745c5c3_Var98, templ_7745c5c3_Err = templ.JoinStringErrs(checkin.Kind.String()) + var templ_7745c5c3_Var145 string + templ_7745c5c3_Var145, templ_7745c5c3_Err = templ.JoinStringErrs(checkin.Kind.String()) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 444, Col: 26} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 539, Col: 26} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var98)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var145)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1618,12 +2069,12 @@ func (n Net) CheckinRow(checkin models.NetCheckin, isNew ...bool) templ.Componen if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var99 string - templ_7745c5c3_Var99, templ_7745c5c3_Err = templ.JoinStringErrs(checkin.At.Format("15:04:05")) + var templ_7745c5c3_Var146 string + templ_7745c5c3_Var146, templ_7745c5c3_Err = templ.JoinStringErrs(checkin.At.Format("15:04:05")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 447, Col: 34} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 542, Col: 34} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var99)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var146)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1652,9 +2103,9 @@ func (n Net) TimelineItem(event models.Event) templ.Component { defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var100 := templ.GetChildren(ctx) - if templ_7745c5c3_Var100 == nil { - templ_7745c5c3_Var100 = templ.NopComponent + templ_7745c5c3_Var147 := templ.GetChildren(ctx) + if templ_7745c5c3_Var147 == nil { + templ_7745c5c3_Var147 = templ.NopComponent } ctx = templ.ClearChildren(ctx) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") @@ -1671,20 +2122,20 @@ func (n Net) TimelineItem(event models.Event) templ.Component { } switch event.Name { case "events.NetCheckinHeard": - templ_7745c5c3_Var101 := `Heard a new checkin` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var101) + templ_7745c5c3_Var148 := `Heard a new checkin` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var148) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } case "events.NetCheckinAcked": - templ_7745c5c3_Var102 := `Acknowledged a checkin` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var102) + templ_7745c5c3_Var149 := `Acknowledged a checkin` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var149) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } case "events.NetCheckinVerified": - templ_7745c5c3_Var103 := `A station was verified` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var103) + templ_7745c5c3_Var150 := `A station was verified` + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var150) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1693,11 +2144,11 @@ func (n Net) TimelineItem(event models.Event) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Var104 := ` W4BUG + templ_7745c5c3_Var151 := ` W4BUG checked in by W4BUG { event.Name } ` - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var104) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var151) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1705,12 +2156,12 @@ func (n Net) TimelineItem(event models.Event) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var105 string - templ_7745c5c3_Var105, templ_7745c5c3_Err = templ.JoinStringErrs(event.At.Format("15:04:15")) + var templ_7745c5c3_Var152 string + templ_7745c5c3_Var152, templ_7745c5c3_Err = templ.JoinStringErrs(event.At.Format("15:04:15")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 476, Col: 39} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/net.templ`, Line: 571, Col: 39} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var105)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var152)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/internal/views/states.go b/internal/views/states.go new file mode 100644 index 0000000..01588ba --- /dev/null +++ b/internal/views/states.go @@ -0,0 +1,70 @@ +package views + +import "strings" + +var states = map[string]string{ + "AL": "Alabama", + "AK": "Alaska", + "AZ": "Arizona", + "AR": "Arkansas", + "CA": "California", + "CO": "Colorado", + "CT": "Connecticut", + "DE": "Delaware", + "FL": "Florida", + "GA": "Georgia", + "HI": "Hawaii", + "ID": "Idaho", + "IL": "Illinois", + "IN": "Indiana", + "IA": "Iowa", + "KS": "Kansas", + "KY": "Kentucky", + "LA": "Louisiana", + "ME": "Maine", + "MD": "Maryland", + "MA": "Massachusetts", + "MI": "Michigan", + "MN": "Minnesota", + "MS": "Mississippi", + "MO": "Missouri", + "MT": "Montana", + "NE": "Nebraska", + "NV": "Nevada", + "NH": "New Hampshire", + "NJ": "New Jersey", + "NM": "New Mexico", + "NY": "New York", + "NC": "North Carolina", + "ND": "North Dakota", + "OH": "Ohio", + "OK": "Oklahoma", + "OR": "Oregon", + "PA": "Pennsylvania", + "RI": "Rhode Island", + "SC": "South Carolina", + "SD": "South Dakota", + "TN": "Tennessee", + "TX": "Texas", + "UT": "Utah", + "VT": "Vermont", + "VA": "Virgina", + "WA": "Washington", + "WV": "West Virgina", + "WI": "Wisconson", + "WY": "Wyoming", + "DC": "District of Colombia", + "GU": "Guam", + "MH": "Marshall Islands", + "PR": "Puerto Rico", + "VI": "Virgin Islands", +} + +func StateAbbreviationToName(s string) string { + state, ok := states[strings.ToUpper(s)] + if !ok { + return s + } + + return state +} diff --git a/internal/views/styles/_main.scss b/internal/views/styles/_main.scss index 39a057a..35485e8 100644 --- a/internal/views/styles/_main.scss +++ b/internal/views/styles/_main.scss @@ -1,4 +1,8 @@ @use 'normalize.css'; @use 'barebones.css'; @use 'custom.css'; - +@use 'containers'; +@use 'markdown'; +@use 'profile'; +@use 'navigation'; +@use 'forms'; diff --git a/internal/views/styles/containers.scss b/internal/views/styles/containers.scss new file mode 100644 index 0000000..dc68cdb --- /dev/null +++ b/internal/views/styles/containers.scss @@ -0,0 +1,16 @@ +.grid-container{ + &.left-split { + grid-template-columns: 2fr 5fr; + grid-template-rows: 1fr; + + &.with-context { + grid-template-columns: 1fr 3fr 1fr; + grid-column-gap: 3.2em; + } + } + + &.main-content{ + margin-top: 3em; + } +} + diff --git a/internal/views/styles/custom.css b/internal/views/styles/custom.css index 6390775..13b8621 100644 --- a/internal/views/styles/custom.css +++ b/internal/views/styles/custom.css @@ -894,155 +894,6 @@ span.callsign { height: 5px; background: url("/static/assets/squiggle.png") bottom repeat-x; } - - -.markdown-editor { - border: 1px solid var(--border-color-softer); - border-radius: 0.4rem; -} - -textarea { - padding: 1rem; - margin-bottom: 1.5rem; - min-height: 10rem; - resize: vertical; - z-index: 10; - width: 100%; -} - -.markdown-editor .editor { - padding: 1rem; - margin: 0 .5rem; - margin-bottom: 1.5rem; - min-height: 10rem; - width: calc(100% - 1rem); - resize: vertical; - z-index: 10; -} - -.markdown-editor .input-annotations { - margin-left: .5rem; -} - -.markdown-editor .controls { - display: flex; - background-color: var(--background-color-softer); - margin-bottom: 1rem; - border-radius: 0.4rem; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - border-bottom: 1px solid var(--border-color-softer); -} - -.markdown-editor .controls .modes { - flex: 1 1 auto; - display: flex; - justify-content: flex-start; -} - -.markdown-editor .controls .actions { - display: flex; - flex: 0 1 auto; - justify-content: flex-end; -} - -.markdown-editor .controls .button { - border: 0; - border-radius: 0.4rem; - border-bottom: 0; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - background: var(--background-color-softer); - color: var(--text-color-softer); - /* margin-right: 0.5rem; */ - font-weight: normal; - cursor: pointer; - text-transform: none; - margin-bottom: 0; - font-size: .9em; - position: relative; - padding: 0 20px; -} - -.markdown-editor .controls .button:hover { - color: var(--text-color-normal); -} - -.markdown-editor .controls .button.active { - background: var(--background-color); - border-left: 1px solid var(--border-color-softer); - border-right: 1px solid var(--border-color-softer); - color: var(--text-color-normal); - cursor: default; -} - -.markdown-editor .controls .button.active::after { - content: " "; - background: var(--background-color); - width: 100%; - height: 1px; - position: absolute; - left: 0; - bottom: -1px; -} - -.markdown-editor .controls .button:first-child { - border-left: 0; -} - -.markdown-editor .actions { - display: flex; - justify-content: flex-end; - background-color: var(--background-color-softer); - margin-right: 1em; - margin-top: 5px; -} - -.markdown-editor .actions .divider { - border-left: 1px solid var(--border-color); - bottom: 50%; - float: left; - top: calc(50% + -2px); - margin: 0 10px; - height: 24px; - transform: translateY(-50%); - position: relative; - overflow: hidden; - background: transparent; -} - -.markdown-editor .actions .button { - border-radius: 0.4em; - padding: 0 10px; - height: 30px; - line-height: 30px; - width: 35px; -} - -.markdown-editor .actions .button:hover { - background-color: var(--border-color-softer); -} - -.markdown-editor .wrapper { - position: relative; -} - -.markdown-editor .wrapper .preview { - display: none; - padding: 1rem; - margin: 0 .5rem; - margin-bottom: 1.5rem; - min-height: 10rem; - width: calc(100% + -3rem); -} - -.markdown-editor[data-mode="preview"] .preview { - display: block; -} -.markdown-editor[data-mode="preview"] .editor { - display: none; -} - .slide-overlay { height: 100%; background-color: #000; diff --git a/internal/views/styles/forms.scss b/internal/views/styles/forms.scss new file mode 100644 index 0000000..4cf5740 --- /dev/null +++ b/internal/views/styles/forms.scss @@ -0,0 +1,244 @@ +textarea { + padding: 1rem; + margin-bottom: 1.5rem; + min-height: 10rem; + resize: vertical; + z-index: 10; + width: 100%; +} + +.markdown-editor { + border: 1px solid var(--border-color-softer); + border-radius: 0.4rem; + + .editor { + padding: 1rem; + margin: 0 .5rem; + margin-bottom: 1.5rem; + min-height: 10rem; + width: calc(100% - 1rem); + resize: vertical; + z-index: 10; + } + + .input-annotations { + margin-left: .5rem; + } + + .controls { + display: flex; + background-color: var(--background-color-softer); + margin-bottom: 1rem; + border-radius: 0.4rem; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + border-bottom: 1px solid var(--border-color-softer); + + .modes { + flex: 1 1 auto; + display: flex; + justify-content: flex-start; + + .button:first-child { + border-left: 0; + } + } + + .actions { + display: flex; + flex: 0 1 auto; + justify-content: flex-end; + } + + .button { + border: 0; + border-radius: 0.4rem; + border-bottom: 0; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + background: var(--background-color-softer); + color: var(--text-color-softer); + font-weight: normal; + cursor: pointer; + text-transform: none; + margin-bottom: 0; + font-size: .9em; + position: relative; + padding: 0 20px; + + + + &:hover { + color: var(--text-color-normal); + } + + &.active { + background: var(--background-color); + border-left: 1px solid var(--border-color-softer); + border-right: 1px solid var(--border-color-softer); + color: var(--text-color-normal); + cursor: default; + + &::after { + content: " "; + background: var(--background-color); + width: 100%; + height: 1px; + position: absolute; + left: 0; + bottom: -1px; + } + + } + + } + } + + .actions { + display: flex; + justify-content: flex-end; + background-color: var(--background-color-softer); + margin-right: 1em; + margin-top: 5px; + + .divider { + border-left: 1px solid var(--border-color); + bottom: 50%; + float: left; + top: calc(50% + -2px); + margin: 0 10px; + height: 24px; + transform: translateY(-50%); + position: relative; + overflow: hidden; + background: transparent; + } + + .button { + border-radius: 0.4em; + padding: 0 10px; + height: 30px; + line-height: 30px; + width: 35px; + + &:hover { + background-color: var(--border-color-softer); + } + } + + } + + + .wrapper { + position: relative; + + .preview { + display: none; + padding: 1rem; + margin: 0 .5rem; + margin-bottom: 1.5rem; + min-height: 10rem; + width: calc(100% + -3rem); + } + } + + &[data-mode="preview"] .preview { + display: block; + } + &[data-mode="preview"] .editor { + display: none; + } +} + + +fieldset { + margin-bottom: 3rem; + + legend { + border-bottom: 1px solid var(--border-color-softer); + width: 100%; + padding: 0.5rem; + margin-bottom: 1rem; + font-weight: 400; + font-size: 1.1em; + } + + .input-annotations { + margin-left: .5rem; + margin-bottom: 2rem; + } + + .checkbox-option, + .radio-option { + display: grid; + grid-template: + "input label" + ". annotations"; + grid-column-gap: 1rem; + grid-template-columns: 1em 1fr; + margin-left: 1rem; + margin-bottom: 1rem; + + label { + grid-area: label; + font-weight: 400; + align-self: start; + margin-bottom: 0; + } + + input { + grid-area: input; + margin-bottom: 0; + margin-right: 0.5rem; + border: 0; + width: 100%; + align-self: start; + margin-top: 0.3em; + } + + .help-text { + grid-area: annotations; + font-size: 0.9em; + align-self: start; + } + } + + label { + + + } +} + +.button-group.submit { + position: relative; + + .loader { + width: 16px; + height: 16px; + border-radius: 50%; + color: var(--button-primary-color); + animation: fill 1s ease-in infinite alternate; + display: inline-block; + top: calc(50% - 17px); + position: absolute; + left: calc(50% - 10px); + + &::before, &::after { + content: ''; + position: absolute; + height: 100%; + width: 100%; + border-radius: 50%; + left: 28px; + top: 0; + animation: fill 0.9s ease-in infinite alternate; + } + + &::after { + left: auto; + right: 28px; + animation-duration: 1.1s; + } + } + +} diff --git a/internal/views/styles/markdown.scss b/internal/views/styles/markdown.scss new file mode 100644 index 0000000..5b3d93f --- /dev/null +++ b/internal/views/styles/markdown.scss @@ -0,0 +1,45 @@ +.markdown-body { + h1 { + font-size: 2em; + padding-bottom: 0.3em; + border-bottom: 1px solid var(--border-color-softer); + } + + h2 { + margin-top: 1em; + font-size: 1.7em; + border-bottom: 1px solid var(--border-color-softer); + } + + h3 { + margin-top: .8em; + font-size: 1.4em; + font-weight: bold; + letter-spacing: 0; + } + + h4, h5, h6 { + margin-top: .4em; + font-variant: small-caps; + font-size: 1.2em; + letter-spacing: 0.07em; + } + + blockquote { + margin: 1em 0; + padding: 0.5em 1em; + position: relative; + + &::before { + content: ''; + width: 3px; + height: 100%; + background: var(--accent-color); + border-radius: 0.4em; + top: 0; + left: 0; + position: absolute; + + } + } +} diff --git a/internal/views/styles/navigation.scss b/internal/views/styles/navigation.scss new file mode 100644 index 0000000..e5af753 --- /dev/null +++ b/internal/views/styles/navigation.scss @@ -0,0 +1,60 @@ +.nav.sidebar { + ul { + list-style-type: none; + padding: 1rem 0; + margin-bottom: 0; + font-size: 1.5rem; + + a { + color: var(--text-color-softer); + text-decoration: none; + display: inline-block; + width: 100%; + + &.active { + font-weight: bold; + position: relative; + + &::before { + content: ''; + width: 3px; + height: 100%; + background: var(--accent-color); + border-radius: 0.4em; + top: 0; + left: 0; + position: absolute; + } + } + + i { + margin-right: 0.5em; + margin-left: 0.5em; + } + } + + li { + padding: 0.75rem 0.5rem; + border-radius: 0.3em; + margin-bottom: 0; + + &:hover { + background-color: var(--background-color-softer); + } + } + + } + + .section { + h2 { + font-size: 1.1em; + letter-spacing: 0.1rem; + border-top: 1px solid var(--border-color-softer); + padding-top: 1.4em; + margin-bottom: 0; + font-weight: 600; + padding-left: .7em; + font-variant: small-caps; + } + } +} diff --git a/internal/views/styles/profile.scss b/internal/views/styles/profile.scss new file mode 100644 index 0000000..78d4fb7 --- /dev/null +++ b/internal/views/styles/profile.scss @@ -0,0 +1,242 @@ +.profile-card { + display: grid; + grid-template-rows: auto; + grid-template-areas: + "avatar" + "name" + "callsign" + "actions"; + justify-content: left; + + .avatar { + border-radius: 50%; + border: 2px solid var(--border-color-softer); + grid-area: avatar; + justify-self: center; + margin-bottom: 1em; + + &:hover { + border-color: var(--border-color); + + } + } + + .name { + grid-area: name; + font-size: 3.5rem; + } + + .callsign { + grid-area: callsign; + font-family: monospace, monospace; + font-size: 2.8rem; + color: var(--text-color-softer); + + + } + + .actions { + grid-area: actions; + } + + ul { + list-style-type: none; + padding: 0; + margin-top: 1.5em; + font-size: 1.5rem; + + i { + margin-right: 0.5em; + color: var(--border-color); + width: 1.25em; + display: inline-block; + } + } +} + +.profile-contents { + + h3 { + font-size: 2rem; + letter-spacing: 0; + font-weight: 400; + padding-left: 0.2em; + border-bottom: 1px solid var(--border-color-softer); + } + + .profile-section { + margin-bottom: 2em; + } + +} + +.activity-graph { + .activity-graph-body { + display: grid; + grid-template-areas: + ". months" + "weekdays days" + ". legend"; + grid-template-columns: 3em 1fr; + grid-template-rows: 2em 1fr; + + border: 1px solid var(--border-color-softer); + border-radius: 0.4em; + padding: 1em; + + + ol { + list-style-type: none; + + + &.title.months { + grid-area: months; + + display: grid; + grid-template-columns: repeat(12, 1fr); + justify-items: center; + + li { + justify-self: left; + padding-left: 3px; + margin: 0; + } + } + + &.title.weekdays { + grid-area: weekdays; + + display: grid; + grid-template-rows: repeat(3, 1fr); + grid-auto-flow: row; + grid-row-gap: 10px; + justify-items: center; + position: relative; + top: 14px; + + font-size: 0.9em; + + li { + margin: 0; + } + + } + } + + .days { + grid-area: days; + + display: grid; + grid-template-columns: repeat(53, 1fr); + grid-template-rows: repeat(7, 1fr); + grid-column-gap: 1px; + grid-row-gap: 3px; + border-radius: 2px; + grid-auto-flow: column; + } + + .legend { + grid-area: legend; + display: grid; + grid-template-columns: 3em repeat(5, 12px) 3em; + grid-auto-flow: column; + font-size: 0.8em; + color: #999; + justify-content: right; + position: relative; + margin-top: 1em; + grid-column-gap: 4px; + + span { + position: relative; + top: -0.3em; + padding-left: 0.3em; + } + } + + .day { + border: 1px solid var(--border-color-softer); + background: var(--background-color-softer); + height: 10px; + width: 10px; + justify-self: center; + border-radius: 2px; + + &.skip-1 { grid-row-start: 2 } + &.skip-2 { grid-row-start: 3 } + &.skip-3 { grid-row-start: 4 } + &.skip-4 { grid-row-start: 5 } + &.skip-5 { grid-row-start: 6 } + &.skip-6 { grid-row-start: 7 } + + &.activity-0 { background: var(--background-color-softer) } + &.activity-1 { background: hsl(194, 86%, 57%); border-color: hsl(194, 86%, 57%) } + &.activity-2 { background: hsl(194, 86%, 47%); border-color: hsl(194, 86%, 47%) } + &.activity-3 { background: hsl(194, 86%, 37%); border-color: hsl(194, 86%, 37%) } + &.activity-4 { background: hsl(194, 86%, 27%); border-color: hsl(194, 86%, 27%) } + + &:hover { + border-color: #000; + } + + } + } +} + +header.profile-settings { + display: grid; + position: relative; + + grid-template-areas: + "avatar name" + "avatar desc"; + grid-template-columns: 50px 1fr; + grid-row-gap: 0.1em; + + .avatar { + grid-area: avatar; + grid-column: 1 / span 2; + border-radius: 50%; + border: 1px solid var(--border-color-softer); + overflow: hidden; + display: inline-block; + margin-right: 1rem; + position: relative; + top: calc(50% + -25px); + + } + + .account-name { + grid-area: name; + font-size: 1.4em; + font-weight: bold; + margin-bottom: 0; + margin-top: 1em; + line-height: 1.5em; + letter-spacing: 0.04em; + + } + + .context { + grid-area: desc; + font-size: 1em; + color: var(--text-color-softer); + } + +} +.flash-message { + color: #155724; + background-color: #d4edda; + border: 2px solid #c3e6cb; + border-radius: 0.4em; + padding: 0.6em 1em; + margin-bottom: 1em; + font-size: 1.1em; + + p { + vertical-align: middle; + display: inline; + + } +} + diff --git a/main.go b/main.go index 092cbf9..1d0d894 100644 --- a/main.go +++ b/main.go @@ -1,62 +1,27 @@ package main import ( - "io/fs" - "path/filepath" - "strings" - + "dario.cat/mergo" "github.com/davecgh/go-spew/spew" + "github.com/ryanfaerman/netctl/internal/models" + "github.com/ryanfaerman/netctl/internal/services" ) -type asset struct { - kind string - path string - name string - minified bool +func show(s models.Settings) { + spew.Dump(s) } func main() { - var assets []asset - - root := "internal/views/" - filepath.WalkDir("./"+root, func(path string, d fs.DirEntry, err error) error { - switch filepath.Ext(path) { - case ".scss": - if strings.HasPrefix(d.Name(), "_") { - assets = append(assets, asset{ - kind: "scss", - path: path, - name: filepath.Join(strings.TrimPrefix(filepath.Dir(path), root), strings.TrimPrefix(d.Name(), "_")), - minified: strings.HasSuffix(d.Name(), ".min.scss"), - }) - } - case ".js": - assets = append(assets, asset{ - kind: "js", - path: path, - name: filepath.Join(strings.TrimPrefix(filepath.Dir(path), root), d.Name()), - minified: strings.HasSuffix(d.Name(), ".min.js"), - }) - case ".templ", ".go", ".md", ".css": - return nil + s := &models.PrivacySettings{ + Location: "PROTECTED", + } + if err := mergo.Merge(s, s.Defaults()); err != nil { + panic(err.Error()) + } - default: - if d.IsDir() { - return nil - } - ext := filepath.Ext(path) - if d.Name() == ext { - return nil - } - assets = append(assets, asset{ - kind: strings.TrimPrefix(ext, "."), - path: path, - name: filepath.Join(strings.TrimPrefix(filepath.Dir(path), root), d.Name()), - minified: strings.HasSuffix(d.Name(), ".min"+ext), - }) - } - return nil - }) + if err := services.Validation.Apply(s); err != nil { + spew.Dump(err) + } - spew.Dump(assets) + show(models.Settings(s)) }