aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2019-11-07 10:49:34 +0000
committerDave Arter <davea@mysociety.org>2019-12-09 12:48:12 +0000
commit7deabe2f9f29b8129e8a38174e2292c41b121bfe (patch)
tree26ddd9f0757d6fc1ec5383bb818c44e576effefa
parentceaebc7bd3746cfeb90ba895e7480cb73b0fd756 (diff)
[TfL] Some categories only report on red routes.
-rw-r--r--templates/web/tfl/report/new/roads_message.html5
-rw-r--r--web/cobrands/tfl/assets.js68
2 files changed, 73 insertions, 0 deletions
diff --git a/templates/web/tfl/report/new/roads_message.html b/templates/web/tfl/report/new/roads_message.html
index 953febd29..ad9abd061 100644
--- a/templates/web/tfl/report/new/roads_message.html
+++ b/templates/web/tfl/report/new/roads_message.html
@@ -1,4 +1,9 @@
<div id="js-roads-responsibility" class="box-warning hidden">
+ <div id="js-not-tfl-road" class="hidden js-responsibility-message">
+ <p>Transport for London does not maintain this road. Please use
+ <a href="https://www.fixmystreet.com/">FixMyStreet.com</a> to report it
+ to the appropriate borough.</p>
+ </div>
<div id="js-not-an-asset" class="hidden js-responsibility-message">
<p><strong>Select a marker</strong></p>
<p>Please select <span class="js-roads-asset" data-original="an item">an item</span> from the map on which to make a report.</p>
diff --git a/web/cobrands/tfl/assets.js b/web/cobrands/tfl/assets.js
index ce8f3f650..24d95b465 100644
--- a/web/cobrands/tfl/assets.js
+++ b/web/cobrands/tfl/assets.js
@@ -60,4 +60,72 @@ fixmystreet.assets.add(asset_defaults, {
asset_item: 'bus stop'
});
+
+/* Red routes (TLRN) asset layer & handling for disabling form when red route
+ is not selected for specific categories. */
+
+var tlrn_stylemap = new OpenLayers.StyleMap({
+ 'default': new OpenLayers.Style({
+ fillColor: "#ff0000",
+ fillOpacity: 0.3,
+ strokeColor: "#ff0000",
+ strokeOpacity: 0.6,
+ strokeWidth: 2
+ })
+});
+
+
+/* Reports in these categories can only be made on a red route */
+var tlrn_categories = [
+ "All out - three or more street lights in a row",
+ "Blocked drain",
+ "Damage - general (Trees)",
+ "Dead animal in the carriageway or footway",
+ "Debris in the carriageway",
+ "Fallen Tree",
+ "Flooding",
+ "Flytipping",
+ "Graffiti / Flyposting (non-offensive)",
+ "Graffiti / Flyposting (offensive)",
+ "Graffiti / Flyposting on street light (non-offensive)",
+ "Graffiti / Flyposting on street light (offensive)",
+ "Grass Cutting and Hedges",
+ "Hoardings blocking carriageway or footway",
+ "Light on during daylight hours",
+ "Lights out in Pedestrian Subway",
+ "Low hanging branches and general maintenance",
+ "Manhole Cover - Damaged (rocking or noisy)",
+ "Manhole Cover - Missing",
+ "Mobile Crane Operation",
+ "Pavement Defect (uneven surface / cracked paving slab)",
+ "Pothole",
+ "Roadworks",
+ "Scaffolding blocking carriageway or footway",
+ "Single Light out (street light)",
+ "Standing water",
+ "Unstable hoardings",
+ "Unstable scaffolding",
+ "Worn out road markings"
+];
+
+fixmystreet.assets.add(defaults, {
+ http_options: {
+ url: "https://tilma.mysociety.org/mapserver/tfl",
+ params: {
+ TYPENAME: "RedRoutes"
+ }
+ },
+ max_resolution: 9.554628534317017,
+ road: true,
+ non_interactive: true,
+ asset_category: tlrn_categories,
+ nearest_radius: 0.1,
+ stylemap: tlrn_stylemap,
+ no_asset_msg_id: '#js-not-tfl-road',
+ actions: {
+ found: fixmystreet.message_controller.road_found,
+ not_found: fixmystreet.message_controller.road_not_found
+ }
+});
+
})();