diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Alert.pm | 14 | ||||
-rw-r--r-- | templates/web/default/alert/choose.html | 14 | ||||
-rw-r--r-- | templates/web/default/alert/index.html | 4 |
3 files changed, 25 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Alert.pm b/perllib/FixMyStreet/App/Controller/Alert.pm index bdcaccc3a..db2d06844 100644 --- a/perllib/FixMyStreet/App/Controller/Alert.pm +++ b/perllib/FixMyStreet/App/Controller/Alert.pm @@ -74,13 +74,13 @@ sub list :Path('list') :Args(0) { # Try to create a location for whatever we have unless ($c->forward('/location/determine_location_from_coords') || $c->forward('/location/determine_location_from_pc') ) { - if ( $c->stash->{possible_location_matches} ) { - $c->stash->{choose_target_uri} = $c->uri_for( '/alert/list' ); - $c->detach('choose'); - } - # FIXME: do error display here -# return FixMyStreet::Geocode::list_choices($error, '/alert', $q) if ref($error) eq 'ARRAY'; -# return alert_front_page($q, $error) if $error; + + if ( $c->stash->{possible_location_matches} ) { + $c->stash->{choose_target_uri} = $c->uri_for( '/alert/list' ); + $c->detach('choose'); + } + + $c->go('index') if $c->stash->{ location_error }; } $c->log->debug( $_ ) for ( $c->stash->{pc}, $c->stash->{latitude}, $c->stash->{longitude} ); diff --git a/templates/web/default/alert/choose.html b/templates/web/default/alert/choose.html new file mode 100644 index 000000000..ef632e2d1 --- /dev/null +++ b/templates/web/default/alert/choose.html @@ -0,0 +1,14 @@ +[% INCLUDE 'header.html', title => loc('Local RSS feeds and email alerts') %] + +<h1>[% loc('Local RSS feeds and email alerts') %]</h1> + +[% IF possible_location_matches %] + <p>[% loc('We found more than one match for that location. We show up to ten matches, please try a different search if yours is not here.') %]</p> + <ul class="pc_alternatives"> + [% FOREACH match IN possible_location_matches %] + <li><a href="[% choose_target_uri %]?pc=[% match | uri %]">[% match | html %]</a></li> + [% END %] + </ul> +[% END %] + +[% INCLUDE 'footer.html' %] diff --git a/templates/web/default/alert/index.html b/templates/web/default/alert/index.html index a62b743f5..fa38d8b7d 100644 --- a/templates/web/default/alert/index.html +++ b/templates/web/default/alert/index.html @@ -8,6 +8,10 @@ alerts for all problems within a particular ward or council, or all problems within a certain distance of a particular location.') %] </p> +[% IF location_error %] + <ul class="error"><li>[% location_error | html %]</li></ul> +[% END %] + <form method="get" action="/alert/list"> <p> [% loc('To find out what local alerts we have for you, please enter your GB |