diff --git a/web/static/index.css b/web/static/index.css index e9e9af6..1975ee3 100644 --- a/web/static/index.css +++ b/web/static/index.css @@ -51,9 +51,12 @@ body { width: 300px; } -.new-thread-btn { - display: block; +.new-thread-container { + width: max-content; margin: auto; +} + +#newThreadBtn { margin-top: 12px; background: none; border: none; @@ -64,10 +67,27 @@ body { cursor: pointer; } -.new-thread-btn:hover { +#newThreadBtn:hover { color: #ff0000 } +.new-thread-form-field {} + +.new-thread-form-field th { + border: 1px solid black; + text-align: left; + vertical-align: middle; + padding: 4px; + background: #98E; + font-weight: bold; + font-size: .8rem; +} + +.new-thread-form-field td { + display: block; + margin: 2px; +} + /* GENERAL LAYOUT */ .container { diff --git a/web/static/index.js b/web/static/index.js new file mode 100644 index 0000000..915304f --- /dev/null +++ b/web/static/index.js @@ -0,0 +1 @@ +const $ = (id) => document.getElementById(id); diff --git a/web/views/boards/comfy.templ b/web/views/boards/comfy.templ index f5994e7..25c7d96 100644 --- a/web/views/boards/comfy.templ +++ b/web/views/boards/comfy.templ @@ -2,6 +2,25 @@ package boards import "github.com/dominicf2001/comfychan/web/views/shared" +templ NewThreadForm() { + +} + templ Comfy() { @shared.Layout() {
@@ -11,6 +30,9 @@ templ Comfy() {

Be comfy fren

- +
+ + @NewThreadForm() +
} } diff --git a/web/views/boards/comfy_templ.go b/web/views/boards/comfy_templ.go index 6a4d35b..333b32a 100644 --- a/web/views/boards/comfy_templ.go +++ b/web/views/boards/comfy_templ.go @@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime" import "github.com/dominicf2001/comfychan/web/views/shared" -func Comfy() templ.Component { +func NewThreadForm() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { @@ -31,7 +31,36 @@ func Comfy() templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
Subject
Comment
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Comfy() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { @@ -43,13 +72,21 @@ func Comfy() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "

\"/comfy/\" - Comfy

Be comfy fren

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "

\"/comfy/\" - Comfy

Be comfy fren

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = NewThreadForm().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return nil }) - templ_7745c5c3_Err = shared.Layout().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = shared.Layout().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/web/views/shared/layout.templ b/web/views/shared/layout.templ index b2b6d3f..82da626 100644 --- a/web/views/shared/layout.templ +++ b/web/views/shared/layout.templ @@ -6,6 +6,7 @@ templ Layout() { Comfychan + diff --git a/web/views/shared/layout_templ.go b/web/views/shared/layout_templ.go index 58c6476..5c29408 100644 --- a/web/views/shared/layout_templ.go +++ b/web/views/shared/layout_templ.go @@ -29,7 +29,7 @@ func Layout() templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "Comfychan
[ index ] [ comfy / r9k ]
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "Comfychan
[ index ] [ comfy / r9k ]
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err }