|
4 | 4 |
|
5 | 5 | {{template "html-head" printf "Decred Address %s" .Data.Address}}
|
6 | 6 | {{template "navbar" . }}
|
7 |
| - {{with .Data}} |
8 |
| - {{$TxnCount := add .TxnCount .NumUnconfirmed}} |
9 |
| - {{$txType := .TxnType}} |
| 7 | + {{- with .Data}} |
| 8 | + {{- $TxnCount := add .TxnCount .NumUnconfirmed}} |
| 9 | + {{- $txType := .TxnType -}} |
10 | 10 | <div class="container main"
|
11 | 11 | data-controller="address newblock"
|
12 | 12 | data-address-offset="{{.Offset}}"
|
|
16 | 16 | >
|
17 | 17 | <div class="row pb-4 px-2">
|
18 | 18 | <div class="col-24 col-xl-10 bg-white px-3 py-3 position-relative">
|
19 |
| - {{if eq .Address $.DevAddress}} |
| 19 | + {{- if eq .Address $.DevAddress}} |
20 | 20 | <div class="fs22 pb-3">Decred Treasury</div>
|
21 |
| - {{else}} |
| 21 | + {{- else}} |
22 | 22 | <div class="fs22 pb-3">Address</div>
|
23 |
| - {{end}} |
| 23 | + {{- end}} |
24 | 24 | <div class="text-left d-flex align-items-start flex-wrap">
|
25 | 25 | <div class="fs15 font-weight-bold break-word d-inline-block hash-box mb-3" data-target="address.addr">{{.Address}}</div>
|
26 | 26 | <a
|
|
40 | 40 | <span class="text-secondary fs13">Balance</span>
|
41 | 41 | <br>
|
42 | 42 | <span class="lh1rem d-inline-block pt-1 fs18 fs14-decimal font-weight-bold">
|
43 |
| - {{if .Balance}} |
| 43 | + {{- if .Balance}} |
44 | 44 | {{template "decimalParts" (amountAsDecimalParts .Balance.TotalUnspent true)}}<span class="text-secondary fs14">DCR</span>
|
45 |
| - {{else}} |
| 45 | + {{- else}} |
46 | 46 | <span class="fs18">0</span> <span class="text-secondary fs14">DCR</span>
|
47 |
| - {{end}} |
| 47 | + {{- end}} |
48 | 48 | </span>
|
49 | 49 | <br>
|
50 |
| - {{if $.FiatBalance}} |
| 50 | + {{- if $.FiatBalance}} |
51 | 51 | <span class="text-secondary fs16 lh1rem">{{threeSigFigs $.FiatBalance.Value}} <span class="fs14">{{$.FiatBalance.Index}}</span></span>
|
52 |
| - {{end}} |
| 52 | + {{- end}} |
53 | 53 | </div>
|
54 | 54 | <div class="d-inline-block text-left pr-2 pb-3">
|
55 | 55 | <span class="text-secondary fs13">Received</span>
|
56 |
| - <br> |
| 56 | + <br> |
57 | 57 | <span class="lh1rem d-inline-block pt-1 fs18 fs14-decimal font-weight-bold">
|
58 |
| - {{if .Balance}} |
59 |
| - {{$received := add .Balance.TotalSpent .Balance.TotalUnspent}} |
60 |
| - {{template "decimalParts" (amountAsDecimalParts $received true)}} <span class="text-secondary fs14">DCR</span> |
61 |
| - {{else}} |
| 58 | + {{- if .Balance}} |
| 59 | + {{- $received := add .Balance.TotalSpent .Balance.TotalUnspent}} |
| 60 | + {{- template "decimalParts" (amountAsDecimalParts $received true)}} <span class="text-secondary fs14">DCR</span> |
| 61 | + {{- else}} |
62 | 62 | <span class="fs18">0</span> <span class="text-secondary fs14">DCR</span>
|
63 |
| - {{end}} |
| 63 | + {{- end}} |
64 | 64 | </span>
|
65 | 65 | <br>
|
66 | 66 | <span class="text-secondary fs16 lh1rem">{{intComma (add .Balance.NumSpent .Balance.NumUnspent)}} outputs</span>
|
67 |
| - </span> |
68 | 67 | </div>
|
69 | 68 | <div class="d-inline-block text-left pr-2 pb-3">
|
70 | 69 | <span class="text-secondary fs13">Spent</span>
|
71 | 70 | <br>
|
72 | 71 | <span class="lh1rem d-inline-block pt-1 fs18 fs14-decimal font-weight-bold">
|
73 |
| - {{if .Balance}} |
74 |
| - {{template "decimalParts" (amountAsDecimalParts .Balance.TotalSpent true)}} <span class="text-secondary fs14">DCR</span> |
75 |
| - {{else}} |
| 72 | + {{- if .Balance}} |
| 73 | + {{- template "decimalParts" (amountAsDecimalParts .Balance.TotalSpent true)}} <span class="text-secondary fs14">DCR</span> |
| 74 | + {{- else}} |
76 | 75 | <span class="fs18">0</span> <span class="text-secondary fs14">DCR</span>
|
77 |
| - {{end}} |
| 76 | + {{- end}} |
78 | 77 | </span>
|
79 | 78 | <br>
|
80 | 79 | <span class="text-secondary fs16 lh1rem">{{intComma .Balance.NumSpent}} inputs</span>
|
81 | 80 | </div>
|
82 | 81 | <span></span>
|
83 | 82 | </div>
|
84 | 83 | <div class="row pb-2">
|
85 |
| - {{if ne .NumUnconfirmed 0}} |
| 84 | + {{- if ne .NumUnconfirmed 0}} |
86 | 85 | <div class="col-12 pb-2 fs14 text-secondary text-left" data-target="address.numUnconfirmed">
|
87 | 86 | <span class="font-weight-bold">Unconfirmed</span>: <span class="addr-unconfirmed-count">{{.NumUnconfirmed}}</span>
|
88 | 87 | </div>
|
89 |
| - {{end}} |
90 |
| - {{if .Balance.HasStakeOutputs}} |
| 88 | + {{- end}} |
| 89 | + {{- if .Balance.HasStakeOutputs}} |
91 | 90 | <div class="col-12 pb-2 fs14 text-secondary text-left">
|
92 | 91 | <span class="font-weight-bold">Stake spending</span>: {{printf "%.1f" (x100 .Balance.FromStake)}}%
|
93 | 92 | </div>
|
94 |
| - {{end}} |
95 |
| - {{if .Balance.HasStakeInputs}} |
| 93 | + {{- end}} |
| 94 | + {{- if .Balance.HasStakeInputs}} |
96 | 95 | <div class="col-12 pb-2 fs14 text-secondary text-left">
|
97 | 96 | <span class="font-weight-bold">Stake income</span>: {{printf "%.1f" (x100 .Balance.ToStake)}}%
|
98 | 97 | </div>
|
99 |
| - {{end}} |
| 98 | + {{- end}} |
100 | 99 | </div>
|
101 | 100 | <div class="row pb-3 fs16">
|
102 | 101 | <span class="col-24"><a href="{{$.Links.DownloadLink}}" title="Decred downloads" target="_blank" rel="noopener noreferrer">Get Decrediton</a>, the official desktop wallet.</span>
|
|
226 | 225 | <div
|
227 | 226 | class="d-flex align-items-center justify-content-between"
|
228 | 227 | >
|
229 |
| - {{if gt $TxnCount 0}}<a class="d-inline-block p-2 rounded download text-nowrap" href="/download/address/io/{{.Address}}{{if $.CRLFDownload}}?cr=true{{end}}" type="text/csv" download><span class="dcricon-download mx-1"></span> Download CSV</a>{{end}} |
230 |
| - <!-- This dummy span ensures left/right alignment of the buttons, even if one is hidden --> |
231 |
| - <span></span> |
| 228 | + {{- if gt $TxnCount 0}} |
| 229 | + <a class="d-inline-block p-2 rounded download text-nowrap" href="/download/address/io/{{.Address}}{{if $.CRLFDownload}}?cr=true{{end}}" type="text/csv" download><span class="dcricon-download mx-1"></span> Download CSV</a> |
| 230 | + {{- end}} |
| 231 | + <span></span>{{/*This dummy span ensures left/right alignment of the buttons, even if one is hidden.*/}} |
232 | 232 | <div class="d-inline-block text-right">
|
233 | 233 | <label class="mb-0 mr-1" for="txntype">Type</label>
|
234 | 234 | <select
|
|
246 | 246 | </select>
|
247 | 247 | </div>
|
248 | 248 | </div>
|
249 |
| - <div |
250 |
| - class="hidden d-flex align-items-center justify-content-end" |
251 |
| - > |
| 249 | + <div class="hidden d-flex align-items-center justify-content-end"> |
252 | 250 | <label class="my-2 mr-1" for="pagesize">Page size</label>
|
253 | 251 | <select
|
254 | 252 | name="pagesize"
|
255 | 253 | id="pagesize"
|
256 | 254 | data-target="address.pagesize"
|
257 | 255 | data-action="change->address#changePageSize"
|
258 | 256 | class="form-control-sm mb-2 mr-sm-2 mb-sm-0 {{if lt $TxnCount 20}}disabled{{end}}"
|
259 |
| - {{if lt $TxnCount 20}}disabled{{end}} |
| 257 | + {{- if lt $TxnCount 20}} disabled{{end}} |
260 | 258 | >
|
261 |
| - {{$Txlen := len .Transactions}} |
262 |
| - <option {{if eq $Txlen 20}}selected{{end}} value="20"{{if lt $TxnCount 20}} disabled{{end}}>20</option> |
263 |
| - <option {{if eq $Txlen 100}}selected{{end}} value="100"{{if lt $TxnCount 100}} disabled{{end}}>100</option> |
264 |
| - {{if lt $TxnCount 1000}} |
265 |
| - <option{{if eq $Txlen $TxnCount}} selected{{end}} value="{{$TxnCount}}"{{if le $TxnCount 100}} disabled{{end}}>{{$TxnCount}}</option> |
266 |
| - {{else}} |
267 |
| - <option{{if eq $Txlen 1000}} selected{{end}} value="1000">1000</option> |
268 |
| - {{end}} |
| 259 | + {{- $Txlen := len .Transactions}} |
| 260 | + <option {{if eq $Txlen 20}}selected {{end}}value="20"{{if lt $TxnCount 20}} disabled{{end}}>20</option> |
| 261 | + <option {{if eq $Txlen 40}}selected {{end}}value="40"{{if lt $TxnCount 40}} disabled{{end}}>40</option> |
| 262 | + <option {{if eq $Txlen 80}}selected {{end}}value="80"{{if lt $TxnCount 80}} disabled{{end}}>80</option> |
| 263 | + {{- if lt $TxnCount 160}} |
| 264 | + <option {{if eq $Txlen $TxnCount}}selected {{end}}value="{{$TxnCount}}"{{if le $TxnCount 160}} disabled{{end}}>{{$TxnCount}}</option> |
| 265 | + {{- else}} |
| 266 | + <option {{if ge $Txlen 160}}selected {{end}}value="160">160</option> |
| 267 | + {{- end}} |
| 268 | + </select> |
269 | 269 | </select>
|
270 | 270 | </div>
|
271 | 271 | </div>
|
272 |
| - {{end}} {{/* if not .IsDummyAddress */}} |
273 |
| - </div> <!-- container main --> |
274 |
| - {{end}} {{/* with .Data */}} |
275 |
| - {{ template "footer" . }} |
276 |
| - |
| 272 | + {{- end}}{{/* if not .IsDummyAddress */}} |
| 273 | + </div>{{/* container main */}} |
| 274 | + {{- end}} {{/* with .Data */}} |
| 275 | + {{template "footer" . }} |
277 | 276 | </body>
|
278 | 277 | </html>
|
279 |
| -{{end}} |
| 278 | +{{- end}} |
0 commit comments