From e2cf58c895e247817fc58c6aa76f19020a0c128f Mon Sep 17 00:00:00 2001 From: Tom Bloor Date: Thu, 20 Apr 2017 22:16:44 +0100 Subject: [PATCH] Add reporting of pending orgs and transactions in admin section --- lib/Pear/LocalLoop/Controller/Admin.pm | 6 +++++- templates/admin/home.html.ep | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/lib/Pear/LocalLoop/Controller/Admin.pm b/lib/Pear/LocalLoop/Controller/Admin.pm index dbae956..b7bb204 100644 --- a/lib/Pear/LocalLoop/Controller/Admin.pm +++ b/lib/Pear/LocalLoop/Controller/Admin.pm @@ -18,12 +18,16 @@ sub home { my $user_rs = $c->schema->resultset('User'); 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( user_count => $user_rs->count, tokens => { 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, ); } diff --git a/templates/admin/home.html.ep b/templates/admin/home.html.ep index 5c539aa..ebc749b 100644 --- a/templates/admin/home.html.ep +++ b/templates/admin/home.html.ep @@ -23,4 +23,24 @@ +
+
+ Pending Organisations +
+
+

+ %= $pending_orgs +

+
+
+
+
+ Pending Transactions +
+
+

+ %= $pending_trans +

+
+