Browse Source

use twig filters for account balance format

main
ghost 9 months ago
parent
commit
9c2464d7fb
  1. 7
      src/Controller/UserController.php
  2. 4
      templates/default/user/list.html.twig

7
src/Controller/UserController.php

@ -131,13 +131,6 @@ class UserController extends AbstractController
$list[] = $list[] =
[ [
'name' => $user['key'], 'name' => $user['key'],
'balance' => $client->getBalance(
$user['key'],
$this->getParameter('app.pool.confirmations')
),
'address' => $client->getAccountAddress(
$user['key']
),
'total' => $total, 'total' => $total,
'rooms' => $rooms, 'rooms' => $rooms,
]; ];

4
templates/default/user/list.html.twig

@ -10,10 +10,10 @@
@{{ user.name }} @{{ user.name }}
</strong> </strong>
<span style="float:right">{# @TODO #} <span style="float:right">{# @TODO #}
{{ 'balance: %s KVA' | trans | format(user.balance) }} {{ 'balance' | trans }}: {{ user.name | account_balance | format_kva }}
</span> </span>
<p> <p>
{{ 'boost' | trans }}: {{ user.address }} {{ 'boost' | trans }}: {{ user.name | account_address }}
</p> </p>
{% if user.rooms | length %} {% if user.rooms | length %}
<p> <p>

Loading…
Cancel
Save