ekzyis
845157c954
* market form with question, description and end date * markets cost 1k sats * a goroutine polls pending invoices from the db and checks LND for their status * markets are listed on front page (after paid) * market page contains buttons to bet yes or no * users have names now TODO: * show correct market percentage * show how percentage changed over time in chart * validate end date * implement betting / order form
40 lines
1019 B
Plaintext
40 lines
1019 B
Plaintext
package pages
|
|
|
|
import (
|
|
"git.ekzyis.com/ekzyis/delphi.market/server/router/pages/components"
|
|
"git.ekzyis.com/ekzyis/delphi.market/types"
|
|
"strconv"
|
|
"time"
|
|
)
|
|
|
|
templ User(user *types.User) {
|
|
<html>
|
|
@components.Head()
|
|
<body class="container">
|
|
@components.Nav()
|
|
<div id="content" class="flex flex-col">
|
|
@components.Figlet("random", "user")
|
|
<div
|
|
class="grid grid-cols-2 gap-4 my-3 mx-auto"
|
|
hx-target="#content"
|
|
hx-swap="outerHTML"
|
|
hx-select="#content"
|
|
hx-push-url="true"
|
|
hx-select-oob="#nav"
|
|
>
|
|
<div class="font-bold">id</div>
|
|
<div>{ strconv.Itoa(user.Id) }</div>
|
|
<div class="font-bold">name</div>
|
|
<div>{ user.Name }</div>
|
|
<div class="font-bold">joined</div>
|
|
<div>{ user.CreatedAt.Format(time.DateOnly) }</div>
|
|
<div class="font-bold">sats</div>
|
|
<div>{ strconv.Itoa(int(user.Msats) / 1000) }</div>
|
|
<button hx-post="/logout" class="col-span-2">logout</button>
|
|
</div>
|
|
</div>
|
|
@components.Footer()
|
|
</body>
|
|
</html>
|
|
}
|