aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller
diff options
context:
space:
mode:
authorHakim Cassimally <hakim@mysociety.org>2014-02-24 13:17:11 +0000
committerHakim Cassimally <hakim@mysociety.org>2014-02-26 15:39:53 +0000
commit863f3655955d58b16c93f99404dff715ea213489 (patch)
tree98c5f163664058a29265adba6d624bf3df2e49f7 /perllib/FixMyStreet/App/Controller
parentcebc2d4fe88228a9864e737c9cdbdf94629f1554 (diff)
Explanatory text/link on /my with no reports
Usually you won't get to "Your Reports" page without any content (reports or updates) but it's possible to do so, as we just discovered in a client meeting, logging into that page, and arriving on a screen of blank content with no guidance. This patch shows some text and a link to create a new report, if there aren't any problems/updates. Fixes #671
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r--perllib/FixMyStreet/App/Controller/My.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/My.pm b/perllib/FixMyStreet/App/Controller/My.pm
index c00264315..bbef1f8d8 100644
--- a/perllib/FixMyStreet/App/Controller/My.pm
+++ b/perllib/FixMyStreet/App/Controller/My.pm
@@ -45,6 +45,7 @@ sub my : Path : Args(0) {
} )->page( $p_page );
while ( my $problem = $rs->next ) {
+ $c->stash->{has_content}++;
push @$pins, {
latitude => $problem->latitude,
longitude => $problem->longitude,
@@ -64,7 +65,9 @@ sub my : Path : Args(0) {
order_by => { -desc => 'confirmed' },
rows => 50
} )->page( $u_page );
+
my @updates = $rs->all;
+ $c->stash->{has_content} += scalar @updates;
$c->stash->{updates} = \@updates;
$c->stash->{updates_pager} = $rs->pager;