diff options
author | Dave Whiteland <dave@mysociety.org> | 2013-08-04 18:20:46 +0100 |
---|---|---|
committer | Dave Whiteland <dave@mysociety.org> | 2013-09-05 17:31:05 +0100 |
commit | ea1ecdb43b879ce3355aa11167ae11f5f444bd65 (patch) | |
tree | f80c81534a892224edb567167b10b7686bf76989 | |
parent | e6fd3ecec2c369236969b6ccc390c2c074e5b0af (diff) |
show "no bodies" hint on empty body db
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 3 | ||||
-rw-r--r-- | templates/web/default/admin/index.html | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index 133c83024..69238f90f 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -130,6 +130,9 @@ sub index : Path : Args(0) { $c->stash->{categories} = $c->cobrand->problems->categories_summary(); + if ($c->config->{SHOW_ADMIN_HINTS}) { + $c->stash->{total_bodies} = $c->model('DB::Body')->count(); + } return 1; } diff --git a/templates/web/default/admin/index.html b/templates/web/default/admin/index.html index 2c5ee55db..d88897872 100644 --- a/templates/web/default/admin/index.html +++ b/templates/web/default/admin/index.html @@ -1,5 +1,13 @@ [% INCLUDE 'admin/header.html' title=loc('Summary') -%] +[% IF c.config.SHOW_ADMIN_HINTS AND total_bodies == 0 %] + <p class="fms-admin-info"> + [% loc('Currently no bodies have been created.') %] + <br> + [% tprintf( loc('You need to <a href="%s">add some bodies</a> (such as councils or departments) before any reports can be sent.'), c.uri_for('bodies')) %] + </p> +[% END %] + [%- BLOCK states -%] <h2>[% title %]</h2> |