delphi.market/pages/binary_market.html

81 lines
3.4 KiB
HTML
Raw Normal View History

2023-09-09 20:52:50 +00:00
<!DOCTYPE html>
<html>
<head>
<title>delphi.market</title>
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" />
<link rel="stylesheet" href="/index.css" />
<link rel="stylesheet" href="/market.css" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#091833" />
2023-09-09 20:52:50 +00:00
{{ if eq .ENV "development" }}
<script defer src="/hotreload.js"></script>
{{ end }}
2023-09-09 20:52:50 +00:00
</head>
<body>
<header class="flex flex-row text-center justify-center pt-1">
<nav>
<a href="/">home</a>
{{ if .session }}
<form action='/logout' method='post'>
<button type='submit'>logout</button>
</form>
{{ else }} <a href="/login">login</a> {{ end }}
</nav>
</header>
<div class="container flex flex-column text-center">
<code>
<strong>
<pre>
_ _
_ __ ___ __ _ _ __| | _____| |_
| '_ ` _ \ / _` | '__| |/ / _ \ __|
| | | | | | (_| | | | < __/ |_
|_| |_| |_|\__,_|_| |_|\_\___|\__|</pre>
</strong>
</code>
<div class="font-mono mb-1">{{.Description}}</div>
<div class="flex flex-row justify-center mb-1">
{{ range .Shares }} {{ if eq .Description "YES" }}
2023-09-09 20:52:50 +00:00
<button id="yes-order" class="order-button sx-1 yes">YES</button>
{{ else }}
<button id="no-order" class="order-button sx-1 no">NO</button>
{{ end }}
{{ end }}
</div>
{{ range .Shares }} {{ if eq .Description "YES" }}
2023-09-09 20:52:50 +00:00
<form id="yes-form" class="order-form" hidden action="/api/market/{{$.Id}}/order" method="post">
<button id="yes-buy" type="button" class="order-button yes w-100p selected">BUY</button>
<button id="yes-sell" type="button" class="order-button no w-100p">SELL</button>
<input hidden name="share_id" value="{{.Id}}" />
2023-09-09 20:52:50 +00:00
<input id="yes-side" hidden name="side" value="BUY" />
<label>shares</label>
<input id="yes-quantity" type="number" name="quantity" placeholder="quantity" />
<label id="yes-cost-label">cost [sats]</label>
<input id="yes-cost" type="number" name="cost" disabled />
<label id="yes-submit-label">BUY YES shares</label>
2023-09-09 20:52:50 +00:00
<button type="submit">SUBMIT</button>
</form>
{{ else }}
<form id="no-form" class="order-form" hidden action="/api/market/{{$.Id}}/order" method="post">
<button id="no-buy" type="button" class="order-button yes w-100p selected">BUY</button>
<button id="no-sell" type="button" class="order-button no w-100p">SELL</button>
<input hidden name="share_id" value="{{.Id}}" />
2023-09-09 20:52:50 +00:00
<input id="no-side" hidden name="side" value="BUY" />
<label>shares</label>
<input id="no-quantity" type="number" name="quantity" placeholder="quantity" />
<label id="no-cost-label">cost [sats]</label>
<input id="no-cost" type="number" name="cost" disabled />
<label id="no-submit-label">BUY NO shares</label>
2023-09-09 20:52:50 +00:00
<button type="submit">SUBMIT</button>
</form>
{{ end }}
{{ end }}
</div>
</body>
2023-09-09 20:52:50 +00:00
<script src="/market.js"></script>
2023-09-09 20:52:50 +00:00
</html>