aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2018-12-27 18:21:57 +0000
committerDave Arter <davea@mysociety.org>2019-01-17 08:36:43 +0000
commit6e2c77b2e1f3f693d806a9c0237403e3273378af (patch)
tree3587647aeb74c9804be0a02fbc0c32d7c5380338
parentc94e0c9baddcb49b9e194d1c5f128b0f04b4e9ac (diff)
[Buckinghamshire] Show guidance message for gritting routes
If a report is started on a road in the WinterRoutes asset layer in the "Snow and ice problem/winter salting" category, an extra guidance message is shown beneath the category UI with a link to the council's gritting schedule. Fixes mysociety/fixmystreet-freshdesk#25.
-rw-r--r--web/cobrands/buckinghamshire/assets.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/web/cobrands/buckinghamshire/assets.js b/web/cobrands/buckinghamshire/assets.js
index 1c0823c17..32c551d1a 100644
--- a/web/cobrands/buckinghamshire/assets.js
+++ b/web/cobrands/buckinghamshire/assets.js
@@ -428,4 +428,39 @@ fixmystreet.assets.add($.extend(true, {}, defaults, {
filter_value: types_to_show,
}));
+fixmystreet.assets.add($.extend(true, {}, defaults, {
+ http_options: {
+ params: {
+ TYPENAME: "WinterRoutes"
+ }
+ },
+ asset_category: "Snow and ice problem/winter salting",
+ asset_item: "road",
+ non_interactive: true,
+ road: true,
+ actions: {
+ found: function() {
+ var $div = $("#category_meta .js-gritting-notice");
+ if ($div.length) {
+ $div.show();
+ } else {
+ var msg = "<div class='box-warning js-gritting-notice'>" +
+ "<h1>Winter Gritting</h1>" +
+ "<p>The road you have selected is on a regular " +
+ "gritting route, and will be gritted according " +
+ "to the published " +
+ "<a href='https://www.buckscc.gov.uk/services/transport-and-roads/road-maintenance-and-repairs/winter-maintenance/'>" +
+ "policy</a>.</p>" +
+ "</div>";
+ $div = $(msg);
+ $div.prependTo("#category_meta");
+ }
+ },
+ not_found: function() {
+ $("#category_meta .js-gritting-notice").hide();
+ }
+ }
+}));
+
+
})();