diff options
-rw-r--r-- | templates/web/westminster/footer_extra_js.html | 2 | ||||
-rw-r--r-- | web/cobrands/westminster/roadworks.js | 32 |
2 files changed, 34 insertions, 0 deletions
diff --git a/templates/web/westminster/footer_extra_js.html b/templates/web/westminster/footer_extra_js.html index ec25926c5..f89cee3d4 100644 --- a/templates/web/westminster/footer_extra_js.html +++ b/templates/web/westminster/footer_extra_js.html @@ -3,6 +3,8 @@ IF bodyclass.match('mappage'); scripts.push( version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), version('/cobrands/fixmystreet/assets.js'), + version('/cobrands/fixmystreet-uk-councils/roadworks.js'), + version('/cobrands/westminster/roadworks.js'), version('/cobrands/westminster/assets.js'), ); END diff --git a/web/cobrands/westminster/roadworks.js b/web/cobrands/westminster/roadworks.js new file mode 100644 index 000000000..d7a30b63d --- /dev/null +++ b/web/cobrands/westminster/roadworks.js @@ -0,0 +1,32 @@ +(function(){ + +if (!fixmystreet.maps) { + return; +} + +var org_id = '1160'; +var body = "Westminster City Council"; +fixmystreet.assets.add(fixmystreet.roadworks.layer_future, { + http_options: { params: { organisation_id: org_id } }, + body: body +}); +fixmystreet.assets.add(fixmystreet.roadworks.layer_planned, { + http_options: { params: { organisation_id: org_id } }, + body: body +}); + +// Westminster want to also display the responsible party in roadworks messages +var original_display_message = fixmystreet.roadworks.display_message; +fixmystreet.roadworks.display_message = function(feature) { + var retval = original_display_message.apply(this, arguments); + + if (feature.attributes.promoter) { + var $dl = $(".js-roadworks-message-" + feature.layer.id + " dl"); + $dl.append("<dt>Responsibility</dt>"); + $dl.append($("<dd></dd>").text(feature.attributes.promoter)); + } + + return retval; +}; + +})(); |