diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-11-01 16:56:08 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-11-04 17:24:46 +0000 |
commit | 051093f803444d99c48d130d59dcfe2ba9759c90 (patch) | |
tree | 7407d9616442dc5bc9c81f29532b9a5b7704b6f5 /perllib/FixMyStreet/App/Controller/Around.pm | |
parent | b3bb51dab4f620463c551e7bbe6814d415ebf227 (diff) |
Add sort order options to list pages.
Includes newest, oldest, least/most recently updated, and most comments.
The default remains the same, which is last updated on /reports, and
newest on /my and /around (the latter plus not-in-view
sorted-by-distance ones).
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Around.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index cd96c3b5d..b4f94bb35 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -176,13 +176,16 @@ sub display_location : Private { # Check the category to filter by, if any, is valid $c->forward('check_and_stash_category'); + $c->forward( '/reports/stash_report_sort', [ 'created-desc' ]); # get the map features my ( $on_map_all, $on_map, $nearby, $distance ) = FixMyStreet::Map::map_features( $c, latitude => $latitude, longitude => $longitude, interval => $interval, categories => $c->stash->{filter_category}, - states => $c->stash->{filter_problem_states} ); + states => $c->stash->{filter_problem_states}, + order => $c->stash->{sort_order}, + ); # copy the found reports to the stash $c->stash->{on_map} = $on_map; @@ -293,13 +296,16 @@ sub ajax : Path('/ajax') { my $interval = $all_pins ? undef : $c->cobrand->on_map_default_max_pin_age; $c->forward( '/reports/stash_report_filter_status' ); + $c->forward( '/reports/stash_report_sort', [ 'created-desc' ]); # extract the data from the map my ( $on_map_all, $on_map_list, $nearby, $dist ) = FixMyStreet::Map::map_features($c, bbox => $bbox, interval => $interval, categories => [ $c->get_param_list('filter_category', 1) ], - states => $c->stash->{filter_problem_states} ); + states => $c->stash->{filter_problem_states}, + order => $c->stash->{sort_order}, + ); # create a list of all the pins my @pins = map { |