vspd/internal/webapi/templates/ticket-search-result.html
2023-09-13 09:03:05 +01:00

215 lines
7.3 KiB
HTML

{{ define "ticket-search-result" }}
{{ if .Found }}
<h1>Ticket</h1>
<table id="ticket-table" class="mt-2 mb-4 w-100">
<tr>
<th>Hash</th>
<td>
<a href="{{ txURL .Ticket.Hash }}">
{{ .Ticket.Hash }}
</a>
</td>
</tr>
<tr>
<th>Status</th>
{{ if .Ticket.Confirmed }}
<td>
Confirmed (purchase height:
<a href="{{ blockURL .Ticket.PurchaseHeight }}">{{ .Ticket.PurchaseHeight }}</a>)
</td>
{{ else }}
<td>Not confirmed</td>
{{ end }}
</tr>
<tr>
<th>Ticket Outcome</th>
<td>{{ .Ticket.Outcome }}</td>
</tr>
<tr>
<th>Voting WIF</th>
<td>{{ .Ticket.VotingWIF }}</td>
</tr>
<tr>
<th>Commitment Address</th>
<td>
<a href="{{ addressURL .Ticket.CommitmentAddress }}">
{{ .Ticket.CommitmentAddress }}
</a>
</td>
</tr>
</table>
<h1>Fee</h1>
<table id="ticket-table" class="mt-2 mb-4 w-100">
<tr>
<th>Fee Address</th>
<td>
<a href="{{ addressURL .Ticket.FeeAddress }}">
{{ .Ticket.FeeAddress }}
</a>
</td>
</tr>
<tr>
<th>Fee Address Index</th>
<td>{{ .Ticket.FeeAddressIndex }}</td>
</tr>
<tr>
<th>Fee Amount</th>
<td>{{ atomsToDCR .Ticket.FeeAmount }}</td>
</tr>
<tr>
<th>Fee Expiration</th>
<td>{{ .Ticket.FeeExpiration }} ({{ dateTime .Ticket.FeeExpiration }}) </td>
</tr>
<tr>
<th>Fee Tx Hash</th>
<td>
<a href="{{ txURL .Ticket.FeeTxHash }}">
{{ .Ticket.FeeTxHash }}
</a>
</td>
</tr>
<tr>
<th>Fee Tx</th>
<td>
{{ if .Ticket.FeeTxHex }}
<details>
<summary>Raw Bytes</summary>
<div class="small-text">
{{ .Ticket.FeeTxHex }}
</div>
</details>
<details>
<summary>Decoded</summary>
<div class="small-text">
<pre>{{ indentJSON .FeeTxDecoded }}</pre>
</div>
</details>
{{ end }}
</td>
</tr>
<tr>
<th>Fee Tx Status</th>
<td>{{ .Ticket.FeeTxStatus }}</td>
</tr>
</table>
<h1>Vote Choices</h1>
<table id="ticket-table" class="mt-2 mb-4 w-100">
<tr>
<th>Consensus Vote Choices</th>
<td>
{{ range $key, $value := .Ticket.VoteChoices }}
{{ $key }}: {{ $value }} <br />
{{ end }}
</td>
</tr>
<tr>
<th>TSpend Policy</th>
<td>
{{ range $key, $value := .Ticket.TSpendPolicy }}
{{ $key }}: {{ $value }} <br />
{{ end }}
</td>
</tr>
<tr>
<th>Treasury Policy</th>
<td>
{{ range $key, $value := .Ticket.TreasuryPolicy }}
{{ $key }}: {{ $value }} <br />
{{ end }}
</td>
</tr>
<tr>
<th>
Vote Choice Changes<br />
<em>({{ .MaxVoteChanges }} most recent)</em>
</th>
<td>
{{ range $key, $value := .VoteChanges }}
<details>
<summary>
{{ if eq $key 0}}
Initial choices
{{ else }}
Change {{ $key }}
{{ end }}
</summary>
<table class="my-2">
<tr>
<th>Request</th>
<td><pre>{{ indentJSON $value.Request }}</pre></td>
</tr>
<tr>
<th>Request<br />Signature</th>
<td>{{ $value.RequestSignature }}</td>
</tr>
<tr>
<th>Response</th>
<td><pre>{{ indentJSON $value.Response }}</pre></td>
</tr>
<tr>
<th>Response<br />Signature</th>
<td>{{ $value.ResponseSignature }}</td>
</tr>
</table>
</details>
{{end}}
</td>
</tr>
</table>
<h1>Alternate Signing Address</h1>
<table id="ticket-table" class="mt-2 mb-4 w-100">
<tr>
<th>Alternate Signing Address</th>
<td>
{{if .AltSignAddrData}}
<a href="{{ addressURL .AltSignAddrData.AltSignAddr }}">
{{ .AltSignAddrData.AltSignAddr }}
</a>
{{end}}
</td>
</tr>
<tr>
<th>
AltSignAddress Change
</th>
<td>
{{if .AltSignAddrData}}
<details>
<table class="my-2">
<tr>
<th>Request</th>
<td><pre>{{ indentJSON .AltSignAddrData.Req }}</pre></td>
</tr>
<tr>
<th>Request<br />Signature</th>
<td>{{ .AltSignAddrData.ReqSig }}</td>
</tr>
<tr>
<th>Response</th>
<td><pre>{{ indentJSON .AltSignAddrData.Resp }}</pre></td>
</tr>
<tr>
<th>Response<br />Signature</th>
<td>{{ .AltSignAddrData.RespSig }}</td>
</tr>
</table>
</details>
{{end}}
</td>
</tr>
</table>
{{ else }}
<p>No ticket found with hash <span class="code">{{ .Hash }}</span></p>
{{ end }}
{{ end }}