diff options
author | Struan Donald <struan@exo.org.uk> | 2018-11-16 09:17:54 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2018-11-26 09:43:11 +0000 |
commit | b1ae952277d689134797abf1482572dd818a67ca (patch) | |
tree | c6d6c381b73d58a80ad5be1d6613255b33eda3a1 /templates | |
parent | 231407e1106e68abf481bb65aa82cb60564fc9d6 (diff) |
[UK] council specific javascript validation
use the bodies array of reporting_data to check if there is council
specific javascript validation and, if so, load that into the JS
validation rules.
This does mean we reset the validation rules each time you select a
category.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/web/base/js/translation_strings.html | 5 | ||||
-rw-r--r-- | templates/web/bathnes/footer_extra_js.html | 3 | ||||
-rw-r--r-- | templates/web/bromley/footer_extra_js.html | 1 | ||||
-rw-r--r-- | templates/web/buckinghamshire/footer_extra_js.html | 3 | ||||
-rw-r--r-- | templates/web/fixmystreet.com/footer_extra_js.html | 1 | ||||
-rw-r--r-- | templates/web/lincolnshire/footer_extra_js.html | 3 | ||||
-rw-r--r-- | templates/web/rutland/footer_extra_js.html | 3 |
7 files changed, 18 insertions, 1 deletions
diff --git a/templates/web/base/js/translation_strings.html b/templates/web/base/js/translation_strings.html index bd8144a63..1b0735919 100644 --- a/templates/web/base/js/translation_strings.html +++ b/templates/web/base/js/translation_strings.html @@ -5,7 +5,10 @@ fixmystreet.password_minimum_length = [% c.cobrand.password_minimum_length %]; translation_strings = { update: '[% loc('Please enter a message') | replace("'", "\\'") %]', title: '[% loc('Please enter a subject') | replace("'", "\\'") %]', - detail: '[% loc('Please enter some details') | replace("'", "\\'") %]', + detail: { + required: '[% loc('Please enter some details') | replace("'", "\\'") %]', + maxlength: '[% loc('Reports are limited to {0} characters in length. Please shorten your report') | replace("'", "\\'") %]', + }, name: { required: '[% loc('Please enter your name') | replace("'", "\\'") %]', validName: '[% loc('Please enter your full name, councils need this information – if you do not wish your name to be shown on the site, untick the box below') | replace("'", "\\'") %]' diff --git a/templates/web/bathnes/footer_extra_js.html b/templates/web/bathnes/footer_extra_js.html new file mode 100644 index 000000000..8113befc9 --- /dev/null +++ b/templates/web/bathnes/footer_extra_js.html @@ -0,0 +1,3 @@ +[% scripts.push( + version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'), +) %] diff --git a/templates/web/bromley/footer_extra_js.html b/templates/web/bromley/footer_extra_js.html index 0b69cf5ad..3c8711c39 100644 --- a/templates/web/bromley/footer_extra_js.html +++ b/templates/web/bromley/footer_extra_js.html @@ -1,4 +1,5 @@ [% scripts.push( version('/jslib/jquery-1.7.2.min.js'), version('/cobrands/bromley/a-z-nav.js'), + version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'), ) %] diff --git a/templates/web/buckinghamshire/footer_extra_js.html b/templates/web/buckinghamshire/footer_extra_js.html new file mode 100644 index 000000000..8113befc9 --- /dev/null +++ b/templates/web/buckinghamshire/footer_extra_js.html @@ -0,0 +1,3 @@ +[% scripts.push( + version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'), +) %] diff --git a/templates/web/fixmystreet.com/footer_extra_js.html b/templates/web/fixmystreet.com/footer_extra_js.html index c0c4ff80e..9282490f8 100644 --- a/templates/web/fixmystreet.com/footer_extra_js.html +++ b/templates/web/fixmystreet.com/footer_extra_js.html @@ -11,6 +11,7 @@ IF bodyclass.match('mappage'); scripts.push( version('/cobrands/lincolnshire/assets.js') ); scripts.push( version('/cobrands/oxfordshire/assets.js') ); scripts.push( version('/cobrands/highways/assets.js') ); + scripts.push( version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js') ); scripts.push( version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), ); diff --git a/templates/web/lincolnshire/footer_extra_js.html b/templates/web/lincolnshire/footer_extra_js.html new file mode 100644 index 000000000..8113befc9 --- /dev/null +++ b/templates/web/lincolnshire/footer_extra_js.html @@ -0,0 +1,3 @@ +[% scripts.push( + version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'), +) %] diff --git a/templates/web/rutland/footer_extra_js.html b/templates/web/rutland/footer_extra_js.html new file mode 100644 index 000000000..8113befc9 --- /dev/null +++ b/templates/web/rutland/footer_extra_js.html @@ -0,0 +1,3 @@ +[% scripts.push( + version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'), +) %] |