Skip to content

Commit

Permalink
Add postcard handlers and update artist page layout
Browse files Browse the repository at this point in the history
  • Loading branch information
blackfyre committed Oct 13, 2023
1 parent c947588 commit af51ca8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
7 changes: 2 additions & 5 deletions assets/views/pages/artist.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,8 @@ <h1 class="title">{{ .Title}}</h1>
</div>
</div>
<footer class="card-footer">
<p class="card-footer-item">
<span>
<a href="/artists/{{$.Slug}}/{{.Id}}">Learn More</a>
</span>
</p>
<a class="card-footer-item" href="/artists/{{$.Slug}}/{{.Id}}">Learn More</a>
<a href="#" class="card-footer-item">Send Postcard</a>
</footer>
<script type="application/ld+json">
{{marshalJSON .Jsonld}}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module blackfyre.ninja/wga
go 1.21.0

require (
github.com/grokify/html-strip-tags-go v0.0.1
github.com/joho/godotenv v1.5.1
github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61
github.com/pocketbase/dbx v1.10.1
Expand Down Expand Up @@ -46,7 +47,6 @@ require (
github.com/google/uuid v1.3.1 // indirect
github.com/google/wire v0.5.0 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/grokify/html-strip-tags-go v0.0.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
Expand Down
1 change: 1 addition & 0 deletions handlers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
func RegisterHandlers(app *pocketbase.PocketBase) {
registerArtist(app)
registerArtists(app)
registerPostcardHandlers(app)
registerStatic(app)
registerHome(app)
}
Expand Down
26 changes: 26 additions & 0 deletions handlers/postcard.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package handlers

import (
"github.com/labstack/echo/v5"
"github.com/pocketbase/pocketbase"
"github.com/pocketbase/pocketbase/core"
)

func registerPostcardHandlers(app *pocketbase.PocketBase) {
app.OnBeforeServe().Add(func(e *core.ServeEvent) error {

e.Router.GET("postcards", func(c echo.Context) error {
return nil
})

e.Router.GET("postcards/:id", func(c echo.Context) error {
return nil
})

e.Router.POST("postcards", func(c echo.Context) error {
return nil
})

return nil
})
}

0 comments on commit af51ca8

Please sign in to comment.