diff options
author | Dave Whiteland <dave@mysociety.org> | 2013-08-15 08:17:57 +0100 |
---|---|---|
committer | Dave Whiteland <dave@mysociety.org> | 2013-09-05 17:31:07 +0100 |
commit | 404b8328ec8022513df39723112a2084be341e61 (patch) | |
tree | 7ce4e6e7f31cd85fdbea09abd6a8a4ab14f69db6 | |
parent | 86a366703507d965622a059c56588aeb1a72bc47 (diff) |
show warning on body with no live contacts
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 1 | ||||
-rw-r--r-- | templates/web/default/admin/body.html | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index 5393e98bb..5e98c5d04 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -432,6 +432,7 @@ sub display_contacts : Private { my $contacts = $c->stash->{body}->contacts->search(undef, { order_by => [ 'category' ] } ); $c->stash->{contacts} = $contacts; + $c->stash->{live_contacts} = $contacts->search({ deleted => 0 }); if ( $c->req->param('text') && $c->req->param('text') == 1 ) { $c->stash->{template} = 'admin/council_contacts.txt'; diff --git a/templates/web/default/admin/body.html b/templates/web/default/admin/body.html index 8fd11d694..7e57756be 100644 --- a/templates/web/default/admin/body.html +++ b/templates/web/default/admin/body.html @@ -28,6 +28,14 @@ <p class="error">Do not give these out except to people at the council.</p> [% END %] +[% IF live_contacts == 0 %] + <p class="fms-admin-warning"> + [% loc("This body has no contacts. This means that currently problems reported to this body <strong>will not be sent</strong>.") %] + <br> + [% loc("Add a contact using the form below.") %] + </p> +[% END %] + <form method="post" action="[% c.uri_for('body', body_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> <table cellspacing="0" cellpadding="2" border="1"> |