Add reporting of pending orgs and transactions in admin section

This commit is contained in:
Tom Bloor 2017-04-20 22:16:44 +01:00
parent d1add8ee7c
commit e2cf58c895
2 changed files with 25 additions and 1 deletions

View file

@ -18,12 +18,16 @@ sub home {
my $user_rs = $c->schema->resultset('User'); my $user_rs = $c->schema->resultset('User');
my $token_rs = $c->schema->resultset('AccountToken'); my $token_rs = $c->schema->resultset('AccountToken');
my $pending_orgs_rs = $c->schema->resultset('PendingOrganisation');
my $pending_transaction_rs = $c->schema->resultset('PendingTransaction');
$c->stash( $c->stash(
user_count => $user_rs->count, user_count => $user_rs->count,
tokens => { tokens => {
total => $token_rs->count, total => $token_rs->count,
unused => $token_rs->search({used => 0 })->count, unused => $token_rs->search({ used => 0 })->count,
}, },
pending_orgs => $pending_orgs_rs->count,
pending_trans => $pending_transaction_rs->count,
); );
} }

View file

@ -23,4 +23,24 @@
</h2> </h2>
</div> </div>
</div> </div>
<div class="card text-center">
<div class="card-header card-inverse card-danger">
Pending Organisations
</div>
<div class="card-block">
<h2 class="card-title">
%= $pending_orgs
</h2>
</div>
</div>
<div class="card text-center">
<div class="card-header card-inverse card-danger">
Pending Transactions
</div>
<div class="card-block">
<h2 class="card-title">
%= $pending_trans
</h2>
</div>
</div>
</div> </div>