diff options
author | Chris Mytton <chrism@mysociety.org> | 2020-03-16 15:15:01 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2020-03-31 09:58:58 +0100 |
commit | dd34deb13359f4a225850031e40723c6f15bd804 (patch) | |
tree | 33dc0cb3c667edcdaebc9e40ce1632ad4aed0094 | |
parent | a8176ffb8ec2ff5e92c1ee4e25cfa5dd208548af (diff) |
[Highways England] Only accept reports on area 7 roads
[HE] Deal with only_body same way TfL does.
-rw-r--r-- | web/cobrands/highwaysengland/assets.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/web/cobrands/highwaysengland/assets.js b/web/cobrands/highwaysengland/assets.js index e8245e169..d8ba8b6ac 100644 --- a/web/cobrands/highwaysengland/assets.js +++ b/web/cobrands/highwaysengland/assets.js @@ -60,8 +60,19 @@ fixmystreet.assets.add(defaults, { asset_type: 'road', no_asset_msg_id: '#js-not-he-road', actions: { - found: fixmystreet.message_controller.road_found, - not_found: fixmystreet.message_controller.road_not_found + found: function(layer, feature) { + // If the road isn't in area 7 then we want to show the not found message. + fixmystreet.message_controller.road_found(layer, feature, function(feature) { + $('#js-top-message').show(); + $('#form_category_row').show(); + return feature.attributes.area_name === 'Area 7'; + }, '#js-not-area7-road'); + }, + not_found: function(layer) { + fixmystreet.message_controller.road_not_found(layer); + $('#js-top-message').hide(); + $('#form_category_row').hide(); + } } }); |