diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-02-14 09:22:32 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-02-14 09:22:32 +0000 |
commit | f661c0f41eb30b024c17888889b7d725ab412ddf (patch) | |
tree | 46b634121d0e060e66a32f48c72b43d332d5b986 | |
parent | f5744500d82c8a3cf2a70ce0544d778579b1694a (diff) | |
parent | 014fc9b46e92e46a6884748004bf014fd479f400 (diff) |
Merge branch 'missing-council-js'
23 files changed, 51 insertions, 164 deletions
diff --git a/templates/web/bathnes/footer_extra_js.html b/templates/web/bathnes/footer_extra_js.html index 5059d59f2..e46e103e8 100644 --- a/templates/web/bathnes/footer_extra_js.html +++ b/templates/web/bathnes/footer_extra_js.html @@ -1,13 +1,4 @@ -[%~ -IF bodyclass.match('mappage'); - scripts.push( - 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'), - ); -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 db48a126c..7369f7147 100644 --- a/templates/web/bexley/footer_extra_js.html +++ b/templates/web/bexley/footer_extra_js.html @@ -1,14 +1 @@ -[% 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/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 deff4e395..3965c9d1e 100644 --- a/templates/web/bristol/footer_extra_js.html +++ b/templates/web/bristol/footer_extra_js.html @@ -1,13 +1 @@ -[% 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/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 a64ad1451..c3bad670c 100644 --- a/templates/web/bromley/footer_extra_js.html +++ b/templates/web/bromley/footer_extra_js.html @@ -2,13 +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/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 36be5e7dc..9132ead25 100644 --- a/templates/web/buckinghamshire/footer_extra_js.html +++ b/templates/web/buckinghamshire/footer_extra_js.html @@ -1,10 +1 @@ -[%~ -IF bodyclass.match('mappage'); - scripts.push( - 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'), - ); -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 9400b2938..9132ead25 100644 --- a/templates/web/cheshireeast/footer_extra_js.html +++ b/templates/web/cheshireeast/footer_extra_js.html @@ -1,10 +1 @@ -[%~ -IF bodyclass.match('mappage'); - scripts.push( - 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'), - ); -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 76451344b..09f2bf87d 100644 --- a/templates/web/fixmystreet-uk-councils/footer_extra_js.html +++ b/templates/web/fixmystreet-uk-councils/footer_extra_js.html @@ -1,12 +1 @@ -[% 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'), - ); -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 7b37893cf..8cbe4c48f 100644 --- a/templates/web/greenwich/footer_extra_js.html +++ b/templates/web/greenwich/footer_extra_js.html @@ -1,13 +1 @@ -[% 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 -%] +[% 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 58f7abd15..081ec3a12 100644 --- a/templates/web/hounslow/footer_extra_js.html +++ b/templates/web/hounslow/footer_extra_js.html @@ -1,13 +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/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 563da86b6..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('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), - version('/cobrands/fixmystreet/assets.js'), - version('/cobrands/fixmystreet-uk-councils/js.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 0278798a4..9132ead25 100644 --- a/templates/web/lincolnshire/footer_extra_js.html +++ b/templates/web/lincolnshire/footer_extra_js.html @@ -1,10 +1 @@ -[%~ -IF bodyclass.match('mappage'); - scripts.push( - 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'), - ); -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 c17d2777e..fbd33dd11 100644 --- a/templates/web/northamptonshire/footer_extra_js.html +++ b/templates/web/northamptonshire/footer_extra_js.html @@ -1,11 +1,7 @@ [% IF bodyclass.match('mappage'); scripts.push( - 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 d3f1f03ee..88fc006e7 100644 --- a/templates/web/oxfordshire/footer_extra_js.html +++ b/templates/web/oxfordshire/footer_extra_js.html @@ -1,10 +1 @@ -[% -IF bodyclass.match('mappage'); - scripts.push( - 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 22cc42e60..9132ead25 100644 --- a/templates/web/peterborough/footer_extra_js.html +++ b/templates/web/peterborough/footer_extra_js.html @@ -1,14 +1 @@ -[% scripts.push( - version('/cobrands/fixmystreet-uk-councils/js.js'), -) %] -[%~ -IF bodyclass.match('mappage'); - scripts.push( - 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 ba3b6ec02..88fc006e7 100644 --- a/templates/web/rutland/footer_extra_js.html +++ b/templates/web/rutland/footer_extra_js.html @@ -1,7 +1 @@ -[%~ -IF bodyclass.match('mappage'); - scripts.push( - 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/tfl/footer_extra_js.html b/templates/web/tfl/footer_extra_js.html index e91a2a389..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'), - version('/cobrands/fixmystreet-uk-councils/js.js'), ) %] +[% PROCESS 'footer_extra_js_base.html' highways=1 cobrand_js=1 %] [%~ 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/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 33fdb4dc2..f6e8c8bf9 100644 --- a/templates/web/westminster/footer_extra_js.html +++ b/templates/web/westminster/footer_extra_js.html @@ -1,11 +1 @@ -[%~ -IF bodyclass.match('mappage'); - scripts.push( - 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 |