aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-06-22 16:36:37 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-06-22 16:37:39 +0100
commitd20e84acc2beadad9a3f8fbfc55b5a3c8b06c9ba (patch)
tree5f09dfd65f92f0dbcfc4e09df97a41672b815511
parent0c69e124a57891aa84aaf7c25773738db2a108c2 (diff)
Show any waiting reports on admin index page.
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm7
-rw-r--r--templates/web/base/admin/index.html16
2 files changed, 23 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index 2fda70ad9..27b434f06 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -73,6 +73,13 @@ sub index : Path : Args(0) {
$c->forward('stats_by_state');
+ my @unsent = $c->model('DB::Problem')->search( {
+ state => [ 'confirmed' ],
+ whensent => undef,
+ bodies_str => { '!=', undef },
+ } )->all;
+ $c->stash->{unsent_reports} = \@unsent;
+
my $alerts = $c->model('DB::Alert')->summary_report_alerts( $c->cobrand->restriction );
my %alert_counts =
diff --git a/templates/web/base/admin/index.html b/templates/web/base/admin/index.html
index 66d986aaf..3c510471e 100644
--- a/templates/web/base/admin/index.html
+++ b/templates/web/base/admin/index.html
@@ -44,6 +44,22 @@ and to receive notices of updates.
<input type="submit" value="[% loc('Go') %]">
</form>
+[% IF unsent_reports.size %]
+<h2>[% loc('Reports waiting to be sent') %]</h2>
+
+<table cellspacing="0" cellpadding="2" border="1">
+ <tr>
+ <th>[% loc('ID') %]</th>
+ <th>[% loc('Title') %]</th>
+ <th>[% loc('Name') %]</th>
+ <th>[% loc('Body') %]</th>
+ <th>[% loc('State') %]</th>
+ <th>*</th>
+ </tr>
+ [% INCLUDE 'admin/problem_row.html' problems = unsent_reports %]
+</table>
+[% END %]
+
<h2>[% loc('Stats') %]</h2>
[% INCLUDE 'status/stats.html' admin_include_users=1 %]