bitvend/bitvend/templates/admin/transactions.html

47 lines
1.9 KiB
HTML

{% extends "admin/base.html" %}
{% from "_helpers.html" import format_currency, render_pagination %}
{% set _tx_styles = {
'transfer': 'primary',
'bitcoin': 'warning',
'purchase': 'info',
} %}
{% block content %}
<table class="table table-hover table-striped">
<thead>
<tr>
<th class="text-right">User</th>
<th>Type</th>
<th class="text-right">Amount</th>
<th>Date</th>
</tr>
</thead>
{% for tx in transactions.items %}
<tr{% if not tx.finished %} style="opacity: 0.5"{% endif %}>
<td class="text-right">{{ tx.user }}</td>
<td>
<span class="label label-{{ _tx_styles[tx.type]|default('default') }}">{{ tx.type }}</span> {% if not tx.finished %}<i>(processing)</i>{% endif %}
<small>
{% if tx.type == 'transfer' and tx.amount > 0 %}
from <b>{{ tx.related_user }}</b>
{% elif tx.type == 'transfer' and tx.amount < 0 %}
to <b>{{ tx.related }}</b>
{% elif tx.type == 'purchase' and tx.product_id %}
of product <b>{{ tx.product_id }}</b>
{% elif tx.type == 'bitcoin' %}
<a href="https://live.blockcypher.com/btc/tx/{{ tx.tx_hash }}">{{ tx.tx_hash|truncate(9) }}</a>
{% endif %}
</small>
</td>
<td class="text-right">{{ format_currency(tx.amount) }}</td>
<td>{{ tx.created }}</td>
</tr>
{% else %}
<tr><td colspan=3 class="placeholder">Nothing to see here...</td></tr>
{% endfor %}
</table>
{{ render_pagination(transactions) }}
{% endblock %}