aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Around.pm
Commit message (Collapse)AuthorAgeLines
* Internal JSON endpoint to get reports near a pointMatthew Somerville2019-02-25-0/+12
| | | | Unused right now, but will be soon, for the duplicate suggestion UI.
* Refactor nearby() to use named parameters not listMatthew Somerville2019-02-25-2/+1
|
* allow cobrands to override searching by refStruan Donald2018-10-09-4/+7
| | | | Add a cobrand hook to allow searching by reference to be overridden
* Deal with a variety of low-level test warnings.Matthew Somerville2018-10-04-0/+1
| | | | | | | | | | * Stop red warning being output by S3 bucket creation failure test * Make sure 'num_old_reports' is always a number on /around pages * Stop 'category_extra' being generated when unnecessary * Prevent warning printed in getservicerequestupdates.t * Prevent info lines from being output in develop.t * Remove line of #s in root.t * And an ID diag in zurich.t
* Allow asset layer display to be body dependent.Struan Donald2018-08-03-0/+5
| | | | | | | | | | | Return a list of associated bodies on around/new pages and in category ajax calls, and use that when deciding whether to show/hide layers. If the layer has no body information, then we show it as before, maybe based on category selected; if it does, it is only shown if the layer body matches the bodies for the point. As part of this create a new VectorAsset class to handle all the visibility changes for asset layers as it makes it a bit tidier.
* Add cobrand hook for custom searching on disambiguation pageDave Arter2018-07-04-0/+3
|
* Only display reports from last 6 months on around.Struan Donald2018-07-03-0/+1
| | | | | | | Add a checkbox to show older reports, plus if we get to the end of the new reports then instead of a Next button show a "show older" button that will reload the current page but with older reports also loaded. Wire it all up into the pushState code as well.
* ajax endpoint to return closest address.Struan Donald2018-05-09-0/+21
| | | | | | | | /ajax/closest will return ajax with details of the closest address to the lat/lon passed in from the Bing geocoder. Tidy up find_closest() to use overloaded string rather than passing in whether you want a string or not.
* Add help text metadata facility to categories.Matthew Somerville2018-05-08-1/+1
| | | | This is shown when reporting and in map list filters.
* Remove needless category mappings.Matthew Somerville2018-05-08-3/+2
| | | | | Both filter categories and new report category lists went through mappings to different data structures, which doesn't seem to be needed.
* Allow cobrands to give extra parameters for pins.Steven Day2018-05-02-0/+4
| | | | | | | So that you can build functionality to add extra limitations on to the map pins displayed. Useful for Collideoscope initially to filter out (or in) reports from the Department of Transport's Stats19 Data.
* Reinstate old pin loading URL for mobile app use.Matthew Somerville2018-01-25-2/+2
|
* Fix bug specifying category in URL on /around.Matthew Somerville2018-01-04-1/+1
| | | | The list of existing categories wasn't being checked correctly.
* Add some new Body model helper methods.Matthew Somerville2018-01-03-4/+1
| | | | And use the existing ones more.
* Bypass /around from postcode form if required.Dave Arter2017-12-13-12/+16
| | | | | | | | | | Cobrands can provide a `skip_around_page` method which means the user will be taken from the front page form directly to /report/new with a pin in the map at the location entered. This also preserves the category parameter, if specified on the front page form. Fixes #1730.
* Add pagination to around page.Matthew Somerville2017-11-06-5/+10
|
* Remove Show all pins link and on_map_list_limit.Matthew Somerville2017-11-06-9/+4
| | | | | /around will now show all reports all the time, but we are about to introduce pagination to stop that.
* Have /around ajax use same format as others.Matthew Somerville2017-11-02-7/+11
| | | | | Both /reports and /my work by using the same URL with ajax=1. We should use the same on /around for consistency.
* Merge branch 'bit-of-yaml-tidying'Matthew Somerville2017-10-11-4/+2
|\
| * Simplify geocode cache read/writing.Matthew Somerville2017-10-10-4/+2
| | | | | | | | Don't think the return data ever needs decoding.
* | Return page with "No results" if no ref found.Matthew Somerville2017-10-05-5/+3
| | | | | | | | | | | | This lookup is often performed by inspectors with appcache switched on, which means they were getting the intercepted Glitch page rather than a 404; give them a no results page instead.
* | Fix crash if large number given in postcode field.Dave Arter2017-10-05-2/+9
|/ | | | | | It was possible to trigger an SQL error by entering a value larger than that permitted by the `integer` SQL type. This commit instead returns a 404 in that case.
* Do not fetch pins server side if JS enabled.Matthew Somerville2017-08-17-0/+2
| | | | | | The page currently fetches the pins again client-side (as we don't know the extent of the map at the server point). I realise this isn't ideal, but should speed up the normal case quite a bit.
* Refactor /around list code to share with others.Matthew Somerville2017-08-17-82/+44
| | | | | Both /reports and /my share an ID and a /reports/ajax function, use these also on /around (and share ajax/non-ajax code).
* Set up translatable category columns.Matthew Somerville2017-08-10-1/+1
| | | | | | As category is used both for display and as a link between Problem and Contact tables, add `category_display` for use whenever a category is displayed.
* Set up translatable body name.Matthew Somerville2017-08-09-4/+4
|
* [Oxfordshire] Show problem state in marker tooltipZarino Zappia2017-06-10-1/+2
| | | | Add hook so that cobrands can change pin hover title.
* Fix issue with categories with regex characters.Matthew Somerville2017-04-13-3/+3
| | | | | | As the templates were using `grep`, they failed to match on a category such as "Footpaths (right of way)". Changing the stash variables to be hashes instead of lists makes checking for a key simpler. Fixes #1688.
* Add shortlist buttons to report lists.Matthew Somerville2017-01-12-0/+2
| | | | | | | This includes adding/removing reports from a user's shortlist, and manual reordering of a shortlist with up/down buttons. The backend code can cope with an item moving to any point in the list.
* Add sort order options to list pages.Matthew Somerville2016-11-04-2/+8
| | | | | | | | 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).
* Add ajax pin fetching to reports/my pages.Matthew Somerville2016-10-14-3/+0
| | | | | This matches the behaviour on /around, and prevents a refresh when changing the state or category filters.
* Allow multiple selections in report list filter.Zarino Zappia2016-10-13-8/+6
| | | | | | This lets people filter by multiple categories or states. It uses our jQuery multi-select plugin to turn the <select multiple>s into little overlay lists of checkboxes. HTML5 history is also supported.
* Add manage screen for editing priority/category.Matthew Somerville2016-09-09-1/+1
| | | | | | | This is a cut-down version of the full inspect screen. We truncate the co-ordinates just in case (they should be anyway but e.g. the test report isn't).
* Allow searching for reports with ref: prefix in postcode fieldDave Arter2016-08-22-0/+23
| | | | | | | | | Searches the `id` and `external_id` fields. This takes you directly to the report if only a single report matches, otherwise a disambiguation page is shown. For mysociety/fixmystreetforcouncils#16
* Refactor map pin/feature functions.Matthew Somerville2016-07-21-19/+30
|
* [UK Councils] Show all reports on cobrand /around mapDave Arter2016-07-08-0/+1
| | | | | | | | | | | | | | There is a concern that excluding district council reports from a two-tier council's cobrand's /around page might lead to duplicate reports or reports never being seen. This commit adds them to the map and the sidebar and displays the destination council in the report list item. Clicking the pin or the report link leads to the report on FMS.com. Reports sent to the a council other than the the active cobrand are shown as grey pins on the map, and the receiving council's name is shown in the sidebar list.
* Improve CSRF tokens and add to more forms.Matthew Somerville2016-06-20-0/+2
|
* Remove some unused cobrands.Matthew Somerville2016-04-20-2/+2
|
* Don't double-decode geocoded addresses.Matthew Somerville2016-03-15-2/+4
| | | | | | | | | Perl 5.20 introduced a version of Encode that errors on decoding already decoded content (rather than returning the same string). Whilst this can be taken as a bug in our code (although the decoding exists because some versions of FastCGI silently UTF-8 encode the content), in the changelog for Perl the only reference to this change is the line: "Encode has been upgraded from version 2.49 to 2.60.".
* Switch to JSON::MaybeXS, remove JSON::XS.Matthew Somerville2016-01-22-4/+3
| | | | | | Travis has Cpanel::JSON::XS preinstalled, which means that the build would fail there, as JSON::MaybeXS would try and upgrade JSON::XS to version 3 which the snapshot did not contain.
* Add state/category filters to base cobrand.Matthew Somerville2015-10-07-5/+0
| | | | | | | This removes the on map/nearby tabs, replacing them with one combined list. The styling is moved to the base, so that it is used on mobile too. A closed option is added to the existing dropdown, and the base/fixmystreet my templates are also combined. Fixes #1141.
* Combine some base/fixmystreet templates.Matthew Somerville2015-10-07-1/+1
| | | | | | | | The aim is to combine base and fixmystreet as much as possible, providing enough template/styling hooks for any cobrand. This commit removes the need for separate base/fixmystreet templates for the front page, almost all of the /around templates, the open graph headers, and the low level item list templates.
* Factor out all uses of param()/params.Matthew Somerville2015-07-07-17/+16
| | | | | | | Use a central get_param and get_param_list functions dependent on whether we're after a scalar or a list (almost always a scalar). This prevents any possibility of confusion where param() could return a list, or params->{} an arrayref.
* Refactor duplicated filter_status code into a single functionSteven Day2015-06-29-14/+2
|
* Rename map filtering GET param, remove unnecessary querySteven Day2015-06-29-12/+5
|
* Simplify default status filter for map pinsSteven Day2015-06-29-3/+3
|
* Populate category filter with all available categoriesSteven Day2015-06-29-9/+23
|
* Make load_and_group_problems respect status/category query paramsDave Arter2015-06-29-1/+1
| | | | | | | This allows the /reports page to be filtered using the status/category dropdowns. This is implemented in a manner that means the t/c params will override status/category.
* Use a consistent method of filtering by category on /around and /ajaxDave Arter2015-06-29-0/+13
|
* Allow cobrands to override the default 'state' filter for map pinsDave Arter2015-06-29-1/+2
|