dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 876b0722e4fa10c4612f7065b1097714a3564d55
parent 7d8ba0be6e23760e8c3ae586a34e80bf5d78c544
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Tue, 12 Dec 2023 05:54:28 -0500

cleanup

Diffstat:
Mpkg/web/handlers/data.go | 3++-
Mpkg/web/handlers/handlers.go | 2++
Mpkg/web/public/views/pages/poker.gohtml | 3+++
3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/pkg/web/handlers/data.go b/pkg/web/handlers/data.go @@ -929,7 +929,8 @@ type chessData struct { } type pokerData struct { - Tables []database.PokerTable + Balance int64 + Tables []database.PokerTable } type powHelperData struct { diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go @@ -754,7 +754,9 @@ func BHCHandler(c echo.Context) error { func PokerHomeHandler(c echo.Context) error { db := c.Get("database").(*database.DkfDB) + authUser := c.Get("authUser").(*database.User) var data pokerData + data.Balance = int64(authUser.ChipsTest) data.Tables, _ = db.GetPokerTables() return c.Render(http.StatusOK, "poker", data) } diff --git a/pkg/web/public/views/pages/poker.gohtml b/pkg/web/public/views/pages/poker.gohtml @@ -2,6 +2,9 @@ {{ define "content" }} <div class="container"> + <div class="mb-3"> + Balance: {{ .Data.Balance }} chips + </div> <h3>Tables</h3> <table class="table table-novpadding table-sm table-hover table-striped"> <tr>