aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-07-04 15:30:43 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-07-04 15:38:24 +0100
commit45aaf63033e7d4d24ba570f7460746fe28f9f59f (patch)
tree12c46eeff8c73aa68403cc4985ae16fafc1b4420
parent1ace947ac1e6f9b0fd3bdf3e8cd3dec6d4473f27 (diff)
Use static files for validation_rules.js.
No need for this to be generated via a template, it only differs occasionally by cobrand.
-rwxr-xr-xperllib/FixMyStreet/App/Controller/JS.pm2
-rw-r--r--templates/web/base/common_header_tags.html2
-rw-r--r--templates/web/seesomething/header_extra.html1
-rw-r--r--templates/web/seesomething/js/validation_rules.html13
-rw-r--r--templates/web/zurich/header.html1
-rw-r--r--web/cobrands/zurich/validation_rules.js (renamed from templates/web/zurich/js/validation_rules.html)0
-rw-r--r--web/js/validation_rules.js (renamed from templates/web/base/js/validation_rules.html)0
7 files changed, 3 insertions, 16 deletions
diff --git a/perllib/FixMyStreet/App/Controller/JS.pm b/perllib/FixMyStreet/App/Controller/JS.pm
index 483c3c2cc..1ced9d43b 100755
--- a/perllib/FixMyStreet/App/Controller/JS.pm
+++ b/perllib/FixMyStreet/App/Controller/JS.pm
@@ -24,8 +24,6 @@ sub translation_strings : LocalRegex('^translation_strings\.(.*?)\.js$') : Args(
$c->res->content_type( 'application/javascript' );
}
-sub validation_rules : Path('validation_rules.js') : Args(0) { }
-
__PACKAGE__->meta->make_immutable;
1;
diff --git a/templates/web/base/common_header_tags.html b/templates/web/base/common_header_tags.html
index 99d409362..8cd342042 100644
--- a/templates/web/base/common_header_tags.html
+++ b/templates/web/base/common_header_tags.html
@@ -3,10 +3,10 @@
<meta name="cobrand" content="[% c.cobrand.moniker %]">
-<script type="text/javascript" src="[% start %]/js/validation_rules.js?[% Math.int( date.now / 3600 ) %]"></script>
<script type="text/javascript" src="[% start %]/js/translation_strings.[% lang_code %].js?[% Math.int( date.now / 3600 ) %]"></script>
<script type="text/javascript" src="[% start %]/jslib/jquery-1.7.2.min.js"></script>
+<script type="text/javascript" src="[% start %][% version('/js/validation_rules.js') %]"></script>
<script src="[% start %][% version('/js/jquery.validate.min.js') %]" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="[% start %][% version('/js/dropzone.min.js') %]"></script>
diff --git a/templates/web/seesomething/header_extra.html b/templates/web/seesomething/header_extra.html
new file mode 100644
index 000000000..839e03dbe
--- /dev/null
+++ b/templates/web/seesomething/header_extra.html
@@ -0,0 +1 @@
+<script src="[% version('/cobrands/seesomething/validation_rules.js') %]"></script>
diff --git a/templates/web/seesomething/js/validation_rules.html b/templates/web/seesomething/js/validation_rules.html
deleted file mode 100644
index cef5fce7e..000000000
--- a/templates/web/seesomething/js/validation_rules.html
+++ /dev/null
@@ -1,13 +0,0 @@
- validation_rules = {
- detail: { required: true },
- category: { required: true },
- subcategory: { required: true }
- };
-
- $(function(){
- $('#submit_noname').click( function(e) {
- $('#form_category').addClass('required validCategory').removeClass('valid');
- $('#form_subcategory').addClass('required validCategory').removeClass('valid');
- });
- });
-
diff --git a/templates/web/zurich/header.html b/templates/web/zurich/header.html
index 071e4fad8..a5efaabda 100644
--- a/templates/web/zurich/header.html
+++ b/templates/web/zurich/header.html
@@ -23,6 +23,7 @@
<script src="[% start %][% version('/js/modernizr.custom.js') %]" charset="utf-8"></script>
[% INCLUDE 'common_header_tags.html' %]
+ <script src="[% start %][% version('/cobrands/zurich/validation_rules.js') %]"></script>
[% extra_js %]
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js" charset="utf-8"></script>
diff --git a/templates/web/zurich/js/validation_rules.html b/web/cobrands/zurich/validation_rules.js
index d98bc1118..d98bc1118 100644
--- a/templates/web/zurich/js/validation_rules.html
+++ b/web/cobrands/zurich/validation_rules.js
diff --git a/templates/web/base/js/validation_rules.html b/web/js/validation_rules.js
index 5295a53ca..5295a53ca 100644
--- a/templates/web/base/js/validation_rules.html
+++ b/web/js/validation_rules.js