forked from blockcypher/explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddress_overview.html
331 lines (283 loc) · 9.88 KB
/
address_overview.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
{% extends "base.html" %}
{% load i18n %}
{% load humanize %}
{% load btc_formats %}
{% load static %}
{% block title %}
{{ coin_symbol|coin_symbol_to_currency_name }}
{% if is_wallet_page %}
Extended Public Key {{ pubkey }}
{% else %}
Address {{ address }}
{% endif %}
{% endblock title %}
{% block meta_description %}
{{ coin_symbol|coin_symbol_to_currency_name }}
{% if is_wallet_page %}
Extended Public Key {{ pubkey }}
{% else %}
Address {{ address }}
{% endif %}
has had
{% if num_all_txns %}
{{ num_all_txns|intcomma }} transaction{{ num_all_txns|pluralize }}
and has a balance of
{% satoshis_to_user_units_trimmed total_balance_satoshis 'btc' coin_symbol True %}
{% if total_balance_satoshis %}
({% satoshis_to_user_units_trimmed total_received_satoshis 'btc' coin_symbol True %}
received and
{% satoshis_to_user_units_trimmed total_sent_satoshis 'btc' coin_symbol True %}
sent).
{% else %}
({% satoshis_to_user_units_trimmed total_received_satoshis 'btc' coin_symbol True %}
sent and received)
{% endif %}
{% else %}
no transactions.
{% endif %}
{% endblock meta_description %}
{% block extra_head %}
{% if before_bh %}
{# https://moz.com/learn/seo/canonicalization #}
<link href="{% url 'address_overview' coin_symbol address %}" rel="canonical" />
{% endif %}
{% endblock extra_head %}
{% block page_header %}
<h1>
<i class="fa fa-qrcode"></i>
{{ coin_symbol|coin_symbol_to_display_name }}
{% if is_wallet_page %}
Extended Public Key
{% else %}
Address
{% endif %}
</h1>
<h2 class="tagline wrapit semi">
{% if is_wallet_page %}
{{ pubkey }}
{% else %}
{{ address }}
{% endif %}
</h2>
{% if is_wallet_page and subchain_indices %}
<h4 class="tagline wrapit semi">
Subchain Indices:
{% for subchain_index in subchain_indices %}
{{ subchain_index }}{% include "partials/comma.html" %}
{% endfor %}
</h4>
{% endif %}
{% if wallet_name %}<h2 class="tagline wrapit semi">{{ wallet_name }}</h2>{% endif %}
{% endblock page_header %}
{% block content %}
<div class="container">
<div class="section">
{% if not is_wallet_page %}
<div class="col-md-4 text-center">
<p>
{# TODO: support this for other blockchains #}
<a href="{% if coin_symbol = 'btc' %}bitcoin:{{ address }}"{% else %}{% url 'address_overview' coin_symbol address %}{% endif %}">
<img src="//chart.googleapis.com/chart?cht=qr&chl=bitcoin%3A{{ address }}&choe=UTF-8&chs=300x300" alt="{{ address }}" title="{{ address }}" class="img-responsive img-center">
</a>
</p>
</div>
{% endif %}
<div class="col-md-{% if is_wallet_page %}12{% else %}8{% endif %}">
<div class="dash dash-3">
<ul>
<li>
<span class="dash-label">Received</span><br>
{% satoshis_to_user_units_trimmed total_received_satoshis tcp__user_units coin_symbol True %}
</li>
<li>
<span class="dash-label">Sent</span><br>
{% satoshis_to_user_units_trimmed total_sent_satoshis tcp__user_units coin_symbol True %}
</li>
<li>
<span class="dash-label">Balance</span><br>
{% satoshis_to_user_units_trimmed total_balance_satoshis tcp__user_units coin_symbol True %}
{% if unconfirmed_balance_satoshis %}
<br>
<span class="dash-label">
({% satoshis_to_user_units_trimmed unconfirmed_balance_satoshis tcp__user_units coin_symbol True %} unconfirmed)
</span>
{% endif %}
</li>
</ul>
<div class="clearfix"></div>
</div>
<br />
{% if not is_wallet_page %}
<p class="text-center">
{% if num_all_txns < 1000 %}
<a href="{% url 'subscribe_address' coin_symbol %}?a={{ address }}" class="btn btn-lg btn-default">
<i class="fa fa-inbox"></i>
Subscribe
</a>
{% endif %}
<button type="button" class="btn btn-lg btn-primary" data-toggle="collapse" data-target="#advanced-details">
Advanced Details
<b class="caret"></b>
</button>
</p>
<div class="col-md-12 collapse" id="advanced-details">
<div class="table-responsive">
<table class="table">
{% comment %}
<tr>
<td colspan="2" class="text-center">
<a href="{% url 'setup_address_forwarding' coin_symbol %}?a={{ address }}" class="btn btn-default">
<i class="fa fa-mail-forward"></i>
Get Forwarding Address
</a>
</td>
</tr>
{% endcomment %}
<tr>
<td colspan="2" class="text-center">
<a href="{% url 'widgets_overview' coin_symbol address %}" class="btn btn-default">
<i class="fa fa-line-chart"></i>
Get Embeddable Widget
</a>
</td>
</tr>
<tr>
<td colspan="2" class="text-center">
<a href="{{ api_url }}?unspentOnly=true&includeScript=true" class="btn btn-default">
<i class="fa fa-code"></i>
Unspent Outputs
</a>
</td>
</tr>
<tr>
<td colspan="2" class="text-center">
<a href="{{ api_url }}" class="btn btn-default">
<i class="fa fa-code"></i>
API Call
</a>
</td>
</tr>
<tr>
<td colspan="2" class="text-center">
<a href="http://dev.blockcypher.com/#transactions" class="btn btn-default">
<i class="fa fa-external-link"></i>
API Docs
</a>
</td>
</tr>
</table>
</div>
</div>
{% endif %}
</div>
<div class="clearfix"></div>
</div>
{% if flattened_txs %}
<h2>
{% if flattened_txs|length != num_all_txns %}
{{ flattened_txs|length }}
of
{% endif %}
{{ num_all_txns|intcomma }} Transaction{{ num_all_txns|pluralize }}
{% if num_unconfirmed_txns %}
({{ num_unconfirmed_txns|intcomma }} unconfirmed)
{% endif %}
</h2>
{% if is_wallet_page %}
{% include "partials/tx_list.html" %}
{% else %}
{% if before_bh %}
<p>
Showing transactions before block {{ before_bh|intcomma }}
(<a href="{% url 'address_overview' coin_symbol address %}">show latest</a>)
</p>
{% endif %}
{% for transaction in flattened_txs %}
{% with force_include_tx_amount=True show_tx_hash=True show_num_confirmations=True num_inouts_to_display=5 %}
{% include "partials/tx_hash.html" %}
{% endwith %}
{% endfor %}
{% if has_more %}
{% with flattened_txs|last as last_tx %}
<a href="?before={{ last_tx.block_height }}" class="btn btn-default pull-right" rel=“nofollow">
More
<i class="fa fa-angle-double-right"></i>
</a>
{% endwith %}
{% endif %}
{% endif %}
{% else %}
<p>
No transactions detected{% if before_bh %} before block {{ before_bh|intcomma }}{% endif %}
{% if is_wallet_page and not subchain_indices %}
. <a href="?subchain-indices=0-1">Check subchain indices 0 & 1</a>.
{% elif before_bh %}
(<a href="{% url 'address_overview' coin_symbol address %}">show latest</a>)
{% endif %}
</p>
{% endif %}
{% if is_wallet_page %}
{% if wallet_addresses.chains.0.chain_addresses %}
<h2>Wallet Addresses</h2>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<td>
Address
</td>
<td>
Path
</td>
{% if 'index' in wallet_addresses.chains.0 %}
<td>
Subchain Index
</td>
{% endif %}
</tr>
</thead>
{% for chain in wallet_addresses.chains %}
{% for chain_address in chain.chain_addresses %}
<tr>
<td>
<a href="{% url 'address_overview' coin_symbol chain_address.address %}">
{{ chain_address.address }}
</a>
</td>
<td>
{{ chain_address.path }}
</td>
{% if 'index' in chain %}
<td>
{{ chain.index }}
</td>
{% endif %}
</tr>
{% endfor %}
{% endfor %}
</table>
</div>
{% endif %}
{% else %}
<div class="clearfix"></div>
{% url 'add_metadata_to_address' coin_symbol address as add_metadata_uri %}
{% include "partials/metadata.html" %}
{% endif %}
{# section div: #}
</div>
{# no end container div!? #}
{% endblock content %}
{% block extra_js %}
<script src="{% static "js/jquery.timeago.js" %}" type="text/javascript"></script>
<script>
$(document).ready(function(){
$("time.timeago").timeago();
if (window.location.hash == '#advanced-details') {
$('#advanced-details').collapse('show');
}
{% if not is_wallet_page %}
fetch_metadata('{{ coin_symbol }}', 'addr', '{{ address }}');
{% endif %}
})
</script>
{% endblock extra_js %}