|
|
@ -11,8 +11,6 @@ import "io"
|
|
|
|
import "bytes"
|
|
|
|
import "bytes"
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"strconv"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"git.grosinger.net/tgrosinger/saasitone/pkg/funcmap"
|
|
|
|
"git.grosinger.net/tgrosinger/saasitone/pkg/funcmap"
|
|
|
|
"git.grosinger.net/tgrosinger/saasitone/pkg/page"
|
|
|
|
"git.grosinger.net/tgrosinger/saasitone/pkg/page"
|
|
|
|
"git.grosinger.net/tgrosinger/saasitone/pkg/services"
|
|
|
|
"git.grosinger.net/tgrosinger/saasitone/pkg/services"
|
|
|
@ -49,7 +47,7 @@ func Home(p page.Page, posts []services.Post) templ.Component {
|
|
|
|
var templ_7745c5c3_Var2 string
|
|
|
|
var templ_7745c5c3_Var2 string
|
|
|
|
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(funcmap.File("gopher.png"))
|
|
|
|
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(funcmap.File("gopher.png"))
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templ/pages/home.templ`, Line: 20, Col: 43}
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templ/pages/home.templ`, Line: 18, Col: 43}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
@ -62,7 +60,7 @@ func Home(p page.Page, posts []services.Post) templ.Component {
|
|
|
|
var templ_7745c5c3_Var3 string
|
|
|
|
var templ_7745c5c3_Var3 string
|
|
|
|
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(post.Title)
|
|
|
|
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(post.Title)
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templ/pages/home.templ`, Line: 26, Col: 27}
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templ/pages/home.templ`, Line: 24, Col: 27}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
@ -75,7 +73,7 @@ func Home(p page.Page, posts []services.Post) templ.Component {
|
|
|
|
var templ_7745c5c3_Var4 string
|
|
|
|
var templ_7745c5c3_Var4 string
|
|
|
|
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(post.Body)
|
|
|
|
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(post.Body)
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templ/pages/home.templ`, Line: 28, Col: 18}
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templ/pages/home.templ`, Line: 26, Col: 18}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
@ -91,39 +89,13 @@ func Home(p page.Page, posts []services.Post) templ.Component {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if !p.Pager.IsBeginning() {
|
|
|
|
if !p.Pager.IsBeginning() {
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<p class=\"control\"><button class=\"button is-primary\" hx-swap=\"outerHTML\" hx-get=\"")
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<p class=\"control\"><button class=\"button is-primary\" hx-swap=\"outerHTML\" hx-get=\"/?page={{sub $.Pager.Page 1}}\" hx-target=\"#posts\">Previous page</button></p>")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var templ_7745c5c3_Var5 string
|
|
|
|
|
|
|
|
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs("/?page=" + strconv.Itoa(p.Pager.Page-1))
|
|
|
|
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templ/pages/home.templ`, Line: 37, Col: 108}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
|
|
|
|
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"#posts\">Previous page</button></p>")
|
|
|
|
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if !p.Pager.IsEnd() {
|
|
|
|
if !p.Pager.IsEnd() {
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<p class=\"control\"><button class=\"button is-primary\" hx-swap=\"outerHTML\" hx-get=\"")
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<p class=\"control\"><button class=\"button is-primary\" hx-swap=\"outerHTML\" hx-get=\"/?page={{add $.Pager.Page 1}}\" hx-target=\"#posts\">Next page</button></p>")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var templ_7745c5c3_Var6 string
|
|
|
|
|
|
|
|
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs("/?page=" + strconv.Itoa(p.Pager.Page+1))
|
|
|
|
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templ/pages/home.templ`, Line: 42, Col: 108}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
|
|
|
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"#posts\">Next page</button></p>")
|
|
|
|
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -153,9 +125,9 @@ func topContent(p page.Page) templ.Component {
|
|
|
|
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
|
|
|
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ctx = templ.InitializeContext(ctx)
|
|
|
|
ctx = templ.InitializeContext(ctx)
|
|
|
|
templ_7745c5c3_Var7 := templ.GetChildren(ctx)
|
|
|
|
templ_7745c5c3_Var5 := templ.GetChildren(ctx)
|
|
|
|
if templ_7745c5c3_Var7 == nil {
|
|
|
|
if templ_7745c5c3_Var5 == nil {
|
|
|
|
templ_7745c5c3_Var7 = templ.NopComponent
|
|
|
|
templ_7745c5c3_Var5 = templ.NopComponent
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ctx = templ.ClearChildren(ctx)
|
|
|
|
ctx = templ.ClearChildren(ctx)
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<section class=\"hero is-info welcome is-small\"><div class=\"hero-body\"><div class=\"container\"><h1 class=\"title\">")
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<section class=\"hero is-info welcome is-small\"><div class=\"hero-body\"><div class=\"container\"><h1 class=\"title\">")
|
|
|
@ -167,12 +139,12 @@ func topContent(p page.Page) templ.Component {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var templ_7745c5c3_Var8 string
|
|
|
|
var templ_7745c5c3_Var6 string
|
|
|
|
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(p.AuthUser.Name)
|
|
|
|
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(p.AuthUser.Name)
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templ/pages/home.templ`, Line: 58, Col: 30}
|
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templ/pages/home.templ`, Line: 56, Col: 30}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -216,9 +188,9 @@ func fileMsg(p page.Page) templ.Component {
|
|
|
|
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
|
|
|
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ctx = templ.InitializeContext(ctx)
|
|
|
|
ctx = templ.InitializeContext(ctx)
|
|
|
|
templ_7745c5c3_Var9 := templ.GetChildren(ctx)
|
|
|
|
templ_7745c5c3_Var7 := templ.GetChildren(ctx)
|
|
|
|
if templ_7745c5c3_Var9 == nil {
|
|
|
|
if templ_7745c5c3_Var7 == nil {
|
|
|
|
templ_7745c5c3_Var9 = templ.NopComponent
|
|
|
|
templ_7745c5c3_Var7 = templ.NopComponent
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ctx = templ.ClearChildren(ctx)
|
|
|
|
ctx = templ.ClearChildren(ctx)
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"block\"></div><article class=\"message is-small is-warning\" x-data=\"{show: true}\" x-show=\"show\"><div class=\"message-header\"><p>Serving files</p><button class=\"delete is-small\" aria-label=\"delete\" @click=\"show = false\"></button></div><div class=\"message-body\">In the example posts above, check how the file URL contains a cache-buster query parameter which changes only when the app is restarted. Static files also contain cache-control headers which are configured via middleware. You can also use AlpineJS to dismiss this message.</div></article>")
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"block\"></div><article class=\"message is-small is-warning\" x-data=\"{show: true}\" x-show=\"show\"><div class=\"message-header\"><p>Serving files</p><button class=\"delete is-small\" aria-label=\"delete\" @click=\"show = false\"></button></div><div class=\"message-body\">In the example posts above, check how the file URL contains a cache-buster query parameter which changes only when the app is restarted. Static files also contain cache-control headers which are configured via middleware. You can also use AlpineJS to dismiss this message.</div></article>")
|
|
|
|