diff options
author | Matthew Somerville <matthew@mysociety.org> | 2014-02-27 17:48:04 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2014-02-27 17:48:04 +0000 |
commit | b47568af59e57d6aa0dc861a1c9ca2c5ce4c707e (patch) | |
tree | 910adfc7d508bd7b1a36ea252b4620fa594726fe | |
parent | cdc7ce7c24eb8171487294bbf43c95819f71d53e (diff) | |
parent | 863f3655955d58b16c93f99404dff715ea213489 (diff) |
Merge branch 'issues/671-guidance-on-no-reports'
-rw-r--r-- | perllib/FixMyStreet/App/Controller/My.pm | 3 | ||||
-rw-r--r-- | templates/web/default/my/my.html | 5 | ||||
-rw-r--r-- | templates/web/fixmystreet/my/my.html | 5 |
3 files changed, 13 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; diff --git a/templates/web/default/my/my.html b/templates/web/default/my/my.html index a6e4000df..48a33a1d2 100644 --- a/templates/web/default/my/my.html +++ b/templates/web/default/my/my.html @@ -13,6 +13,11 @@ <h1>[% loc('Your Reports') %]</h1> +[% IF ! has_content %] +[% tprintf( loc('You haven’t created any reports yet. <a href="%s">Report a problem now.</a>'), + c.uri_for('/') ) %] +[% END %] + [% INCLUDE 'pagination.html', pager = problems_pager, param = 'p' diff --git a/templates/web/fixmystreet/my/my.html b/templates/web/fixmystreet/my/my.html index 12f68bd80..389e907a3 100644 --- a/templates/web/fixmystreet/my/my.html +++ b/templates/web/fixmystreet/my/my.html @@ -13,6 +13,11 @@ <h1>[% loc('Your Reports') %]</h1> +[% IF ! has_content %] +[% tprintf( loc('You haven’t created any reports yet. <a href="%s">Report a problem now.</a>'), + c.uri_for('/') ) %] +[% END %] + [% IF c.cobrand.moniker == 'fixmybarangay' %] [% INCLUDE '_barangay_buttons.html' %] [% END %] |