diff options
author | Dave Arter <davea@mysociety.org> | 2019-09-23 13:09:18 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2019-09-23 14:21:46 +0100 |
commit | aef0c3b4f1fe89feff0caacec5f113444c66e4c5 (patch) | |
tree | 39a776e616fa80d986f9c789a9c821fc679fcdfd | |
parent | 7725488319ed2ae791fd993485ec34e9363e5844 (diff) |
[Hounslow] Use Confirm validation rules for reports
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Hounslow.pm | 3 | ||||
-rw-r--r-- | templates/web/hounslow/footer_extra_js.html | 3 | ||||
-rw-r--r-- | web/cobrands/fixmystreet-uk-councils/council_validation_rules.js | 29 |
3 files changed, 21 insertions, 14 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Hounslow.pm b/perllib/FixMyStreet/Cobrand/Hounslow.pm index 2146f2b67..2d5c2bf0f 100644 --- a/perllib/FixMyStreet/Cobrand/Hounslow.pm +++ b/perllib/FixMyStreet/Cobrand/Hounslow.pm @@ -4,6 +4,9 @@ use parent 'FixMyStreet::Cobrand::Whitelabel'; use strict; use warnings; +use Moo; +with 'FixMyStreet::Roles::ConfirmValidation'; + sub council_area_id { 2483 } sub council_area { 'Hounslow' } sub council_name { 'Hounslow Highways' } diff --git a/templates/web/hounslow/footer_extra_js.html b/templates/web/hounslow/footer_extra_js.html index 5ca03231b..1ff386231 100644 --- a/templates/web/hounslow/footer_extra_js.html +++ b/templates/web/hounslow/footer_extra_js.html @@ -1,3 +1,6 @@ +[% scripts.push( + version('/cobrands/fixmystreet-uk-councils/council_validation_rules.js'), +) %] [% IF bodyclass.match('mappage'); scripts.push( diff --git a/web/cobrands/fixmystreet-uk-councils/council_validation_rules.js b/web/cobrands/fixmystreet-uk-councils/council_validation_rules.js index 49c23db89..f693f59f8 100644 --- a/web/cobrands/fixmystreet-uk-councils/council_validation_rules.js +++ b/web/cobrands/fixmystreet-uk-councils/council_validation_rules.js @@ -13,25 +13,22 @@ confirm_validation_rules = { }; body_validation_rules = { - 'Buckinghamshire County Council': confirm_validation_rules, - 'Lincolnshire County Council': confirm_validation_rules, 'Bath and North East Somerset Council': confirm_validation_rules, - 'Rutland County Council': { - title: { - required: true, - maxlength: 254 - }, - name: { - required: true, - maxlength: 40 - } - }, 'Bromley Council': { detail: { required: true, maxlength: 1750 } }, + 'Buckinghamshire County Council': confirm_validation_rules, + 'Hounslow Borough Council': confirm_validation_rules, + 'Lincolnshire County Council': confirm_validation_rules, + 'Northamptonshire County Council': { + title: { + required: true, + maxlength: 120 + } + }, 'Oxfordshire County Council': { detail: { required: true, @@ -48,10 +45,14 @@ body_validation_rules = { maxlength: 50 } }, - 'Northamptonshire County Council': { + 'Rutland County Council': { title: { required: true, - maxlength: 120 + maxlength: 254 + }, + name: { + required: true, + maxlength: 40 } } }; |