aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-02-04 17:09:22 +0000
committerMatthew Somerville <matthew@mysociety.org>2020-02-13 18:26:38 +0000
commit014fc9b46e92e46a6884748004bf014fd479f400 (patch)
tree8ed8def64581af5e24b2008e243bfb55d6ddbaac /templates
parentb4b6bdadb850c9f69fd13c3dd253523262e746d1 (diff)
[UK Councils] Factor footer JS templates together.
Diffstat (limited to 'templates')
-rw-r--r--templates/web/bathnes/footer_extra_js.html13
-rw-r--r--templates/web/bexley/footer_extra_js.html13
-rw-r--r--templates/web/bristol/footer_extra_js.html12
-rw-r--r--templates/web/bromley/footer_extra_js.html7
-rw-r--r--templates/web/buckinghamshire/footer_extra_js.html13
-rw-r--r--templates/web/cheshireeast/footer_extra_js.html13
-rw-r--r--templates/web/fixmystreet-uk-councils/footer_extra_js.html11
-rw-r--r--templates/web/fixmystreet-uk-councils/footer_extra_js_base.html29
-rw-r--r--templates/web/fixmystreet.com/footer_extra_js.html4
-rw-r--r--templates/web/greenwich/footer_extra_js.html12
-rw-r--r--templates/web/hounslow/footer_extra_js.html8
-rw-r--r--templates/web/isleofwight/footer_extra_js.html5
-rw-r--r--templates/web/lincolnshire/footer_extra_js.html13
-rw-r--r--templates/web/northamptonshire/footer_extra_js.html7
-rw-r--r--templates/web/oxfordshire/footer_extra_js.html12
-rw-r--r--templates/web/peterborough/footer_extra_js.html13
-rw-r--r--templates/web/rutland/footer_extra_js.html12
-rw-r--r--templates/web/tfl/footer_extra_js.html6
-rw-r--r--templates/web/westminster/footer_extra_js.html13
19 files changed, 48 insertions, 168 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 %]