From 8f0da56ea44ba5dd7c813e380c5428856e23b737 Mon Sep 17 00:00:00 2001
From: Moray Jones
Date: Fri, 24 Jan 2025 15:47:28 +0000
Subject: [PATCH 1/3] [Bristol] Add layers for allowed reports
Setup for two asset layers to have either selected to allow reports
in Bristol on relevant categories.
https://github.com/mysociety/societyworks/issues/4692
---
.../web/bristol/report/new/roads_message.html | 8 ++++++++
.../report/new/roads_message.html | 8 ++++++++
web/cobrands/fixmystreet-uk-councils/assets.js | 17 +++++++++++++++++
3 files changed, 33 insertions(+)
create mode 100644 templates/web/bristol/report/new/roads_message.html
diff --git a/templates/web/bristol/report/new/roads_message.html b/templates/web/bristol/report/new/roads_message.html
new file mode 100644
index 00000000000..cb39821af3a
--- /dev/null
+++ b/templates/web/bristol/report/new/roads_message.html
@@ -0,0 +1,8 @@
+
+
+ The area selected is not maintained by Bristol City Council
+
+
+ To enable you to find out who owns/maintains this area please contact HM Land Registry at https://www.gov.uk/search-property-information-land-registry.
+
+
diff --git a/templates/web/fixmystreet.com/report/new/roads_message.html b/templates/web/fixmystreet.com/report/new/roads_message.html
index bba8ab264ed..641967c927d 100644
--- a/templates/web/fixmystreet.com/report/new/roads_message.html
+++ b/templates/web/fixmystreet.com/report/new/roads_message.html
@@ -71,6 +71,14 @@
who own and manage it.
+
+
+ The area selected is not maintained by Bristol City Council
+
+
+ To enable you to find out who owns/maintains this area please contact HM Land Registry at https://www.gov.uk/search-property-information-land-registry.
+
+
diff --git a/web/cobrands/fixmystreet-uk-councils/assets.js b/web/cobrands/fixmystreet-uk-councils/assets.js
index e57ba223931..a18917229a1 100644
--- a/web/cobrands/fixmystreet-uk-councils/assets.js
+++ b/web/cobrands/fixmystreet-uk-councils/assets.js
@@ -267,6 +267,23 @@ fixmystreet.assets.bristol.park_stylemap = new OpenLayers.StyleMap({
})
});
+
+var bristol_owned_asset = false;
+
+fixmystreet.assets.bristol.road_found = function(layer) {
+ bristol_owned_asset = true;
+ fixmystreet.message_controller.road_found(layer);
+};
+
+fixmystreet.assets.bristol.road_not_found = function(layer) {
+ if (bristol_owned_asset) {
+ bristol_owned_asset = false;
+ return;
+ } else {
+ fixmystreet.message_controller.road_not_found(layer, function() {return true;});
+ }
+};
+
/* Bromley */
fixmystreet.assets.bromley = {};
From 25b205e5751bc88ddea4bfda2b511c574a223a7d Mon Sep 17 00:00:00 2001
From: Matthew Somerville
Date: Mon, 3 Feb 2025 16:55:49 +0000
Subject: [PATCH 2/3] fixup! [Bristol] Add layers for allowed reports
---
.../fixmystreet-uk-councils/assets.js | 27 +++++++++++++++----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/web/cobrands/fixmystreet-uk-councils/assets.js b/web/cobrands/fixmystreet-uk-councils/assets.js
index a18917229a1..448512b882e 100644
--- a/web/cobrands/fixmystreet-uk-councils/assets.js
+++ b/web/cobrands/fixmystreet-uk-councils/assets.js
@@ -268,19 +268,36 @@ fixmystreet.assets.bristol.park_stylemap = new OpenLayers.StyleMap({
});
-var bristol_owned_asset = false;
+var bristol_owned_assets = {
+ road: false,
+ property: false
+};
fixmystreet.assets.bristol.road_found = function(layer) {
- bristol_owned_asset = true;
+ bristol_owned_assets.road = true;
+ fixmystreet.message_controller.road_found(layer);
+};
+
+fixmystreet.assets.bristol.property_found = function(layer) {
+ bristol_owned_assets.property = true;
fixmystreet.message_controller.road_found(layer);
};
fixmystreet.assets.bristol.road_not_found = function(layer) {
- if (bristol_owned_asset) {
- bristol_owned_asset = false;
- return;
+ bristol_owned_assets.road = false;
+ if (!bristol_owned_assets.road && !bristol_owned_assets.property && !fixmystreet.staff_set_up) {
+ fixmystreet.message_controller.road_not_found(layer, function() {return true;});
} else {
+ fixmystreet.message_controller.road_found(layer);
+ }
+};
+
+fixmystreet.assets.bristol.property_not_found = function(layer) {
+ bristol_owned_assets.property = false;
+ if (!bristol_owned_assets.road && !bristol_owned_assets.property && !fixmystreet.staff_set_up) {
fixmystreet.message_controller.road_not_found(layer, function() {return true;});
+ } else {
+ fixmystreet.message_controller.road_found(layer);
}
};
From d6efd9139e7b1570733eb28cdfe8bd3042c8828a Mon Sep 17 00:00:00 2001
From: Moray Jones
Date: Tue, 4 Feb 2025 10:49:04 +0000
Subject: [PATCH 3/3] [Bristol] Adds Open311Multi role
Role and sub necessary for sending updates
---
perllib/FixMyStreet/Cobrand/Bristol.pm | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/perllib/FixMyStreet/Cobrand/Bristol.pm b/perllib/FixMyStreet/Cobrand/Bristol.pm
index 1c7da062a9d..e81d60ba110 100644
--- a/perllib/FixMyStreet/Cobrand/Bristol.pm
+++ b/perllib/FixMyStreet/Cobrand/Bristol.pm
@@ -13,6 +13,10 @@ Bristol is a unitary authority, with its own Open311 server.
package FixMyStreet::Cobrand::Bristol;
use parent 'FixMyStreet::Cobrand::Whitelabel';
+use Moo;
+with 'FixMyStreet::Roles::Open311Alloy';
+with 'FixMyStreet::Roles::Open311Multi';
+
use strict;
use warnings;
@@ -203,6 +207,9 @@ sub munge_overlapping_asset_bodies {
}
}
+sub open311_munge_update_params {
+}
+
sub check_report_is_on_cobrand_asset {
my ($self) = @_;