Use collapsibles

This commit is contained in:
ekzyis 2023-09-09 22:52:51 +02:00
parent 76309c4153
commit c948d7babf
1 changed files with 73 additions and 69 deletions

View File

@ -40,8 +40,9 @@
</strong> </strong>
</code> </code>
<div class="font-mono mb-1">{{.Description}}</div> <div class="font-mono mb-1">{{.Description}}</div>
<div class="font-mono mb-1"><strong>Order Book</strong></div> <details open class="align-left">
<table class="mb-1"> <summary><span class="font-mono mb-1"><strong>Order Book</strong></span></summary>
<table class="w-100p mb-1">
<tr> <tr>
<th class="align-left">BUY YES</th> <th class="align-left">BUY YES</th>
<th class="align-center">SELL</th> <th class="align-center">SELL</th>
@ -79,10 +80,10 @@
{{ else }} {{ else }}
<td></td> <td></td>
{{ end }} {{ end }}
{{ if and (eq .ShareId $.NoShare.Id) (eq .Side "BUY") }} {{ if and (eq .ShareId $.YesShare.Id) (eq .Side "BUY") }}
<td> <td>
<div class="flex yes"> <div class="flex yes">
<span class="align-left">NO</span> <span class="align-left">YES</span>
<span style="width: 100%" class="align-right">{{.Quantity}} @ {{.Price}}</span> <span style="width: 100%" class="align-right">{{.Quantity}} @ {{.Price}}</span>
</div> </div>
</td> </td>
@ -92,8 +93,10 @@
</tr> </tr>
{{ end }} {{ end }}
</table> </table>
</details>
<hr /> <hr />
<div class="font-mono mb-1"><strong>Order Form</strong></div> <details open class="align-left">
<summary><span class="font-mono mb-1"><strong>Order Form</strong></span></summary>
<form id="form" class="order-form" hidden action="/api/market/{{$.Id}}/order" method="post"> <form id="form" class="order-form" hidden action="/api/market/{{$.Id}}/order" method="post">
<button id="buy" type="button" class="order-button yes w-100p selected">BUY</button> <button id="buy" type="button" class="order-button yes w-100p selected">BUY</button>
<button id="sell" type="button" class="order-button no w-100p">SELL</button> <button id="sell" type="button" class="order-button no w-100p">SELL</button>
@ -111,6 +114,7 @@
<label id="submit-label"></label> <label id="submit-label"></label>
<button type="submit">SUBMIT</button> <button type="submit">SUBMIT</button>
</form> </form>
</details>
</div> </div>
</body> </body>
<script src="/order.js"></script> <script src="/order.js"></script>