Compare commits

..

No commits in common. "0845a636b4af447a8bf9efd8ef82bd8e0d2e94d7" and "8c978c5d30e04736ee388b2ca135f6242a0cc4ca" have entirely different histories.

5 changed files with 9 additions and 6 deletions

View File

@ -15,7 +15,7 @@ services:
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql
- ./db/schema.sql:/docker-entrypoint-initdb.d/schema.sql
# for some reason this can't be mounted on first run
- ./db/postgresql.conf:/etc/postgresql/data/postgresql.conf
- ./db/postgresql.conf:/var/lib/postgresql/data/postgresql.conf
volumes:
delphi:

View File

@ -20,7 +20,7 @@ import (
"github.com/lightningnetwork/lnd/lnwire"
)
func HandleNew(sc context.Context) echo.HandlerFunc {
func HandleCreate(sc context.Context) echo.HandlerFunc {
return func(c echo.Context) error {
var (
db = sc.Db

View File

@ -13,8 +13,7 @@ templ Nav() {
hx-push-url="true"
>
<div>
<button hx-get="/">markets</button>
<button hx-get="/new">new</button>
<button hx-get="/">home</button>
</div>
<div class="ms-auto">
<button hx-get="/about">about</button>

View File

@ -25,6 +25,10 @@ templ Index(markets []types.Market) {
hx-select="#grid-container"
hx-push-url="true"
>
<div class="border border-muted">
<button hx-get="/" class={ tabStyle(ctx.Value(c.ReqPathContextKey).(string), "/") + " !py-1 !px-3" }>markets</button>
<button hx-get="/create" class={ tabStyle(ctx.Value(c.ReqPathContextKey).(string), "/create") + " !py-1 !px-3" }>create</button>
</div>
if ctx.Value(c.ReqPathContextKey).(string) == "/" {
<div class="grid grid-cols-[auto_fit-content(10%)_fit-content(10%)]">
for _, m := range markets {

View File

@ -14,8 +14,8 @@ func Init(e *echo.Echo, sc Context) {
e.Use(middleware.Session(sc))
e.GET("/", handler.HandleIndex(sc))
e.GET("/new", handler.HandleIndex(sc))
e.POST("/new", handler.HandleNew(sc), middleware.SessionGuard(sc))
e.GET("/create", handler.HandleIndex(sc))
e.POST("/create", handler.HandleCreate(sc), middleware.SessionGuard(sc))
e.GET("/market/:id", handler.HandleMarket(sc))
e.POST("/market/:id/order", handler.HandleOrder(sc), middleware.SessionGuard(sc))
e.GET("/about", handler.HandleAbout(sc))