| Commit message (Collapse) | Author | Age | Lines |
| |
|
|
|
|
| |
Fixes #1649.
|
|
|
|
| |
Fixes #2294
|
|
|
|
|
| |
Cobrands might include the fields elsewhere, e.g. in moderation.
Also only use 6 decimal places.
|
|
|
|
|
|
| |
replace_query_parameter() was stringifying select multiples, meaning
they were incorrectly recorded by the pushState and thus breaking on
navigation.
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes #2016.
When you load a page that includes either a problem report, or is
centered on a location, the "Report a problem" button in the nav bar
(that normally takes you to the homepage) becomes a "Report a(nother)
problem here" button, that leads directly to the new report form
for the location in question.
On full map pages (/around and any /report/<id> pages loaded via it)
the reporting form will be rendered client-side, avoiding a full page
reload.
On pages lacking the full map (eg: missing fixmystreet.bbox_strategy),
namely /reports/<area> and any /report/<id> page that hasn’t been
client-side loaded via /around, we fall back to a server-side page load.
Finally, as you’d expect, the text and URL for the button dynamically
update as you move around the map, or switch between the different
client-side states of the reporting flow.
We also hide the button entirely when you’re reporting a problem,
which was something suggested a long time ago.
|
|/
|
|
|
|
|
|
| |
If an inspector clicks on a report from an around page the code to setup
the pin dragging needs to be called. This adds a method to the map to
allow the setup code to be called on report load.
Fixes #2073
|
|
|
|
|
|
|
| |
Also add body name to layer defaults, so they are only used where appropriate.
Switch mapit area javascript calls to GeoJSON, so we can drop KML support in
OpenLayers.wfs.js which saves a small amount of bandwidth.
|
|
|
|
|
|
|
|
|
|
|
| |
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 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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using `$('.pagination')` everywhere in javascript was causing issues
because that returns two elements. This was especially true when
triggering events as it was triggering two events so the data was being
loaded twice. This was also resulting in resetting the page to the
initial page so clicking the back button would always return to the
first page of results.
This also sets `use_page` when clicking the back button otherwise it
also loads the initial page.
|
|
|
|
|
| |
Categories could contain commas, so splitting on comma is not good enough.
Let’s escape the fields as if it’s a line in CSV. Fixes #2166.
|
|
|
|
|
| |
The fix in de36c49d1 broke pin clicking on other
map list pages, such as /my and /reports.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On a mobile device that implements pointer events, there are two events that
can happen on an /around page – touching the map starts a new report (or goes
back to the map if already on a report page); touching a pin pulls in that
report’s page. The map touch, which uses an OpenLayers.Handler.Click, operates
on click, whereas the pin touch, which uses an OpenLayers.Handler.Feature,
operates on touchstart. Neither event cancels the other, which means you can
end up either starting a new report, and then it tries to pull in an undefined
pin ID report and errors, or the pin report loads and then you instantly go
back to the map page.
In order to work around this, we disable the map click control when the feature
control event starts, and reactivate once the report data has been loaded.
|
|
|
|
|
|
|
|
|
| |
Going back to /around from /report/new can trigger loadend (and the
spinner hiding function) twice (if the strategy activation starts a
read), with triggerRead aborting that read and triggering the event
itself. This means the spinner is not displayed, as the count falls
below 0. We could pin the count above 0, but instead let’s log each
layer ID while ‘active’ and switch off when they’re all gone.
|
| |
|
|
|
|
| |
This is already defined in fixmystreet.utils further up.
|
|
|
|
|
|
|
|
|
|
| |
The "coerce pin ID to integer" behaviour to fix a previous issue was
coercing undefined to NaN, which then caused other problems with the
new report pin, such as fading out when hovered, and being the wrong
size.
Also improve the cursor handling, showing the grab/ grabbing cursors
where available.
|
|
|
|
|
|
| |
If you started a new report by clicking the map before the
server had responded with the map list pins, when they did
arrive they would replace the new report pin.
|
|
|
|
| |
Remove 'hooks' functions, and Split out USRN handling to its own object.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some cobrands require reports to include the USRN of the clicked
road. This commit allows an asset layer to be added and designated
as a 'USRN provider' by setting its `usrn_field` property when calling
fixmystreet.assets.add.
Initially this feature used OpenLayers' getFeatureFromEvent method,
however that doesn't work if the layer isn't topmost. This is because it
uses the clicked element in the DOM to determine which feature was
clicked. This doesn't work if the layer you're trying to get the feature
from wasn't actually the DOM element that was clicked.
Instead, we add a new method, OpenLayers.Layer.Vector.getFeatureAtPoint
method which takes a Point object and iterates through the features'
geometries to find the matching point.
To make things a little more user-friendly, if an asset isn't clicked
directly we find the closest to the clicked point and use that for the
USRN. To accomplish this, this commit factors out the ‘select nearest
asset’ code into a new method OpenLayers.Layer.Vector.getNearestFeature,
which takes a Point and a distance threshold and finds the nearest
feature.
|
| |
|
| |
|
|
|
|
| |
The photo JavaScript needs including in case a report is pulled in.
|
|
|
|
|
| |
This also fixes an inconsistency between what you can see on the map and the
list of reports underneath.
|
|
|
|
| |
The /my page uses a Fixed strategy which cannot do this.
|
| |
|
|
|
|
| |
An experiment towards fixing #525.
|
| |
|
|
|
|
|
| |
/around will now show all reports all the time, but we are about to
introduce pagination to stop that.
|
|
|
|
|
| |
Both /reports and /my work by using the same URL with ajax=1. We should
use the same on /around for consistency.
|
|
|
|
|
|
|
|
|
|
| |
The JavaScript assumes it is, but due to a string comparison in
DBIx::Class [1] when a has_many prefetch is in use (as it is on
a /reports page when a shortlist-using staff user is logged in)
all IDs bar the first were being given an internal string value
and JSON encoding was outputting them as a string.
[1] https://github.com/dbsrgits/dbix-class/blob/v0.08209/lib/DBIx/Class/ResultSet.pm#L1331
|
| |
|
|
|
|
|
| |
The change in 17e38922 would not deal with the URL construted by the
map permalink code, or the redirect after inspection.
|
|
|
|
|
| |
If the list was replaced by JavaScript, the event handlers were being
dropped. Switch the handlers to the parent that remains present.
|
|
|
|
|
| |
Both /reports and /my share an ID and a /reports/ajax function, use
these also on /around (and share ajax/non-ajax code).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A seemingly unrelated change in ef6ffbdb was causing JS errors
on the /reports page which meant the map loading spinner
was permanently present. This commit fixes that, and also fixes
another bug which was uncovered where the ?ajax=1 param was
being ignored by the Zürich /reports page, leading to HTML
being returned and another JS error.
The call to `new OpenLayers.Bounds` in
OpenLayers.Strategy.FixMyStreet.getMapBounds was causing
three of the 4 bounds params to be lost when run on OpenLayers
2.11, as this version doesn’t accept an array to the Bounds
constructor. This in turn was using an invalid `bbox` parameter
(only the west value was present) in the AJAX call to /reports
which returned a 500 error. This then crashed the JS and caused
the loading spinner to get stuck.
|
| |
|
|
|
|
|
| |
Add hook for post-title field content in report form.
Update translations.
|
|
|
|
|
|
| |
Previously, a green marker would be used for reports as they were being
created. Now, cobrands can override `pin_new_report_colour` to show a
different pin image when users are creating a new report.
|
| |
|
|
|
|
| |
If zoom level is >= 14, then inspectors can click a button that marks all reports in the map view as shortlisted
|
|
|
|
|
|
|
|
|
| |
Update the reports with a bounding box, similar to on around pages.
This is made slightly trickier because we don't want to do anything
on page load (we already have the pins), we need to reload when the
zoom changes, and we don't want the strategy to get confused by its
first redraw, e.g. on pin hover, We also need to turn off the zoom-
to-bounds if we've got a bounding box in the URL.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
- Use Problem->pin_data for single report page
- Promote markers_highlight to fixmystreet.maps API
We want to highlight map pins on the duplicate report selection UI, so let's use
what's already there instead of writing something new.
- Make sure duplicate report pins aren’t draggable
|
|
|
|
|
| |
This lets us version and cache-bust it as necessary, plus let
browser decide how to load it, we're always going to need it.
|