aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--templates/web/fixmystreet.com/footer_extra_js.html1
-rw-r--r--templates/web/tfl/footer_extra_js.html13
-rw-r--r--templates/web/tfl/report/new/roads_message.html6
-rw-r--r--web/cobrands/tfl/assets.js63
4 files changed, 83 insertions, 0 deletions
diff --git a/templates/web/fixmystreet.com/footer_extra_js.html b/templates/web/fixmystreet.com/footer_extra_js.html
index d5209b804..2dbe8cc96 100644
--- a/templates/web/fixmystreet.com/footer_extra_js.html
+++ b/templates/web/fixmystreet.com/footer_extra_js.html
@@ -17,6 +17,7 @@ IF bodyclass.match('mappage');
scripts.push( version('/cobrands/hounslow/assets.js') );
scripts.push( version('/cobrands/westminster/assets.js') );
scripts.push( version('/cobrands/peterborough/js.js') );
+ scripts.push( version('/cobrands/tfl/assets.js') );
scripts.push( version('/cobrands/highways/assets.js') );
scripts.push( version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js') );
scripts.push(
diff --git a/templates/web/tfl/footer_extra_js.html b/templates/web/tfl/footer_extra_js.html
new file mode 100644
index 000000000..6a8713695
--- /dev/null
+++ b/templates/web/tfl/footer_extra_js.html
@@ -0,0 +1,13 @@
+[% scripts.push(
+ version('/cobrands/fixmystreet-uk-councils/js.js'),
+) %]
+[%~
+IF bodyclass.match('mappage');
+ scripts.push(
+ version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'),
+ version('/cobrands/fixmystreet/assets.js'),
+ version('/cobrands/highways/assets.js'),
+ version('/cobrands/tfl/assets.js'),
+ );
+END
+%]
diff --git a/templates/web/tfl/report/new/roads_message.html b/templates/web/tfl/report/new/roads_message.html
new file mode 100644
index 000000000..953febd29
--- /dev/null
+++ b/templates/web/tfl/report/new/roads_message.html
@@ -0,0 +1,6 @@
+<div id="js-roads-responsibility" class="box-warning hidden">
+ <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>
+ </div>
+</div>
diff --git a/web/cobrands/tfl/assets.js b/web/cobrands/tfl/assets.js
new file mode 100644
index 000000000..ce8f3f650
--- /dev/null
+++ b/web/cobrands/tfl/assets.js
@@ -0,0 +1,63 @@
+(function(){
+
+if (!fixmystreet.maps) {
+ return;
+}
+
+var defaults = {
+ http_options: {
+ url: "https://tilma.mysociety.org/mapserver/tfl",
+ params: {
+ SERVICE: "WFS",
+ VERSION: "1.1.0",
+ REQUEST: "GetFeature",
+ SRSNAME: "urn:ogc:def:crs:EPSG::3857"
+ }
+ },
+ asset_type: 'spot',
+ max_resolution: 2.388657133579254,
+ min_resolution: 0.5971642833948135,
+ geometryName: 'msGeometry',
+ srsName: "EPSG:3857",
+ strategy_class: OpenLayers.Strategy.FixMyStreet,
+ body: "TfL"
+};
+
+var asset_defaults = $.extend(true, {}, defaults, {
+ select_action: true,
+ no_asset_msg_id: '#js-not-an-asset',
+ actions: {
+ asset_found: fixmystreet.message_controller.asset_found,
+ asset_not_found: fixmystreet.message_controller.asset_not_found
+ }
+});
+
+fixmystreet.assets.add(asset_defaults, {
+ http_options: {
+ params: {
+ TYPENAME: "trafficsignals"
+ }
+ },
+ asset_id_field: 'Site',
+ attributes: {
+ site: 'Site',
+ },
+ asset_group: "Traffic Lights",
+ asset_item: 'traffic signal'
+});
+
+fixmystreet.assets.add(asset_defaults, {
+ http_options: {
+ params: {
+ TYPENAME: "busstops"
+ }
+ },
+ asset_id_field: 'STOP_CODE',
+ attributes: {
+ stop_code: 'STOP_CODE',
+ },
+ asset_group: "Bus Stops and Shelters",
+ asset_item: 'bus stop'
+});
+
+})();