aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--data/bathnes/openlayers.bathnes.cfg1
-rw-r--r--templates/email/rutland/archive.html54
-rw-r--r--templates/email/rutland/archive.txt25
-rw-r--r--templates/web/base/report/_inspect.html10
-rw-r--r--templates/web/bathnes/around/intro.html3
-rw-r--r--templates/web/bathnes/report/_inspect_reject_button.html3
-rw-r--r--templates/web/buckinghamshire/report/new/inline-tips.html12
-rw-r--r--web/cobrands/bathnes/js.js47
-rw-r--r--web/cobrands/bathnes/staff.js40
-rw-r--r--web/cobrands/fixmystreet/assets.js52
-rw-r--r--web/vendor/OpenLayers/OpenLayers.bathnes.js5
11 files changed, 221 insertions, 31 deletions
diff --git a/data/bathnes/openlayers.bathnes.cfg b/data/bathnes/openlayers.bathnes.cfg
index 5127aac9f..45eb2b26e 100644
--- a/data/bathnes/openlayers.bathnes.cfg
+++ b/data/bathnes/openlayers.bathnes.cfg
@@ -11,6 +11,7 @@ OpenLayers/Renderer/SVG.js
OpenLayers/Renderer/VML.js
OpenLayers/Strategy/Fixed.js
OpenLayers/Strategy/BBOX.js
+OpenLayers/Strategy/Filter.js
OpenLayers/Control/ArgParser.js
OpenLayers/Control/Attribution.js
OpenLayers/Control/DragFeature.js
diff --git a/templates/email/rutland/archive.html b/templates/email/rutland/archive.html
new file mode 100644
index 000000000..d50be2c7a
--- /dev/null
+++ b/templates/email/rutland/archive.html
@@ -0,0 +1,54 @@
+[%
+
+email_summary = "Your reports on " _ site_name;
+
+PROCESS '_email_settings.html';
+
+INCLUDE '_email_top.html';
+
+%]
+
+<th style="[% td_style %][% only_column_style %]">
+ <h1 style="[% h1_style %]">Your reports on [% site_name %]</h1>
+ <p style="[% p_style %]">
+ Hello [% user.name %],
+ </p>
+ <p style="[% p_style %]">
+ Thank you for taking the time to report this issue through
+ FixMyStreet. Rutland County Council have now embedded FixMyStreet
+ within several service areas across the Council, and are adopting
+ this platform as the main reporting tool for all highways and
+ streetscene issues. We will be integrating this system with
+ existing service delivery software.
+ </p>
+ <p style="[% p_style %]">
+ As such, we have taken a decision to close reports prior to 1/5/2018.
+ </p>
+ <p style="[% p_style %]">
+ We noticed that you have [% report_count %] old [% nget('report', 'reports', report_count) %] on the system,
+ which we've listed below.
+ </p>
+ <p style="[% p_style %]">
+ If you believe that the issue has not been resolved you can <a href="https://rutland.fixmystreet.com/">report it again here.</a>
+ </p>
+
+ [% FOR report IN reports %]
+ <div style="[% list_item_style %]">
+ [% IF report.photo %]
+ <a href="[% cobrand.base_url_for_report( report ) %]/report/[% report.id %]">
+ <img style="[% list_item_photo_style %]" src="[% inline_image(report.get_first_image_fp) %]" alt="">
+ </a>
+ [% END %]
+ <h2 style="[% list_item_h2_style %]"><a href="[% cobrand.base_url_for_report( report ) %]/report/[% report.id %]">
+ [%~ report.title | html ~%]
+ </a></h2>
+ <p style="[% list_item_p_style %]">[% report.detail | html %]</p>
+ <p style="[% list_item_date_style %]">
+ Reported [% report.time_ago %] ago.
+ </p>
+ </div>
+ [% END %]
+
+</th>
+
+[% INCLUDE '_email_bottom.html' %]
diff --git a/templates/email/rutland/archive.txt b/templates/email/rutland/archive.txt
new file mode 100644
index 000000000..52629d51f
--- /dev/null
+++ b/templates/email/rutland/archive.txt
@@ -0,0 +1,25 @@
+Subject: Your reports on [% site_name %]
+
+Hello [% user.name %],
+
+Thank you for taking the time to report this issue through FixMyStreet. Rutland County Council have now embedded FixMyStreet within several service areas across the Council, and are adopting this platform as the main reporting tool for all highways and streetscene issues. We will be integrating this system with existing service delivery software.
+
+As such, we have taken a decision to close reports prior to 1/5/2018.
+
+We noticed that you have [% report_count %] old [% nget('report', 'reports', report_count) %] on the system, which we've listed below.
+
+If you feel that the issue you reported has not been addressed, please report it again at https://rutland.fixmystreet.com/ or by using the App
+
+[% FOR report IN reports %]
+
+[% report.title %]
+
+Reported [% report.time_ago %] ago.
+
+View report: [% cobrand.base_url_for_report( report ) %]/report/[% report.id %]
+
+----
+
+[% END %]
+
+The FixMyStreet team and Rutland County Council
diff --git a/templates/web/base/report/_inspect.html b/templates/web/base/report/_inspect.html
index 222780dcb..e2db1ea97 100644
--- a/templates/web/base/report/_inspect.html
+++ b/templates/web/base/report/_inspect.html
@@ -53,9 +53,13 @@
<a href="#" class="btn btn--block btn--geolocate">[% loc('Set to my current location') %]</a>
</p>
[% IF permissions.report_reject %]
- <p>
- <a href="[% c.uri_for( '/contact', { id => problem.id, reject => 1 } ) %]" class="btn btn--block">[% loc('Reject report') %]</a>
- </p>
+ [% TRY %]
+ [% INCLUDE 'report/_inspect_reject_button.html' %]
+ [% CATCH file %]
+ <p>
+ <a href="[% c.uri_for( '/contact', { id => problem.id, reject => 1 } ) %]" class="btn btn--block">[% loc('Reject report') %]</a>
+ </p>
+ [% END %]
[% END %]
</div>
diff --git a/templates/web/bathnes/around/intro.html b/templates/web/bathnes/around/intro.html
index 06965b0ac..19a78d800 100644
--- a/templates/web/bathnes/around/intro.html
+++ b/templates/web/bathnes/around/intro.html
@@ -1 +1,2 @@
-<h1>Report problems on the road</h1>
+<h1>Report a problem<br />
+Roads, pavements, and parks</h1>
diff --git a/templates/web/bathnes/report/_inspect_reject_button.html b/templates/web/bathnes/report/_inspect_reject_button.html
new file mode 100644
index 000000000..33b3a9d80
--- /dev/null
+++ b/templates/web/bathnes/report/_inspect_reject_button.html
@@ -0,0 +1,3 @@
+<p>
+ <a href="[% c.uri_for( '/contact', { id => problem.id, reject => 1 } ) %]" class="btn btn--block">Council Connect Return</a>
+</p>
diff --git a/templates/web/buckinghamshire/report/new/inline-tips.html b/templates/web/buckinghamshire/report/new/inline-tips.html
new file mode 100644
index 000000000..b788bafe7
--- /dev/null
+++ b/templates/web/buckinghamshire/report/new/inline-tips.html
@@ -0,0 +1,12 @@
+<div class="description_tips" aria-label="Tips for successful reports">
+ <ul class="do">
+ <li>Be polite</li>
+ <li>Use exact locations</li>
+ <li>Say how long the issue’s been&nbsp;present</li>
+ <li>Please only log <strong>one issue</strong> per report</li>
+ </ul>
+ <ul class="dont">
+ <li>Don’t identify or accuse other&nbsp;people</li>
+ <li>Don’t include private contact details in the&nbsp;description</li>
+ </ul>
+</div>
diff --git a/web/cobrands/bathnes/js.js b/web/cobrands/bathnes/js.js
index 84c9c56f5..71077ed43 100644
--- a/web/cobrands/bathnes/js.js
+++ b/web/cobrands/bathnes/js.js
@@ -45,6 +45,53 @@ fixmystreet.assets.add($.extend(true, {}, fixmystreet.maps.banes_defaults, {
}
}));
+fixmystreet.assets.add($.extend(true, {}, fixmystreet.maps.banes_defaults, {
+ http_options: {
+ params: {
+ TYPENAME: "ParksOpenSpacesAssets"
+ }
+ },
+ asset_category: [
+ 'Abandoned vehicles',
+ 'Dead animals',
+ 'Dog fouling',
+ 'Fly-tipping',
+ 'Graffiti',
+ 'Excessive or dangerous littering',
+ 'Needles',
+ 'Play area safety issue',
+ 'Damage to bins, benches, and infrastructure',
+ 'Allotment issue',
+ 'Trees and woodland',
+ 'Obstructive vegetation'
+ ],
+ asset_item: "park",
+ disable_pin_snapping: true,
+ stylemap: new OpenLayers.StyleMap({
+ 'default': new OpenLayers.Style({
+ fill: false,
+ stroke: false
+ })
+ }),
+ attributes: {
+ asset_details: function() {
+ var a = this.attributes;
+ return a.description + " " + a.assetid;
+ }
+ },
+ filter_key: 'category',
+ filter_value: [
+ 'Flower Beds',
+ 'Grass',
+ 'Hard',
+ 'Hedgerow',
+ 'Path',
+ 'Pitch',
+ 'Seats'
+ ],
+ name: "Parks and Grounds"
+}));
+
/*
diff --git a/web/cobrands/bathnes/staff.js b/web/cobrands/bathnes/staff.js
index 763761929..c6a8a9560 100644
--- a/web/cobrands/bathnes/staff.js
+++ b/web/cobrands/bathnes/staff.js
@@ -35,22 +35,34 @@ fixmystreet.assets.add($.extend(true, {}, fixmystreet.maps.banes_defaults, {
}));
-// Staff can actually see the adopted highways layer, so replace the invisible
-// stylemap of that layer.
-var highways_stylemap = new OpenLayers.StyleMap({
- 'default': new OpenLayers.Style({
- fill: true,
- fillOpacity: 0,
- // strokeColor: "#55BB00",
- strokeColor: "#FFFF00",
- strokeOpacity: 0.5,
- strokeWidth: 2,
- title: '${description}\n${notes}'
+// Some normally-invisible layers are visible to staff, so replace their
+// stylemaps accordingly.
+var replacement_stylemaps = {
+ "Adopted Highways": new OpenLayers.StyleMap({
+ 'default': new OpenLayers.Style({
+ fill: true,
+ fillOpacity: 0,
+ // strokeColor: "#55BB00",
+ strokeColor: "#FFFF00",
+ strokeOpacity: 0.5,
+ strokeWidth: 2,
+ title: '${description}\n${notes}'
+ })
+ }),
+ "Parks and Grounds": new OpenLayers.StyleMap({
+ 'default': new OpenLayers.Style({
+ fill: false,
+ strokeColor: "#008800",
+ strokeOpacity: 0.5,
+ strokeWidth: 2,
+ title: '${site_name}'
+ })
})
-});
+};
+
$.each(fixmystreet.assets.layers, function() {
- if (this.name == "Adopted Highways") {
- this.styleMap = highways_stylemap;
+ if (typeof replacement_stylemaps[this.name] !== 'undefined') {
+ this.styleMap = replacement_stylemaps[this.name];
}
});
diff --git a/web/cobrands/fixmystreet/assets.js b/web/cobrands/fixmystreet/assets.js
index 7e79776cd..77522fc6c 100644
--- a/web/cobrands/fixmystreet/assets.js
+++ b/web/cobrands/fixmystreet/assets.js
@@ -200,16 +200,7 @@ function asset_selected(e) {
// its own USRN which should take precedence.
$(fixmystreet).trigger('assets:selected', [ lonlat ]);
- // Set the extra field to the value of the selected feature
- $.each(this.fixmystreet.attributes, function (field_name, attribute_name) {
- var field_value;
- if (typeof attribute_name === 'function') {
- field_value = attribute_name.apply(e.feature);
- } else {
- field_value = e.feature.attributes[attribute_name];
- }
- $("#form_" + field_name).val(field_value);
- });
+ set_fields_from_attributes(this.fixmystreet.attributes, feature);
// Hide the normal markers layer to keep things simple, but
// move the green marker to the point of the click to stop
@@ -227,10 +218,26 @@ function asset_selected(e) {
function asset_unselected(e) {
fixmystreet.markers.setVisibility(true);
- $.each(this.fixmystreet.attributes, function (field_name, attribute_name) {
+ selected_feature = null;
+ clear_fields_for_attributes(this.fixmystreet.attributes);
+}
+
+function set_fields_from_attributes(attributes, feature) {
+ // Set the extra fields to the value of the selected feature
+ $.each(attributes, function (field_name, attribute_name) {
+ var $field = $("#form_" + field_name);
+ if (typeof attribute_name === 'function') {
+ $field.val(attribute_name.apply(feature));
+ } else {
+ $field.val(feature.attributes[attribute_name]);
+ }
+ });
+}
+
+function clear_fields_for_attributes(attributes) {
+ $.each(attributes, function (field_name, attribute_name) {
$("#form_" + field_name).val("");
});
- selected_feature = null;
}
function find_matching_feature(feature, layer, asset_id_field) {
@@ -528,6 +535,27 @@ fixmystreet.assets = {
select_feature_control = new OpenLayers.Control.SelectFeature( asset_layer );
asset_layer.events.register( 'featureselected', asset_layer, asset_selected);
asset_layer.events.register( 'featureunselected', asset_layer, asset_unselected);
+ if (options.disable_pin_snapping) {
+ // The pin is snapped to the centre of a feature by the select
+ // handler. We can stop this handler from running, and the pin
+ // being snapped, by returning false from a beforefeatureselected
+ // event handler. This handler does need to make sure the
+ // attributes of the clicked feature are applied to the extra
+ // details form fields first though.
+ asset_layer.events.register( 'beforefeatureselected', asset_layer, function(e) {
+ var attributes = this.fixmystreet.attributes;
+ set_fields_from_attributes(attributes, e.feature);
+
+ // The next click on the map may not be on an asset - so
+ // clear the fields for this layer when the pin is next
+ // updated. If it is on an asset then the fields will be
+ // set by whatever feature was selected.
+ $(fixmystreet).one('maps:update_pin', function() {
+ clear_fields_for_attributes(attributes);
+ });
+ return false;
+ });
+ }
// When panning/zooming the map check that this layer is still correctly shown
// and any selected marker is preserved
asset_layer.events.register( 'loadend', asset_layer, layer_loadend);
diff --git a/web/vendor/OpenLayers/OpenLayers.bathnes.js b/web/vendor/OpenLayers/OpenLayers.bathnes.js
index 4a2efc3ea..7fc6b790e 100644
--- a/web/vendor/OpenLayers/OpenLayers.bathnes.js
+++ b/web/vendor/OpenLayers/OpenLayers.bathnes.js
@@ -1684,4 +1684,7 @@ var center=mapBounds.getCenterLonLat();var dataWidth=mapBounds.getWidth()*this.r
var evt={filter:this.createFilter()};this.layer.events.triggerEvent("loadstart",evt);this.response=this.layer.protocol.read(OpenLayers.Util.applyDefaults({filter:evt.filter,callback:this.merge,scope:this},options));},createFilter:function(){var filter=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:this.bounds,projection:this.layer.projection});if(this.layer.filter){filter=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.layer.filter,filter]});}
return filter;},merge:function(resp){this.layer.destroyFeatures();if(resp.success()){var features=resp.features;if(features&&features.length>0){var remote=this.layer.projection;var local=this.layer.map.getProjectionObject();if(remote&&local&&!local.equals(remote)){var geom;for(var i=0,len=features.length;i<len;++i){geom=features[i].geometry;if(geom){geom.transform(remote,local);}}}
this.layer.addFeatures(features);}}else{this.bounds=null;}
-this.response=null;this.layer.events.triggerEvent("loadend",{response:resp});},CLASS_NAME:"OpenLayers.Strategy.BBOX"}); \ No newline at end of file
+this.response=null;this.layer.events.triggerEvent("loadend",{response:resp});},CLASS_NAME:"OpenLayers.Strategy.BBOX"});OpenLayers.Strategy.Filter=OpenLayers.Class(OpenLayers.Strategy,{filter:null,cache:null,caching:false,activate:function(){var activated=OpenLayers.Strategy.prototype.activate.apply(this,arguments);if(activated){this.cache=[];this.layer.events.on({"beforefeaturesadded":this.handleAdd,"beforefeaturesremoved":this.handleRemove,scope:this});}
+return activated;},deactivate:function(){this.cache=null;if(this.layer&&this.layer.events){this.layer.events.un({"beforefeaturesadded":this.handleAdd,"beforefeaturesremoved":this.handleRemove,scope:this});}
+return OpenLayers.Strategy.prototype.deactivate.apply(this,arguments);},handleAdd:function(event){if(!this.caching&&this.filter){var features=event.features;event.features=[];var feature;for(var i=0,ii=features.length;i<ii;++i){feature=features[i];if(this.filter.evaluate(feature)){event.features.push(feature);}else{this.cache.push(feature);}}}},handleRemove:function(event){if(!this.caching){this.cache=[];}},setFilter:function(filter){this.filter=filter;var previousCache=this.cache;this.cache=[];this.handleAdd({features:this.layer.features});if(this.cache.length>0){this.caching=true;this.layer.removeFeatures(this.cache.slice());this.caching=false;}
+if(previousCache.length>0){var event={features:previousCache};this.handleAdd(event);if(event.features.length>0){this.caching=true;this.layer.addFeatures(event.features);this.caching=false;}}},CLASS_NAME:"OpenLayers.Strategy.Filter"}); \ No newline at end of file