aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md2
-rw-r--r--perllib/FixMyStreet/Cobrand/Buckinghamshire.pm2
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/DefectType.pm5
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/ResponsePriority.pm3
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/ResponseTemplate.pm5
-rw-r--r--perllib/FixMyStreet/Map/Zurich.pm12
-rw-r--r--perllib/FixMyStreet/Script/Reports.pm2
-rw-r--r--t/app/model/defecttype.t21
-rw-r--r--t/app/model/responsepriority.t18
-rw-r--r--t/app/model/responsetemplate.t28
-rw-r--r--templates/web/base/report/_inspect.html6
-rwxr-xr-xtemplates/web/fixmystreet.com/about/privacy.html12
-rw-r--r--web/cobrands/fixmystreet/staff.js6
-rw-r--r--web/cobrands/sass/_layout.scss1
-rw-r--r--web/js/map-wmts-zurich.js107
15 files changed, 112 insertions, 118 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a3645a6c6..848a70df1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -42,6 +42,8 @@
- Make OpenGraph description translatable.
- Stop double-escaping title in alert-update email.
- Use inspection states in response template admin.
+ - Fixed CSS padding/overflow bug during sidebar "drawer" animations. #2132
+ - Response template containing double quote now works.
- Admin improvements:
- Inspectors can set non_public status of reports. #1992
- Default start date is shown on the dashboard.
diff --git a/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm b/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm
index 9144c1a30..a5e45d5a9 100644
--- a/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm
+++ b/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm
@@ -53,7 +53,7 @@ sub pin_colour {
sub contact_email {
my $self = shift;
- return join( '@', 'fixmystreetbs', 'buckscc.gov.uk' );
+ return join( '@', 'fixmystreetbs', 'email.buckscc.gov.uk' );
}
sub send_questionnaires {
diff --git a/perllib/FixMyStreet/DB/ResultSet/DefectType.pm b/perllib/FixMyStreet/DB/ResultSet/DefectType.pm
index b2ef77f7c..5b1247129 100644
--- a/perllib/FixMyStreet/DB/ResultSet/DefectType.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/DefectType.pm
@@ -4,7 +4,6 @@ use base 'DBIx::Class::ResultSet';
use strict;
use warnings;
use Moo;
-use HTML::Entities;
with('FixMyStreet::Roles::ContactExtra');
@@ -16,10 +15,10 @@ sub map_extras {
my ($rs, @ts) = @_;
return map {
my $meta = $_->get_extra_metadata();
- my %extra = map { $_ => encode_entities($meta->{$_}) } keys %$meta;
+ my %extra = map { $_ => $meta->{$_} } keys %$meta;
{
id => $_->id,
- name => encode_entities($_->name),
+ name => $_->name,
extra => \%extra
}
} @ts;
diff --git a/perllib/FixMyStreet/DB/ResultSet/ResponsePriority.pm b/perllib/FixMyStreet/DB/ResultSet/ResponsePriority.pm
index 89bb4dfd7..96f7cf7a0 100644
--- a/perllib/FixMyStreet/DB/ResultSet/ResponsePriority.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/ResponsePriority.pm
@@ -4,7 +4,6 @@ use base 'DBIx::Class::ResultSet';
use strict;
use warnings;
use Moo;
-use HTML::Entities;
with('FixMyStreet::Roles::ContactExtra');
@@ -14,7 +13,7 @@ sub join_table {
sub map_extras {
my ($rs, @ts) = @_;
- return map { { id => $_->id, name => encode_entities($_->name) } } @ts;
+ return map { { id => $_->id, name => $_->name } } @ts;
}
1;
diff --git a/perllib/FixMyStreet/DB/ResultSet/ResponseTemplate.pm b/perllib/FixMyStreet/DB/ResultSet/ResponseTemplate.pm
index aa070daa3..46fcba153 100644
--- a/perllib/FixMyStreet/DB/ResultSet/ResponseTemplate.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/ResponseTemplate.pm
@@ -2,7 +2,6 @@ package FixMyStreet::DB::ResultSet::ResponseTemplate;
use base 'DBIx::Class::ResultSet';
use Moo;
-use HTML::Entities;
with('FixMyStreet::Roles::ContactExtra');
@@ -17,8 +16,8 @@ sub name_column {
sub map_extras {
my ($rs, @ts) = @_;
return map {
- my $out = { id => encode_entities($_->text), name => encode_entities($_->title) };
- $out->{state} = encode_entities($_->state) if $_->state;
+ my $out = { id => $_->text, name => $_->title };
+ $out->{state} = $_->state if $_->state;
$out;
} @ts;
}
diff --git a/perllib/FixMyStreet/Map/Zurich.pm b/perllib/FixMyStreet/Map/Zurich.pm
index 8b4a3d931..6d9a309ff 100644
--- a/perllib/FixMyStreet/Map/Zurich.pm
+++ b/perllib/FixMyStreet/Map/Zurich.pm
@@ -22,20 +22,20 @@ sub tile_parameters {
my $self = shift;
my $params = {
urls => [
- 'https://www.gis.stadt-zuerich.ch/maps/rest/services/tiled95/LuftbildHybrid/MapServer/WMTS/tile',
- 'https://www.gis.stadt-zuerich.ch/maps/rest/services/tiled95/Stadtplan3D/MapServer/WMTS/tile'
+ 'http://www.ogc.stadt-zuerich.ch/mapproxy/wmts/',
+ 'http://www.ogc.stadt-zuerich.ch/mapproxy/wmts/',
],
layer_names => [ 'LuftbildHybrid', 'Stadtplan3D' ],
wmts_version => '1.0.0',
layer_style => 'default',
- matrix_set => 'default028mm',
- suffix => '.jpg', # appended to tile URLs
+ matrix_set => 'stzh',
+ suffix => '.jpeg', # appended to tile URLs
size => 512, # pixels
dpi => 96,
inches_per_unit => 39.3701, # BNG uses metres
projection => 'EPSG:2056',
- origin_x => -27386400.0,
- origin_y => 31814500.0,
+ origin_x => 2672499.0,
+ origin_y => 1256999.0,
};
return $params;
}
diff --git a/perllib/FixMyStreet/Script/Reports.pm b/perllib/FixMyStreet/Script/Reports.pm
index 5e8c99037..578d966d6 100644
--- a/perllib/FixMyStreet/Script/Reports.pm
+++ b/perllib/FixMyStreet/Script/Reports.pm
@@ -306,7 +306,7 @@ sub _send_report_sent_email {
To => $row->user->email,
From => [ $cobrand->contact_email, $cobrand->contact_name ],
},
- $cobrand->contact_email,
+ undef,
$nomail,
$cobrand,
$row->lang,
diff --git a/t/app/model/defecttype.t b/t/app/model/defecttype.t
index 4f380db59..e924129e2 100644
--- a/t/app/model/defecttype.t
+++ b/t/app/model/defecttype.t
@@ -99,27 +99,6 @@ subtest 'by_categories returns defect types for an area with multiple bodies' =>
is scalar @$pavements, 3, 'Pavements have 3 defect types';
};
-subtest 'by_categories encodes HTML entities' => sub {
- my $apostrophe_defect_type = FixMyStreet::App->model('DB::DefectType')->find_or_create(
- {
- body_id => $oxfordshire->id,
- name => 'This defect type\'s name has an apostrophe',
- description => 'This defect type is for all categories'
- }
- );
- $apostrophe_defect_type->set_extra_metadata('defect_code' => 'Here\'s an apostrophe');
- $apostrophe_defect_type->update();
-
- my @contacts = FixMyStreet::DB->resultset('Contact')->not_deleted->search( { body_id => [ $oxfordshire->id ] } )->all;
- my $defect_types = FixMyStreet::App->model('DB::DefectType')->by_categories($area_id, @contacts);
- my $traffic_lights = decode_json($defect_types->{'Traffic lights'});
- my $defect_type = @$traffic_lights[2];
- is $defect_type->{name}, 'This defect type's name has an apostrophe';
- is $defect_type->{extra}->{defect_code}, 'Here's an apostrophe';
-
-};
-
-
END {
done_testing();
}
diff --git a/t/app/model/responsepriority.t b/t/app/model/responsepriority.t
index 03c5bccae..4e624bf07 100644
--- a/t/app/model/responsepriority.t
+++ b/t/app/model/responsepriority.t
@@ -78,24 +78,6 @@ subtest 'by_categories returns all response priorities for an area with multiple
is scalar @$traffic_lights, 2, 'Traffic lights have 2 defect types';
};
-subtest 'by_categories encodes HTML entities' => sub {
- FixMyStreet::App->model('DB::ResponsePriority')->find_or_create(
- {
- body_id => $other_body->id,
- name => 'This priority\'s name has an apostrophe',
- description => 'This priority is for all categories'
- }
- );
-
- my @contacts = FixMyStreet::DB->resultset('Contact')->not_deleted->search( { body_id => [ $oxfordshire->id ] } )->all;
- my $priorities = FixMyStreet::App->model('DB::ResponsePriority')->by_categories($area_id, @contacts);
-
- my $traffic_lights = decode_json($priorities->{'Traffic lights'});
- use Data::Dumper;
- my $priority = @$traffic_lights[2];
- is $priority->{name}, 'This priority's name has an apostrophe';
-};
-
END {
$mech->delete_body( $other_body );
$mech->delete_body( $oxfordshire );
diff --git a/t/app/model/responsetemplate.t b/t/app/model/responsetemplate.t
new file mode 100644
index 000000000..fbabc1c12
--- /dev/null
+++ b/t/app/model/responsetemplate.t
@@ -0,0 +1,28 @@
+use FixMyStreet::TestMech;
+use JSON::MaybeXS;
+
+my $mech = FixMyStreet::TestMech->new;
+my $area_id = 2651;
+
+my $body = $mech->create_body_ok($area_id, 'Edinburgh Council');
+my $c1 = $mech->create_contact_ok(category => 'Potholes', body_id => $body->id, email => 'p');
+my $c2 = $mech->create_contact_ok(category => 'Graffiti', body_id => $body->id, email => 'g');
+my $t1 = FixMyStreet::DB->resultset('ResponseTemplate')->create({ body_id => $body->id, title => "Title 1", text => "Text 1" });
+my $t2 = FixMyStreet::DB->resultset('ResponseTemplate')->create({ body_id => $body->id, title => "Title 2", text => "Text 2", state => 'investigating' });
+my $t3 = FixMyStreet::DB->resultset('ResponseTemplate')->create({ body_id => $body->id, title => "Title 3", text => "Text 3" });
+$t1->add_to_contacts($c1);
+$t2->add_to_contacts($c2);
+
+my @contacts = FixMyStreet::DB->resultset('Contact')->not_deleted->search( { body_id => [ $body->id ] } )->all;
+
+subtest 'by_categories returns allresponse templates grouped by category' => sub {
+ my $templates = FixMyStreet::App->model('DB::ResponseTemplate')->by_categories($area_id, @contacts);
+ my $potholes = decode_json($templates->{Potholes});
+ my $graffiti = decode_json($templates->{Graffiti});
+
+ is scalar @$potholes, 2, 'Potholes have 2 templates';
+ is scalar @$graffiti, 2, 'Graffiti has 2 templates';
+ is $graffiti->[0]->{state}, 'investigating', 'Graffiti first template has right state';
+};
+
+done_testing;
diff --git a/templates/web/base/report/_inspect.html b/templates/web/base/report/_inspect.html
index a81510f22..222780dcb 100644
--- a/templates/web/base/report/_inspect.html
+++ b/templates/web/base/report/_inspect.html
@@ -72,9 +72,9 @@
cat_prefix = "category_" _ cat_prefix _ "_" %]
<p data-category="[% cat_name | html %]"
[%~ IF cat_name != problem.category %] class="hidden"[% END %]
- data-priorities='[% priorities_by_category.$cat_name %]'
- data-defect-types='[% category_defect_types.$cat_name %]'
- data-templates='[% templates_by_category.$cat_name %]'>
+ data-priorities='[% priorities_by_category.$cat_name | html %]'
+ data-defect-types='[% category_defect_types.$cat_name | html %]'
+ data-templates='[% templates_by_category.$cat_name | html %]'>
[% IF cat_name == problem.category %]
[% INCLUDE 'report/new/category_extras_fields.html' metas=category_extras.$cat_name hide_notices=1 show_hidden=1 %]
[% ELSE %]
diff --git a/templates/web/fixmystreet.com/about/privacy.html b/templates/web/fixmystreet.com/about/privacy.html
index 559f6c135..24bf47ec8 100755
--- a/templates/web/fixmystreet.com/about/privacy.html
+++ b/templates/web/fixmystreet.com/about/privacy.html
@@ -313,6 +313,18 @@ When you make a report
</p>
<h2>
+ Your right to object
+</h2>
+<p>
+ The General Data Protection Regulation gives you the right to object to our
+ processing of your personal information and to ask us to stop processing it.
+ However, it also gives us the right to continue to process it if we can demonstrate
+ compelling legitimate grounds for the processing that override your interests, rights
+ and freedoms. To exercise your right to object, you can <a href="/contact">
+ contact us</a>, giving specific reasons why you are objecting to the processing of
+ your personal data. These reasons should be based upon your particular situation.
+</p>
+<h2>
Your right to access
</h2>
diff --git a/web/cobrands/fixmystreet/staff.js b/web/cobrands/fixmystreet/staff.js
index 134f57a7f..0dd635437 100644
--- a/web/cobrands/fixmystreet/staff.js
+++ b/web/cobrands/fixmystreet/staff.js
@@ -232,6 +232,9 @@ $.extend(fixmystreet.set_up, {
opts.state = opts.state || $inspect_form.find('[name=state]').val();
var selector = "[data-category='" + opts.category + "']";
var data = $inspect_form.find(selector).data('templates') || [];
+ if (data.constructor !== Array) {
+ return;
+ }
data = $.grep(data, function(d, i) {
if (!d.state || d.state == opts.state) {
return true;
@@ -243,6 +246,9 @@ $.extend(fixmystreet.set_up, {
function populateSelect($select, data, label_formatter) {
$select.find('option:gt(0)').remove();
+ if (data.constructor !== Array) {
+ return;
+ }
$.each(data, function(k,v) {
var label = window.fixmystreet.utils[label_formatter](v);
var $opt = $('<option></option>').attr('value', v.id).text(label);
diff --git a/web/cobrands/sass/_layout.scss b/web/cobrands/sass/_layout.scss
index 13c2dff72..b374d8d3e 100644
--- a/web/cobrands/sass/_layout.scss
+++ b/web/cobrands/sass/_layout.scss
@@ -699,6 +699,7 @@ body.authpage {
&.static {
padding: 0 0 1em;
+ margin: 0 -1em; // overlap parent side padding
position: static;
width: auto; // avoid horizontal scrollbar as drawer opens (on devices with permanent scroll bars)
}
diff --git a/web/js/map-wmts-zurich.js b/web/js/map-wmts-zurich.js
index 0a753e831..eda0fbf44 100644
--- a/web/js/map-wmts-zurich.js
+++ b/web/js/map-wmts-zurich.js
@@ -4,112 +4,99 @@
// From 'fullExtent' from http://www.gis.stadt-zuerich.ch/maps/rest/services/tiled95/LuftbildHybrid/MapServer?f=pjson
fixmystreet.maps.layer_bounds = new OpenLayers.Bounds(
- 2674687.5, // W
- 1240500, // S
- 2690000, // E
- 1255500); // N
+ 2672499, // W
+ 1238999, // S
+ 2689999, // E
+ 1256999); // N
fixmystreet.maps.matrix_ids = [
- // The two highest zoom levels are pretty much useless so they're disabled.
- // {
- // "matrixHeight": 882,
- // "scaleDenominator": 241905.24571522293,
- // "identifier": "0",
- // "tileWidth": 512,
- // "supportedCRS": "urn:ogc:def:crs:EPSG::2056",
- // "tileHeight": 512,
- // "matrixWidth": 868
- // },
- // {
- // "matrixHeight": 1764,
- // "scaleDenominator": 120952.62285761147,
- // "identifier": "1",
- // "tileWidth": 512,
- // "supportedCRS": "urn:ogc:def:crs:EPSG::2056",
- // "tileHeight": 512,
- // "matrixWidth": 1735
- // },
-
{
- "matrixHeight": 3527,
- "scaleDenominator": 60476.31142880573,
+ "matrixHeight": 7,
+ "scaleDenominator": 241904.761905,
+ "identifier": "0",
+ "tileWidth": 512,
+ "tileHeight": 512,
+ "matrixWidth": 13
+ },
+ {
+ "matrixHeight": 14,
+ "scaleDenominator": 120952.380952,
+ "identifier": "1",
+ "tileWidth": 512,
+ "tileHeight": 512,
+ "matrixWidth": 25
+ },
+ {
+ "matrixHeight": 28,
+ "scaleDenominator": 60476.1904761,
"identifier": "2",
"tileWidth": 512,
- "supportedCRS": "urn:ogc:def:crs:EPSG::2056",
"tileHeight": 512,
- "matrixWidth": 3470
+ "matrixWidth": 49
},
{
- "matrixHeight": 7053,
- "scaleDenominator": 30238.155714402867,
+ "matrixHeight": 56,
+ "scaleDenominator": 30238.0952382,
"identifier": "3",
"tileWidth": 512,
- "supportedCRS": "urn:ogc:def:crs:EPSG::2056",
"tileHeight": 512,
- "matrixWidth": 6939
+ "matrixWidth": 97
},
{
- "matrixHeight": 14106,
- "scaleDenominator": 15119.077857201433,
+ "matrixHeight": 111,
+ "scaleDenominator": 15119.0476189,
"identifier": "4",
"tileWidth": 512,
- "supportedCRS": "urn:ogc:def:crs:EPSG::2056",
"tileHeight": 512,
- "matrixWidth": 13877
+ "matrixWidth": 194
},
{
- "matrixHeight": 28211,
- "scaleDenominator": 7559.538928600717,
+ "matrixHeight": 222,
+ "scaleDenominator": 7559.52380964,
"identifier": "5",
"tileWidth": 512,
- "supportedCRS": "urn:ogc:def:crs:EPSG::2056",
"tileHeight": 512,
- "matrixWidth": 27753
+ "matrixWidth": 388
},
{
- "matrixHeight": 56422,
- "scaleDenominator": 3779.7694643003583,
+ "matrixHeight": 443,
+ "scaleDenominator": 3779.76190464,
"identifier": "6",
"tileWidth": 512,
- "supportedCRS": "urn:ogc:def:crs:EPSG::2056",
"tileHeight": 512,
- "matrixWidth": 55505
+ "matrixWidth": 776
},
{
- "matrixHeight": 112844,
- "scaleDenominator": 1889.8847321501792,
+ "matrixHeight": 886,
+ "scaleDenominator": 1889.8809525,
"identifier": "7",
"tileWidth": 512,
- "supportedCRS": "urn:ogc:def:crs:EPSG::2056",
"tileHeight": 512,
- "matrixWidth": 111010
+ "matrixWidth": 1551
},
{
- "matrixHeight": 225687,
- "scaleDenominator": 944.9423660750896,
+ "matrixHeight": 1772,
+ "scaleDenominator": 944.940476071,
"identifier": "8",
"tileWidth": 512,
- "supportedCRS": "urn:ogc:def:crs:EPSG::2056",
"tileHeight": 512,
- "matrixWidth": 222020
+ "matrixWidth": 3101
},
{
- "matrixHeight": 451374,
- "scaleDenominator": 472.4711830375448,
+ "matrixHeight": 3544,
+ "scaleDenominator": 472.470238214,
"identifier": "9",
"tileWidth": 512,
- "supportedCRS": "urn:ogc:def:crs:EPSG::2056",
"tileHeight": 512,
- "matrixWidth": 444039
+ "matrixWidth": 6201
},
{
- "matrixHeight": 902748,
- "scaleDenominator": 236.2355915187724,
+ "matrixHeight": 7087,
+ "scaleDenominator": 236.235118929,
"identifier": "10",
"tileWidth": 512,
- "supportedCRS": "urn:ogc:def:crs:EPSG::2056",
"tileHeight": 512,
- "matrixWidth": 888078
+ "matrixWidth": 12402
}
];