Jinja2 macro for transaction items
This commit is contained in:
parent
80c79966a5
commit
25caa397fd
|
@ -0,0 +1,28 @@
|
||||||
|
{% macro tx_item(tx) %}
|
||||||
|
<li class="list-group-item tx_item">
|
||||||
|
<span class="datetime">
|
||||||
|
{{tx['datetime'].strftime('%Y-%m-%d %H:%M')}}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span class="height">
|
||||||
|
<b>Blockheight</b>: {{tx['height']}}</span>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<a target="_blank" href="https://explore.wownero.com/tx/{{tx['txid']}}">{{tx['txid'][:32]}}...</a>
|
||||||
|
<span class="amount{% if tx['type'] == 'in' %} in{% endif %}">
|
||||||
|
{% if tx['type'] == 'in' %}
|
||||||
|
+
|
||||||
|
{% else %}
|
||||||
|
-
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{{tx['amount_human']|round(3)}} WOW
|
||||||
|
|
||||||
|
{% if 'amount_usd' in tx %}
|
||||||
|
<small style="color: black">
|
||||||
|
➞ $ {{tx['amount_usd']}}
|
||||||
|
</small>
|
||||||
|
{% endif %}
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
{% endmacro %}
|
|
@ -165,12 +165,7 @@
|
||||||
|
|
||||||
{% include 'comments.html' %}
|
{% include 'comments.html' %}
|
||||||
|
|
||||||
<style>
|
{% from 'proposal/macros/transaction.html' import tx_item %}
|
||||||
#incoming_txs li.list-group-item {
|
|
||||||
padding-top: 4px;
|
|
||||||
padding-bottom: 4px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
{% if proposal.balance['txs'] %}
|
{% if proposal.balance['txs'] %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -180,20 +175,7 @@
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
{% for tx in proposal.balance['txs'] %}
|
{% for tx in proposal.balance['txs'] %}
|
||||||
<li class="list-group-item">
|
{{ tx_item(tx) }}
|
||||||
{{tx['datetime'].strftime('%Y-%m-%d %H:%M')}}
|
|
||||||
<span style="float:right"><b>Blockheight</b>: {{tx['height']}}</span>
|
|
||||||
<br>
|
|
||||||
<a target="_blank" href="https://explore.wownero.com/tx/{{tx['txid']}}">{{tx['txid'][:32]}}...</a>
|
|
||||||
<span style="float:right;color:#008926;font-weight:bold;">
|
|
||||||
+ {{tx['amount_human']|round(3)}} WOW
|
|
||||||
{% if 'amount_usd' in tx %}
|
|
||||||
<small style="color: black">
|
|
||||||
➞ $ {{tx['amount_usd']}}
|
|
||||||
</small>
|
|
||||||
{% endif %}
|
|
||||||
</span>
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -203,7 +185,6 @@
|
||||||
<!-- /.row -->
|
<!-- /.row -->
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
{% if proposal.spends['txs'] %}
|
{% if proposal.spends['txs'] %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
@ -212,20 +193,7 @@
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
{% for tx in proposal.spends['txs'] %}
|
{% for tx in proposal.spends['txs'] %}
|
||||||
<li class="list-group-item">
|
{{ tx_item(tx) }}
|
||||||
{{tx['datetime'].strftime('%Y-%m-%d %H:%M')}}
|
|
||||||
<span style="float:right"><b>Blockheight</b>: {{tx['height']}}</span>
|
|
||||||
<br>
|
|
||||||
<a target="_blank" href="https://explore.wownero.com/tx/{{tx['txid']}}">{{tx['txid'][:32]}}...</a>
|
|
||||||
<span style="float:right;color:#890000;font-weight:bold;">
|
|
||||||
- {{tx['amount_human']|round(3)}} WOW
|
|
||||||
{% if 'amount_usd' in tx %}
|
|
||||||
<small style="color: black">
|
|
||||||
➞ $ {{tx['amount_usd']}}
|
|
||||||
</small>
|
|
||||||
{% endif %}
|
|
||||||
</span>
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue