forked from blockcypher/explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblock_overview.html
257 lines (227 loc) · 7.19 KB
/
block_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
{% extends "base.html" %}
{% load i18n %}
{% load humanize %}
{% load btc_formats %}
{% load static %}
{% block title %}
{% blocktrans with currency_name=coin_symbol|coin_symbol_to_currency_name block_hash=block_details.hash %}
{{ currency_name }} Block {{ block_hash }}
{% endblocktrans %}
{% endblock title %}
{% block meta_description %}
{{ coin_symbol|coin_symbol_to_currency_name }}
block {{ block_details.hash }}
was confirmed as the {{ block_details.height|ordinal }} block on
{{ block_details.received_time|date:'Y-m-d H:i' }} GMT.
It had
{{ block_details.n_tx|intcomma }} transaction{{ block_details.n_tx|pluralize}},
which totaled
{% satoshis_to_user_units_trimmed block_details.total 'btc' coin_symbol True 4 %}
with
{% satoshis_to_user_units_trimmed block_details.fees 'btc' coin_symbol True 4 %}
in fees.
{% endblock meta_description %}
{% block page_header %}
<h1>
<i class="fa fa-cube"></i>
{{ coin_symbol|coin_symbol_to_display_name }} Block {{ block_details.height|intcomma }}
</h1>
<h2 class="tagline wrapit semi">{{ block_details.hash }}</h2>
{% endblock page_header %}
{% block content %}
<div class="container">
<nav>
{% if block_details.height != 1 %}
<a href="{% url 'block_overview' coin_symbol block_details.prev_block %}" class="btn btn-default pull-left">
<i class="fa fa-angle-double-left"></i>
Previous Block
</a>
{% endif %}
{% if block_details.depth > 0 %}
<a href="{% url 'block_overview' coin_symbol block_details.height|add:1 %}" class="btn btn-default pull-right">
Next Block
<i class="fa fa-angle-double-right"></i>
</a>
{% else %}
{# TODO: something to mark that this is the current block? #}
{% endif %}
<div class="clearfix"></div>
</nav>
<div class="section">
<div class="dash dash-3">
<ul>
<li>
<span class="dash-label">Received</span><br>
<i class="fa fa-clock-o"></i>
<time class="timeago" datetime="{{ block_details.received_time|date:'Y-m-d\TH:i:s' }}Z">
{{ block_details.received_time|date:'Y-m-d H:i' }} GMT
</time>
</li>
<li>
<span class="dash-label">Total Transacted</span><br>
{% satoshis_to_user_units_trimmed block_details.total tcp__user_units coin_symbol True 4 %}
</li>
<li>
<span class="dash-label">Total Fees</span><br>
{% satoshis_to_user_units_trimmed block_details.fees tcp__user_units coin_symbol True 4 %}
</li>
</ul>
<div class="clearfix"></div>
</div>
</div>
<p class="text-center">
<button type="button" class="btn 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">
<tr>
<th>Current Depth</th>
<td>
{{ block_details.depth|intcomma }}
</td>
</tr>
{% if block_details.size %}
<tr>
<th>Block Size (bytes)</th>
<td>
{{ block_details.size|intcomma }}
</td>
</tr>
{% endif %}
<tr>
<th>Nonce</th>
<td>
{{ block_details.nonce }}
</td>
</tr>
<tr>
<th>Merkle Root</th>
<td>
{{ block_details.mrkl_root }}
</td>
</tr>
<tr>
<th>Bits (difficulty target)</th>
<td>
{{ block_details.bits|intcomma }}
</td>
</tr>
<tr>
<th>Version</th>
<td>
{{ block_details.ver }}
</td>
</tr>
{% if block_details.relayed_by %}
<tr>
<th>IP Relayed By</th>
<td>
{{ block_details.relayed_by }}
</td>
</tr>
{% endif %}
<tr>
<td colspan="2" class="text-center">
<a href="{{ api_url }}" class="btn btn-default">
<i class="fa fa-code"></i>
API Call
</a>
<a href="http://dev.blockcypher.com/#blocks" class="btn btn-default">
<i class="fa fa-external-link"></i>
API Docs
</a>
</td>
</tr>
</table>
</div>
</div>
<h2>
{% if block_details.txids|length != block_details.n_tx %}
{{ block_details.txids|length }}
of
{% endif %}
{{ block_details.n_tx|intcomma }} Transaction{{ block_details.n_tx|pluralize}}
</h2>
<div class="section pager">
<div class="row">
<div class="col-sm-4 text-left">
{% if current_page > 1 %}
<a href="?page={{ current_page|add:-1|intcomma }}" class="btn btn-default">
<i class="fa fa-angle-double-left"></i>
Previous Page
</a>
{% endif %}
</div>
<div class="col-sm-4 text-center">
Page {{ current_page|intcomma }} of {{ max_pages|intcomma }}
</div>
<div class="col-sm-4 text-right">
{% if current_page < max_pages %}
<a href="?page={{ current_page|add:1|intcomma }}" class="btn btn-default">
Next Page
<i class="fa fa-angle-double-right"></i>
</a>
{% endif %}
</div>
<div class="clearfix"></div>
</div>
</div>
{% if block_details.txids %}
{% for transaction in block_details.txids %}
{% with force_include_tx_amount=True show_tx_hash=True show_num_confirmation=False num_inouts_to_display=5 %}
{% include "partials/tx_hash.html" %}
{% endwith %}
{% endfor %}
<div class="section pager">
<div class="row">
<div class="col-sm-4 text-left">
{% if current_page > 1 %}
<a href="?page={{ current_page|add:-1|intcomma }}" class="btn btn-default">
<i class="fa fa-angle-double-left"></i>
Previous Page
</a>
{% endif %}
</div>
<div class="col-sm-4 text-center">
Page {{ current_page|intcomma }} of {{ max_pages|intcomma }}
</div>
<div class="col-sm-4 text-right">
{% if current_page < max_pages %}
<a href="?page={{ current_page|add:1|intcomma }}" class="btn btn-default">
Next Page
<i class="fa fa-angle-double-right"></i>
</a>
{% endif %}
</div>
<div class="clearfix"></div>
</div>
</div>
{% else %}
<p>
{% if block_details.height == 1 %}
The genesis block has no transactions.
{% else %}
No transactions. Something seems off, that doesn't make any sense!
{% endif %}
</p>
{% endif %}
{% url 'add_metadata_to_block' coin_symbol block_details.hash as add_metadata_uri %}
{% include "partials/metadata.html" %}
</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');
}
fetch_metadata('{{ coin_symbol }}', 'block', '{{ block_details.hash }}');
})
</script>
{% endblock extra_js %}