...
 
Commits (2)
This diff is collapsed.
......@@ -19,6 +19,8 @@ class AppExtension extends AbstractExtension
new TwigFilter('toRSAddress', [$this, 'toRSAddress']),
new TwigFilter('str2bin', [$this, 'str2bin']),
new TwigFilter('toAccountId', [$this, 'toAccountId']),
new TwigFilter('sha256', [$this, 'sha256']),
new TwigFilter('planckToBurst', [$this, 'planckToBurst']),
];
}
......@@ -41,6 +43,14 @@ class AppExtension extends AbstractExtension
return Converter::toUnsinged($string);
}
public function sha256($string) {
return hash('sha256', $string);
}
public function planckToBurst($string) {
return number_format(round($string / 100000000, 2),2, '.', ',');
}
public function getEnv($string) {
if(isset($_ENV[$string])) {
return $_ENV[$string];
......
{% extends "common.layout.html.twig" %}
{% block main %}
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
<p class="h3 text-center">Transaction #{{ transaction.id }}</p>
<table class="table table-striped table-hover table-sm">
<tr>
<th>Sender</th>
<td style="text-align: center">
<a href="{{ path('account_details', {id: transaction.sender_id | toAccountId }) }}">
{{ transaction.sender_id | toRSAddress }}<br />{{ transaction.sender_name }}
</a>
</td>
</tr>
<tr>
<th>Recipient{% if transaction.mo or transaction.mos %}s{% endif %}</th>
<td style="text-align: center">
{% if transaction.type == 0 and transaction.subtype != 0 %}
<table class="">
{% for details in transaction.mo_details %}
<td>
<td>
<a href="{{ path('account_details', {id: details.recipient_id | toAccountId }) }}">
{{ details.recipient_id | toRSAddress }}
</a>
</td>
<td style="word-wrap: break-word;min-width: 250px;max-width: 250px;">{{ details.recipient_name }}</td>
<td style="text-align: left">{{ details.amount | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td>
</tr>
{% endfor %}
</table>
{% else %}
<a href="{{ path('account_details', {id: transaction.recipient_id | toAccountId }) }}">
{{ transaction.recipient_id | toRSAddress }}<br />{{ transaction.recipient_name }}
</a>
{% endif %}
</td>
</tr>
<tr>
<th>{% if transaction.mo or transaction.mos %}Total {% endif %}Amount</th>
<td>{{ transaction.amount | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td>
</tr>
<tr>
<th>Fee</th>
<td>{{ transaction.fee | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td>
</tr>
<tr>
<th>Block</th>
<td><a href="{{ url('block_details', {'block_id': transaction.block_id}) }}">#{{ transaction.height }} @ {{ transaction.block_unixtime | date ("Y-m-d H:i:s", "Europe/Berlin") }}</a></td>
</tr>
<tr>
<th>Type</th>
<td>{{ transaction.type_name }}</td>
</tr>
<tr>
<th>Timestamp</th>
<td>{{ transaction.unixtime | date ("Y-m-d H:i:s", "Europe/Berlin") }}</td>
</tr>
<tr>
<th>Signature</th>
<td style="word-wrap: break-word;min-width: 160px;max-width: 160px;">{{ transaction.signature | str2bin }}</td>
</tr>
<tr>
<th>Full Hash</th>
<td style="word-wrap: break-word;min-width: 160px;max-width: 160px;">{{ transaction.full_hash | str2bin }}</td>
</tr>
</table>
</div>
</div>
{% endblock %}
\ No newline at end of file
......@@ -54,7 +54,7 @@
<tbody>
{% for transaction in transactions %}
<tr>
<td><a href="#">{{ transaction.id }}</a></td>
<td><a href="{{ path('transaction_details', {'id': transaction.id}) }}">{{ transaction.id }}</a></td>
<td>{{ transaction.transaction_type }}</td>
<td style="text-align: center">
<a href="{{ path('account_details', {id: transaction.sender_id | toAccountId }) }}">
......@@ -67,7 +67,7 @@
{{ transaction.recipient_id | toRSAddress }}<br />{{ transaction.recipient_name }}
</a>
{% else %}
Multiple Recipients, <a href="#">Details</a>
Multiple Recipients, <a href="{{ path('transaction_details', {'id': transaction.id}) }}">Details</a>
{% endif %}
</td>
<td>{{ transaction.amount }}</td>
......