diff options
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 7 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/My.pm | 6 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Reports.pm | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/View/Web.pm | 11 |
4 files changed, 16 insertions, 11 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index 723684793..4aa695ae5 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -28,7 +28,7 @@ If no search redirect back to the homepage. =cut -sub around_index : Path : Args(0) { +sub index : Path : Args(0) { my ( $self, $c ) = @_; # handle old coord systems @@ -302,15 +302,10 @@ sub ajax : Path('/ajax') { 'around/on_map_list_items.html', { on_map => $on_map, around_map => $around_map } ); - my $around_map_list_html = $c->render_fragment( - 'around/around_map_list_items.html', - { on_map => $on_map, around_map => $around_map } - ); # JSON encode the response my $json = { pins => $pins }; $json->{current} = $on_map_list_html if $on_map_list_html; - $json->{current_near} = $around_map_list_html if $around_map_list_html; my $body = JSON->new->utf8(1)->encode($json); $c->res->body($body); } diff --git a/perllib/FixMyStreet/App/Controller/My.pm b/perllib/FixMyStreet/App/Controller/My.pm index 9db9386f5..3c4ce2cf7 100644 --- a/perllib/FixMyStreet/App/Controller/My.pm +++ b/perllib/FixMyStreet/App/Controller/My.pm @@ -31,7 +31,7 @@ sub my : Path : Args(0) { $c->forward( '/reports/stash_report_filter_status' ); my $pins = []; - my $problems = {}; + my $problems = []; my $states = $c->stash->{filter_problem_states}; my $params = { @@ -60,9 +60,7 @@ sub my : Path : Args(0) { id => $problem->id, title => $problem->title, }; - my $state = $problem->is_fixed ? 'fixed' : $problem->is_closed ? 'closed' : 'confirmed'; - push @{ $problems->{$state} }, $problem; - push @{ $problems->{all} }, $problem; + push @$problems, $problem; } $c->stash->{problems_pager} = $rs->pager; $c->stash->{problems} = $problems; diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm index 3bd7e592b..407fc625e 100644 --- a/perllib/FixMyStreet/App/Controller/Reports.pm +++ b/perllib/FixMyStreet/App/Controller/Reports.pm @@ -492,6 +492,9 @@ sub stash_report_filter_status : Private { } elsif ( $status eq 'open' ) { $c->stash->{filter_status} = 'open'; $c->stash->{filter_problem_states} = FixMyStreet::DB::Result::Problem->open_states(); + } elsif ( $status eq 'closed' ) { + $c->stash->{filter_status} = 'closed'; + $c->stash->{filter_problem_states} = FixMyStreet::DB::Result::Problem->closed_states(); } elsif ( $status eq 'fixed' ) { $c->stash->{filter_status} = 'fixed'; $c->stash->{filter_problem_states} = FixMyStreet::DB::Result::Problem->fixed_states(); diff --git a/perllib/FixMyStreet/App/View/Web.pm b/perllib/FixMyStreet/App/View/Web.pm index 37a81e444..a92021f0c 100644 --- a/perllib/FixMyStreet/App/View/Web.pm +++ b/perllib/FixMyStreet/App/View/Web.pm @@ -11,7 +11,7 @@ use Utils; __PACKAGE__->config( TEMPLATE_EXTENSION => '.html', - INCLUDE_PATH => [ # + INCLUDE_PATH => [ FixMyStreet->path_to( 'templates', 'web', 'base' ), ], ENCODING => 'utf8', @@ -38,6 +38,15 @@ TT View for FixMyStreet::App. =cut +# Override parent function so that errors are only logged once. +sub _rendering_error { + my ($self, $c, $err) = @_; + my $error = qq/Couldn't render template "$err"/; + # $c->log->error($error); + $c->error($error); + return 0; +} + =head2 loc [% loc('Some text to localize', 'Optional comment for translator') %] |