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
36 lines
1.1 KiB
Plaintext
36 lines
1.1 KiB
Plaintext
package pages
|
|
|
|
import (
|
|
"git.ekzyis.com/ekzyis/delphi.market/server/router/pages/components"
|
|
"git.ekzyis.com/ekzyis/delphi.market/types"
|
|
"github.com/dustin/go-humanize"
|
|
)
|
|
|
|
// TODO: Add countdown? Use or at least show somewhere precise timestamps?
|
|
|
|
templ Market(m types.Market) {
|
|
<html>
|
|
@components.Head()
|
|
<body class="container">
|
|
@components.Nav()
|
|
<div id="content" class="flex flex-col">
|
|
<small>
|
|
@components.Figlet("random", "market")
|
|
</small>
|
|
<div class="text-center font-bold my-1">{ m.Question }</div>
|
|
<div class="text-center text-muted my-1">{humanize.Time(m.EndDate)}</div>
|
|
<div class="text-center text-muted my-1"></div>
|
|
<blockquote cite="ekzyis" class="p-4 mb-4 border-s-4 border-muted">
|
|
{ m.Description }
|
|
<div class="text-muted text-right pt-4">― {m.User.Name}, { humanize.Time(m.CreatedAt) }</div>
|
|
</blockquote>
|
|
<div class="flex justify-center my-1">
|
|
<button class="neon success mx-1">BET YES</button>
|
|
<button class="neon error mx-1">BET NO</button>
|
|
</div>
|
|
</div>
|
|
@components.Modal(nil)
|
|
@components.Footer()
|
|
</body>
|
|
</html>
|
|
} |