diff options
23 files changed, 51 insertions, 171 deletions
diff --git a/templates/web/bathnes/footer_extra_js.html b/templates/web/bathnes/footer_extra_js.html index 3d7cdb0dc..e46e103e8 100644 --- a/templates/web/bathnes/footer_extra_js.html +++ b/templates/web/bathnes/footer_extra_js.html @@ -1,15 +1,4 @@ -[%~ -IF bodyclass.match('mappage'); - scripts.push( - version('/cobrands/fixmystreet-uk-councils/js.js'), - version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'), - version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), - version('/cobrands/fixmystreet/assets.js'), - version('/cobrands/bathnes/assets.js'), - version('/cobrands/highways/assets.js'), - ); -END -%] +[% PROCESS 'footer_extra_js_base.html' highways=1 cobrand_js=1 validation=1 %] [%~ SET council_area_id = c.cobrand.council_area_id; IF c.user_exists AND ((c.user.from_body AND c.user.from_body.areas.$council_area_id) OR c.user.is_superuser); diff --git a/templates/web/bexley/footer_extra_js.html b/templates/web/bexley/footer_extra_js.html index 9057d1d0f..7369f7147 100644 --- a/templates/web/bexley/footer_extra_js.html +++ b/templates/web/bexley/footer_extra_js.html @@ -1,12 +1 @@ -[%~ -IF bodyclass.match('mappage'); - scripts.push( - version('/cobrands/fixmystreet-uk-councils/js.js'), - version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), - version('/cobrands/fixmystreet/assets.js'), - version('/cobrands/bexley/js.js'), - version('/cobrands/tfl/assets.js'), - version('/cobrands/highways/assets.js'), - ); -END -%] +[% PROCESS 'footer_extra_js_base.html' highways=1 cobrand_js=1 tfl=1 %] diff --git a/templates/web/bristol/footer_extra_js.html b/templates/web/bristol/footer_extra_js.html index 0387fc82a..3965c9d1e 100644 --- a/templates/web/bristol/footer_extra_js.html +++ b/templates/web/bristol/footer_extra_js.html @@ -1,11 +1 @@ -[%~ -IF bodyclass.match('mappage'); - scripts.push( - version('/cobrands/fixmystreet-uk-councils/js.js'), - version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), - version('/cobrands/fixmystreet/assets.js'), - version('/cobrands/bristol/assets.js'), - version('/cobrands/highways/assets.js'), - ); -END -%] +[% PROCESS 'footer_extra_js_base.html' highways=1 cobrand_js=1 ~%] diff --git a/templates/web/bromley/footer_extra_js.html b/templates/web/bromley/footer_extra_js.html index 9e0aeb9b2..c3bad670c 100644 --- a/templates/web/bromley/footer_extra_js.html +++ b/templates/web/bromley/footer_extra_js.html @@ -2,14 +2,9 @@ version('/jslib/jquery-1.7.2.min.js'), version('/cobrands/bromley/a-z-nav.js'), ) %] +[% PROCESS 'footer_extra_js_base.html' cobrand_js=1 validation=1 tfl=1 %] [% IF bodyclass.match('mappage'); scripts.push( - version('/cobrands/fixmystreet-uk-councils/js.js'), - version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'), - version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), - version('/cobrands/fixmystreet/assets.js'), version('/cobrands/bromley/map.js'), - version('/cobrands/bromley/assets.js'), - version('/cobrands/tfl/assets.js'), ); END %] diff --git a/templates/web/buckinghamshire/footer_extra_js.html b/templates/web/buckinghamshire/footer_extra_js.html index 662c936e3..9132ead25 100644 --- a/templates/web/buckinghamshire/footer_extra_js.html +++ b/templates/web/buckinghamshire/footer_extra_js.html @@ -1,12 +1 @@ -[%~ -IF bodyclass.match('mappage'); - scripts.push( - version('/cobrands/fixmystreet-uk-councils/js.js'), - version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'), - version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), - version('/cobrands/fixmystreet/assets.js'), - version('/cobrands/buckinghamshire/assets.js'), - version('/cobrands/highways/assets.js'), - ); -END -%] +[% PROCESS 'footer_extra_js_base.html' highways=1 cobrand_js=1 validation=1 %] diff --git a/templates/web/cheshireeast/footer_extra_js.html b/templates/web/cheshireeast/footer_extra_js.html index c30722fbd..9132ead25 100644 --- a/templates/web/cheshireeast/footer_extra_js.html +++ b/templates/web/cheshireeast/footer_extra_js.html @@ -1,12 +1 @@ -[%~ -IF bodyclass.match('mappage'); - scripts.push( - version('/cobrands/fixmystreet-uk-councils/js.js'), - version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'), - version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), - version('/cobrands/fixmystreet/assets.js'), - version('/cobrands/cheshireeast/assets.js'), - version('/cobrands/highways/assets.js'), - ); -END -%] +[% PROCESS 'footer_extra_js_base.html' highways=1 cobrand_js=1 validation=1 %] diff --git a/templates/web/fixmystreet-uk-councils/footer_extra_js.html b/templates/web/fixmystreet-uk-councils/footer_extra_js.html index 010528851..09f2bf87d 100644 --- a/templates/web/fixmystreet-uk-councils/footer_extra_js.html +++ b/templates/web/fixmystreet-uk-councils/footer_extra_js.html @@ -1,10 +1 @@ -[%~ -IF bodyclass.match('mappage'); - scripts.push( - version('/cobrands/fixmystreet-uk-councils/js.js'), - version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), - version('/cobrands/fixmystreet/assets.js'), - version('/cobrands/highways/assets.js'), - ); -END -%] +[% PROCESS 'footer_extra_js_base.html' highways=1 ~%] diff --git a/templates/web/fixmystreet-uk-councils/footer_extra_js_base.html b/templates/web/fixmystreet-uk-councils/footer_extra_js_base.html new file mode 100644 index 000000000..58e2872e3 --- /dev/null +++ b/templates/web/fixmystreet-uk-councils/footer_extra_js_base.html @@ -0,0 +1,29 @@ +[% +IF bodyclass.match('mappage'); + scripts.push( + version('/cobrands/fixmystreet-uk-councils/js.js'), + version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), + version('/cobrands/fixmystreet/assets.js'), + ); + IF validation; + scripts.push( + version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'), + ); + END; + IF cobrand_js; + scripts.push( + version('/cobrands/' _ c.cobrand.moniker _ '/assets.js'), + ); + END; + IF highways; + scripts.push( + version('/cobrands/highways/assets.js'), + ); + END; + IF tfl; + scripts.push( + version('/cobrands/tfl/assets.js'), + ); + END; +END +~%] diff --git a/templates/web/fixmystreet.com/footer_extra_js.html b/templates/web/fixmystreet.com/footer_extra_js.html index 2dbe8cc96..d2fe1e588 100644 --- a/templates/web/fixmystreet.com/footer_extra_js.html +++ b/templates/web/fixmystreet.com/footer_extra_js.html @@ -6,7 +6,7 @@ IF bodyclass.match('mappage'); scripts.push( version('/cobrands/fixmystreet/assets.js') ); scripts.push( version('/cobrands/fixmystreet-uk-councils/alloy.js') ); scripts.push( version('/cobrands/bathnes/assets.js') ); - scripts.push( version('/cobrands/bexley/js.js') ); + scripts.push( version('/cobrands/bexley/assets.js') ); scripts.push( version('/cobrands/bristol/assets.js') ); scripts.push( version('/cobrands/bromley/assets.js') ); scripts.push( version('/cobrands/buckinghamshire/assets.js') ); @@ -16,7 +16,7 @@ IF bodyclass.match('mappage'); scripts.push( version('/cobrands/northamptonshire/assets.js') ); 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/peterborough/assets.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') ); diff --git a/templates/web/greenwich/footer_extra_js.html b/templates/web/greenwich/footer_extra_js.html index 9174ade44..8cbe4c48f 100644 --- a/templates/web/greenwich/footer_extra_js.html +++ b/templates/web/greenwich/footer_extra_js.html @@ -1,11 +1 @@ -[%~ -IF bodyclass.match('mappage'); - scripts.push( - version('/cobrands/fixmystreet-uk-councils/js.js'), - version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), - version('/cobrands/fixmystreet/assets.js'), - version('/cobrands/highways/assets.js'), - version('/cobrands/tfl/assets.js'), - ); -END -%] +[% PROCESS 'footer_extra_js_base.html' highways=1 tfl=1 %] diff --git a/templates/web/hounslow/footer_extra_js.html b/templates/web/hounslow/footer_extra_js.html index af21bb654..081ec3a12 100644 --- a/templates/web/hounslow/footer_extra_js.html +++ b/templates/web/hounslow/footer_extra_js.html @@ -1,14 +1,8 @@ +[% PROCESS 'footer_extra_js_base.html' highways=1 cobrand_js=1 validation=1 tfl=1 %] [% IF bodyclass.match('mappage'); scripts.push( - version('/cobrands/fixmystreet-uk-councils/js.js'), - version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'), - version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), - version('/cobrands/fixmystreet/assets.js'), - version('/cobrands/highways/assets.js'), version('/cobrands/hounslow/js.js'), - version('/cobrands/hounslow/assets.js'), - version('/cobrands/tfl/assets.js'), ); END %] diff --git a/templates/web/isleofwight/footer_extra_js.html b/templates/web/isleofwight/footer_extra_js.html index d7a6b0cc5..a7cea7811 100644 --- a/templates/web/isleofwight/footer_extra_js.html +++ b/templates/web/isleofwight/footer_extra_js.html @@ -1,9 +1,6 @@ +[% PROCESS 'footer_extra_js_base.html' cobrand_js=1 %] [% IF bodyclass.match('mappage'); scripts.push( - version('/cobrands/fixmystreet-uk-councils/js.js'), - version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), - version('/cobrands/fixmystreet/assets.js'), version('/cobrands/isleofwight/js.js'), - version('/cobrands/isleofwight/assets.js'), ); END %] diff --git a/templates/web/lincolnshire/footer_extra_js.html b/templates/web/lincolnshire/footer_extra_js.html index b1bc9b739..9132ead25 100644 --- a/templates/web/lincolnshire/footer_extra_js.html +++ b/templates/web/lincolnshire/footer_extra_js.html @@ -1,12 +1 @@ -[%~ -IF bodyclass.match('mappage'); - scripts.push( - version('/cobrands/fixmystreet-uk-councils/js.js'), - version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'), - version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), - version('/cobrands/fixmystreet/assets.js'), - version('/cobrands/lincolnshire/assets.js'), - version('/cobrands/highways/assets.js'), - ); -END -%] +[% PROCESS 'footer_extra_js_base.html' highways=1 cobrand_js=1 validation=1 %] diff --git a/templates/web/northamptonshire/footer_extra_js.html b/templates/web/northamptonshire/footer_extra_js.html index 3832007a8..fbd33dd11 100644 --- a/templates/web/northamptonshire/footer_extra_js.html +++ b/templates/web/northamptonshire/footer_extra_js.html @@ -1,12 +1,7 @@ [% IF bodyclass.match('mappage'); scripts.push( - version('/cobrands/fixmystreet-uk-councils/js.js'), - version('/cobrands/fixmystreet/assets.js'), version('/cobrands/fixmystreet-uk-councils/alloy.js'), - version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), - version('/cobrands/northamptonshire/assets.js'), - version('/cobrands/highways/assets.js'), - version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'), ); END %] +[% PROCESS 'footer_extra_js_base.html' highways=1 cobrand_js=1 validation=1 %] diff --git a/templates/web/oxfordshire/footer_extra_js.html b/templates/web/oxfordshire/footer_extra_js.html index 1914e1520..88fc006e7 100644 --- a/templates/web/oxfordshire/footer_extra_js.html +++ b/templates/web/oxfordshire/footer_extra_js.html @@ -1,11 +1 @@ -[% -IF bodyclass.match('mappage'); - scripts.push( - version('/cobrands/fixmystreet-uk-councils/js.js'), - version('/cobrands/fixmystreet/assets.js'), - version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), - version('/cobrands/highways/assets.js'), - version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'), - ); -END; -%] +[% PROCESS 'footer_extra_js_base.html' highways=1 validation=1 %] diff --git a/templates/web/peterborough/footer_extra_js.html b/templates/web/peterborough/footer_extra_js.html index dbb103207..9132ead25 100644 --- a/templates/web/peterborough/footer_extra_js.html +++ b/templates/web/peterborough/footer_extra_js.html @@ -1,12 +1 @@ -[%~ -IF bodyclass.match('mappage'); - scripts.push( - version('/cobrands/fixmystreet-uk-councils/js.js'), - version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'), - version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), - version('/cobrands/fixmystreet/assets.js'), - version('/cobrands/peterborough/js.js'), - version('/cobrands/highways/assets.js'), - ); -END -%] +[% PROCESS 'footer_extra_js_base.html' highways=1 cobrand_js=1 validation=1 %] diff --git a/templates/web/rutland/footer_extra_js.html b/templates/web/rutland/footer_extra_js.html index b9384c218..88fc006e7 100644 --- a/templates/web/rutland/footer_extra_js.html +++ b/templates/web/rutland/footer_extra_js.html @@ -1,11 +1 @@ -[%~ -IF bodyclass.match('mappage'); - scripts.push( - version('/cobrands/fixmystreet-uk-councils/js.js'), - version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'), - version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), - version('/cobrands/fixmystreet/assets.js'), - version('/cobrands/highways/assets.js'), - ); -END -%] +[% PROCESS 'footer_extra_js_base.html' highways=1 validation=1 %] diff --git a/templates/web/tfl/footer_extra_js.html b/templates/web/tfl/footer_extra_js.html index 3c4a2f8af..a8ccc80d0 100644 --- a/templates/web/tfl/footer_extra_js.html +++ b/templates/web/tfl/footer_extra_js.html @@ -1,15 +1,11 @@ [% scripts.push( version('/jslib/jquery-1.7.2.min.js'), ) %] +[% PROCESS 'footer_extra_js_base.html' highways=1 cobrand_js=1 %] [%~ IF bodyclass.match('mappage'); scripts.push( - version('/cobrands/fixmystreet-uk-councils/js.js'), - version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), - version('/cobrands/fixmystreet/assets.js'), - version('/cobrands/highways/assets.js'), version('/cobrands/tfl/js.js'), - version('/cobrands/tfl/assets.js'), ); END %] diff --git a/templates/web/westminster/footer_extra_js.html b/templates/web/westminster/footer_extra_js.html index 4180d9d20..f6e8c8bf9 100644 --- a/templates/web/westminster/footer_extra_js.html +++ b/templates/web/westminster/footer_extra_js.html @@ -1,12 +1 @@ -[%~ -IF bodyclass.match('mappage'); - scripts.push( - version('/cobrands/fixmystreet-uk-councils/js.js'), - version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), - version('/cobrands/fixmystreet/assets.js'), - version('/cobrands/westminster/assets.js'), - version('/cobrands/tfl/assets.js'), - ); -END -%] - +[% PROCESS 'footer_extra_js_base.html' cobrand_js=1 tfl=1 %] diff --git a/web/cobrands/bexley/js.js b/web/cobrands/bexley/assets.js index a500ebbf3..a500ebbf3 100644 --- a/web/cobrands/bexley/js.js +++ b/web/cobrands/bexley/assets.js diff --git a/web/cobrands/fixmystreet-uk-councils/alloy.js b/web/cobrands/fixmystreet-uk-councils/alloy.js index 27e43a4dd..77494f975 100644 --- a/web/cobrands/fixmystreet-uk-councils/alloy.js +++ b/web/cobrands/fixmystreet-uk-councils/alloy.js @@ -122,7 +122,7 @@ OpenLayers.Strategy.Alloy = OpenLayers.Class(OpenLayers.Strategy.FixMyStreet, { }); -fixmystreet.assets.alloy_defaults = { +fixmystreet.alloy_defaults = { http_options: { base: "https://alloy-api-tile01.yotta.co.uk/api/render-layer/tile/${layerid}/${environment}/${layerVersion}/${z}/${x}/${y}", }, diff --git a/web/cobrands/northamptonshire/assets.js b/web/cobrands/northamptonshire/assets.js index 67d75fb97..9f1e0750d 100644 --- a/web/cobrands/northamptonshire/assets.js +++ b/web/cobrands/northamptonshire/assets.js @@ -365,7 +365,7 @@ OpenLayers.Layer.NCCVectorAsset = OpenLayers.Class(OpenLayers.Layer.VectorAsset, // default options for northants assets include // a) checking for multiple assets in same location // b) preventing submission unless an asset is selected -var northants_defaults = $.extend(true, {}, fixmystreet.assets.alloy_defaults, { +var northants_defaults = $.extend(true, {}, fixmystreet.alloy_defaults, { class: OpenLayers.Layer.NCCVectorAsset, protocol_class: OpenLayers.Protocol.Alloy, http_options: { @@ -442,7 +442,7 @@ $.each(layers, function(index, layer) { // NCC roads layers which prevent report submission unless we have selected // an asset. -var northants_road_defaults = $.extend(true, {}, fixmystreet.assets.alloy_defaults, { +var northants_road_defaults = $.extend(true, {}, fixmystreet.alloy_defaults, { protocol_class: OpenLayers.Protocol.Alloy, http_options: { environment: is_live ? 26 : 28 diff --git a/web/cobrands/peterborough/js.js b/web/cobrands/peterborough/assets.js index 47172712d..47172712d 100644 --- a/web/cobrands/peterborough/js.js +++ b/web/cobrands/peterborough/assets.js |