+ + diff --git a/templates/web/harrogate/report/new/councils_extra_text.html b/templates/web/harrogate/report/new/councils_extra_text.html new file mode 100644 index 000000000..92dc93452 --- /dev/null +++ b/templates/web/harrogate/report/new/councils_extra_text.html @@ -0,0 +1,10 @@ +
+

+NB: though we will forward your request as appropriate, +reports for problems managed by North Yorkshire County Council are not shown on this map. +View all problems in that area on +FixMyStreet.com. +

+
+ +Do not use this to report emergencies outside of working hours. diff --git a/templates/web/harrogate/static/privacy.html b/templates/web/harrogate/static/privacy.html new file mode 100755 index 000000000..0107d0873 --- /dev/null +++ b/templates/web/harrogate/static/privacy.html @@ -0,0 +1,56 @@ +[% INCLUDE 'header.html', + title = loc('Frequently Asked Questions'), + bodyclass = 'twothirdswidthpage' %] + + + +

Privacy, cookies, and third party services

+ +

Our use of your data, cookies, and external services: what you +should know, and how to opt out if you want to.

+ +

Privacy

+ +
+
Who gets to see my email address?
+
+

If you submit a problem, your details, and details of the problem, will be + submitted to Harrogate Borough Council, or North Yorkshire County Council, as + appropriate. Other than the council, only people we authorise to view the + FixMyStreet administration interface will be able to see your email address and + they will never use it for anything other than to help administer + FixMyStreet.

+

We will never give or sell your email address to anyone else, unless we are + obliged to by law. Your name will not be published anywhere unless you let us.

+
+ +
What emails will you send to me?
+
We will email you when we have received your report, and when it has + been investigated and actioned. We will only send you emails that + relate to an issue you have reported.
+ +
+
+ +

Cookies

+ +

To make our service easier or more useful, we sometimes place small data +files on your computer or mobile phone, known as cookies; many websites do +this. We use this information to, for example, remember you have logged in so +you don't need to do that on every page. Below, we list the cookies and +services that this site can use. + + + + +
NameTypical ContentExpires
fixmystreet_app_sessionA random unique identifierWhen browser is closed, or four weeks if “Keep me signed in” is ticked
+ +[% INCLUDE 'footer.html' pagefooter = 'yes' %] diff --git a/web/cobrands/harrogate/HBCLogo-cropped.png b/web/cobrands/harrogate/HBCLogo-cropped.png new file mode 100755 index 000000000..4421820d2 Binary files /dev/null and b/web/cobrands/harrogate/HBCLogo-cropped.png differ diff --git a/web/cobrands/harrogate/HBLogo.png b/web/cobrands/harrogate/HBLogo.png new file mode 100755 index 000000000..03cf2b4f5 Binary files /dev/null and b/web/cobrands/harrogate/HBLogo.png differ diff --git a/web/cobrands/harrogate/_colours.scss b/web/cobrands/harrogate/_colours.scss index 2b9714835..a79b7acfb 100644 --- a/web/cobrands/harrogate/_colours.scss +++ b/web/cobrands/harrogate/_colours.scss @@ -18,5 +18,5 @@ $base_fg: #1a1a1a; /* Following seem to be required in layout.scss */ $map_nav_bg: #222; -$nav_fg: #fff; +$nav_fg: #000; $nav_fg_hover: #444; diff --git a/web/cobrands/harrogate/base.scss b/web/cobrands/harrogate/base.scss index 94dd39ee7..eccb1a84f 100644 --- a/web/cobrands/harrogate/base.scss +++ b/web/cobrands/harrogate/base.scss @@ -11,10 +11,11 @@ body.frontpage #site-logo, #site-logo { display: block; - background: url("/cobrands/harrogate/HBCLogo-mobile.png") 0 0 no-repeat; margin: 2px; padding-left: 10px; position: static; + + background: url("/cobrands/harrogate/HBCLogo-mobile.png") 0 0 no-repeat; width: 106px; height: 37px; } @@ -22,21 +23,43 @@ body.frontpage #site-logo, #main-nav ul#main-menu li { // blue button background, darker if selected - background: $primary; - &.menu-item-selected { background: $primary_dark; } - - @include border-radius(1em); - padding: 0.25em; - margin: 0.25em; - border: solid 1px black; + background: #ededed; + &.menu-item-selected { + background: $primary; + span { + color: #fff; + } + } span { color: $nav_fg; } } +#main-nav ul#main-menu li, +body.mappage #main-nav ul#main-menu li, +{ + padding-left: 0.25em; + padding-right: 0.25em; + padding-top: 0; + padding-bottom: 0; + + a { padding: 0 } +} + label[for=form_INFO_TEXT] { background: yellow; border: solid 1px black; padding: 1em; } + +#site-header { + background: none; +} + + +#council_responsibilities_note { + background-color: lighten($primary, 30%); + padding: 0.5em; + font-size: 0.8em; +} diff --git a/web/cobrands/harrogate/layout.scss b/web/cobrands/harrogate/layout.scss index 0e76bb111..480a07f5d 100644 --- a/web/cobrands/harrogate/layout.scss +++ b/web/cobrands/harrogate/layout.scss @@ -2,24 +2,184 @@ @import "../sass/layout"; @media only screen and (min-width: 48em) { + #site-logo, + .ie6 #site-logo, + body.frontpage #site-logo, .ie6 body.frontpage #site-logo, + + body.authpage #site-logo, + .ie6 body.authpage #site-logo, + body.twothirdswidthpage #site-logo, .ie6 body.twothirdswidthpage #site-logo { position: relative; - top: 5px; + top: 1.2em; margin: 0; - margin-left: 2.25em; padding: 0; background: url("/cobrands/harrogate/HBCLogo.png") 0 0 no-repeat; width: 227px; height: 122px; } + + body.frontpage #site-header, + .ie6 body.frontpage #site-header, + + body.twothirdswidthpage #site-header, + .ie6 body.twothirdswidthpage #site-header, + + body.authpage #site-header, + .ie6 body.authpage #site-header, + + body.mappage #site-header, + .ie6 body.mappage #site-header, + body.mappage .nav-wrapper-2, + .ie6 body.mappage .nav-wrapper-2 + { + height: 10em; + } + + #fms_pan_zoom { + top: 10.75em!important; + } +} + +@media only screen and (min-width: 48em) { + body.twothirdswidthpage .container .content footer .tablewrapper a:link, + body.twothirdswidthpage .container .content footer .tablewrapper a:visited, + body.fullwidthpage .container .content footer .tablewrapper a:link, + body.fullwidthpage .container .content footer .tablewrapper a:visited { + color: white; + } + + body.mappage #user-meta+.container .content { + padding-top: 1.5em; + } +} + +body.fullwidthpage #main-nav, +body.frontpage #main-nav, +body.twothirdswidthpage #main-nav, +body.authpage #main-nav +{ + margin-top: 3.2em; +} + +body.mappage #main-nav, +{ + // TODO would be better to edit containers to figure out where missing em is defined + margin-top: 2.2em; +} + +body.fullwidthpage .container .content, +body.twothirdswidthpage .container .content { + margin: 0; + padding-left: 0; + padding-right: 0; +} + +@media only screen and (min-width: 48em) { + body.fullwidthpage .container .content { + margin-top: 3em; // push far enough for the sign-out link to also be visible + } +} + +body.twothirdswidthpage .content aside { + margin-top: 2em; + @include box-shadow(none); +} + + +body.twothirdswidthpage form.full-width { + margin: 0; +} + +body.mappage #main-nav { + ul#main-menu { + padding: 1em 0; + } +} + +body.mappage #main-nav ul#main-menu li a, body.mappage #main-nav ul#main-menu li span { + padding: 0.75em; +} + +body.mappage #main-nav ul#main-menu li a.report-a-problem-btn, +#main-nav ul#main-menu li a.report-a-problem-btn { + margin: 0; + padding: 0.75em; +} +#main-nav ul#main-menu li a.report-a-problem-btn { + &:hover { + background: #444; + color: #fff; + @include border-radius(0em); + } +} + +#main-nav { + ul#main-menu { + li { + a.report-a-problem-btn { + color: #000; + background: #ededed; + } + } + } +} + +body.mappage .nav-wrapper .nav-wrapper-2 { + background: #fff; + border-bottom: solid 4px $primary; +} + +.nav-wrapper .nav-wrapper-2 { + border-top: 0px; } -#main-nav ul#main-menu li { - span { - color: $nav_fg; +#front-main { + background: none; + padding: 0; + + #front-main-container { + background: $primary; + padding: 2em 0; + margin-bottom: 1.2em; + @include border-radius(12px); + + #postcode-intro { + margin: 0 2em; + } + } + +} + +body.frontpage #user-meta p { + top: -2.4em; +} + +body.mappage #user-meta { + top: 2em; + p { + background: $primary; + border-color: $primary_dark; + } +} + +body.mappage .content { + margin-top: 4em; +} + + +body.twothirdswidthpage .container .content footer, +body.fullwidthpage .container .content footer +{ + .tablewrapper { + width: 100%; + background: $primary; + @include border-radius(12px); + margin-bottom: 2em; + } } -- cgit v1.2.3 From b86b78c1f61e31ab59940d5c82b79961bccb56f9 Mon Sep 17 00:00:00 2001 From: Hakim Cassimally Date: Thu, 8 Jan 2015 14:50:49 +0000 Subject: [Harrogate] update email for live deployment --- perllib/FixMyStreet/Cobrand/Harrogate.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perllib/FixMyStreet/Cobrand/Harrogate.pm b/perllib/FixMyStreet/Cobrand/Harrogate.pm index 7249bcece..6bcc2f227 100644 --- a/perllib/FixMyStreet/Cobrand/Harrogate.pm +++ b/perllib/FixMyStreet/Cobrand/Harrogate.pm @@ -56,7 +56,7 @@ Can run with a script or command line like: =cut sub temp_email_to_update { - return 'test@example.com'; + return 'CustomerServices@harrogate.gov.uk'; } sub temp_update_contacts { -- cgit v1.2.3 From 0403fb7e2abcac670039372181c870a8c2815d2a Mon Sep 17 00:00:00 2001 From: Hakim Cassimally Date: Fri, 9 Jan 2015 14:54:45 +0000 Subject: [EastSussex] disable questionnaires at ESCC request today --- perllib/FixMyStreet/Cobrand/EastSussex.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/perllib/FixMyStreet/Cobrand/EastSussex.pm b/perllib/FixMyStreet/Cobrand/EastSussex.pm index 5447545e7..5aabae449 100644 --- a/perllib/FixMyStreet/Cobrand/EastSussex.pm +++ b/perllib/FixMyStreet/Cobrand/EastSussex.pm @@ -119,5 +119,9 @@ sub pin_colour { return $open_states->{ $p->state } ? 'yellow' : 'green'; } +sub send_questionnaires { + return 0; +} + 1; -- cgit v1.2.3 From 14384f023d897e40a6f02a58eea0f3d84c6584d8 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 9 Jan 2015 17:40:53 +0000 Subject: Revert most of "Experiment, no pins by default." This reverts most of commit 71b400a1f5991b9a693095c417aa61e274a5215d, leaving the skip-this-step CSS changes and the tweaks to the /ajax JSON output. --- .../web/fixmystreet.com/around/_report_banner.html | 11 ------ .../web/fixmystreet.com/around/tabbed_lists.html | 46 ---------------------- templates/web/fixmystreet.com/header_extra.html | 21 ---------- web/cobrands/fixmystreet/fixmystreet.js | 15 +------ web/cobrands/fixmystreet/layout.scss | 9 ----- web/js/map-OpenLayers.js | 4 -- 6 files changed, 2 insertions(+), 104 deletions(-) delete mode 100755 templates/web/fixmystreet.com/around/_report_banner.html delete mode 100644 templates/web/fixmystreet.com/around/tabbed_lists.html diff --git a/templates/web/fixmystreet.com/around/_report_banner.html b/templates/web/fixmystreet.com/around/_report_banner.html deleted file mode 100755 index 9d0d9bdfe..000000000 --- a/templates/web/fixmystreet.com/around/_report_banner.html +++ /dev/null @@ -1,11 +0,0 @@ -[%# Identical to parent, just with variant0s %] - -

- [% loc( 'Click map to report a problem' ) %] - [% IF c.cobrand.moniker == 'bromley' %] - Yellow pins show existing reports - [% END %] -

- - [% loc("Can't see the map? Skip this step") %] - diff --git a/templates/web/fixmystreet.com/around/tabbed_lists.html b/templates/web/fixmystreet.com/around/tabbed_lists.html deleted file mode 100644 index 6a3cdf8a9..000000000 --- a/templates/web/fixmystreet.com/around/tabbed_lists.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - -
-
-

[% loc( 'Click the map to
report a problem' ) %]

- - - [% loc("Can't see the map? Skip this step") %] - - -

Don’t worry if it’s not in precisely the right place,
- you can move the pin afterwards.

-
-
- -
-
-
    - [% INCLUDE "around/on_map_list_items.html" %] -
-
-
- -
-
    - [% INCLUDE "around/around_map_list_items.html" %] -
-
- - diff --git a/templates/web/fixmystreet.com/header_extra.html b/templates/web/fixmystreet.com/header_extra.html index 65f88be14..27ffc12a1 100644 --- a/templates/web/fixmystreet.com/header_extra.html +++ b/templates/web/fixmystreet.com/header_extra.html @@ -1,24 +1,3 @@ -[%# We are conducting an A/B experiment on the first step of reporting process %] -[% IF page == 'around' %] - - - -[% END %] - [% INCLUDE 'tracking_code.html' %] diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index 4e7315017..fdecee9db 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -46,17 +46,6 @@ function tabs(elem, indirect) { //hide / show the right tab $('.tab.open').hide().removeClass('open'); $(target).show().addClass('open'); - - // Clicking on tabs to show/hide pins, content experiment - if (typeof(variation) !== 'undefined' && variation == 1) { - if (target == '#current_near_tab' && !fixmystreet.markers.getVisibility()) { - $('#hide_pins_link').click(); - } - if (target == '#reporting' && fixmystreet.markers.getVisibility()) { - $('#hide_pins_link').click(); - } - } - } } @@ -187,8 +176,8 @@ $(function(){ * Tabs */ //make initial tab active - $('.tab-nav a:visible').first().addClass('active'); - $('.tab:visible').first().addClass('open'); + $('.tab-nav a').first().addClass('active'); + $('.tab').first().addClass('open'); //hide other tabs $('.tab').not('.open').hide(); diff --git a/web/cobrands/fixmystreet/layout.scss b/web/cobrands/fixmystreet/layout.scss index 21de4f271..ded1ed911 100644 --- a/web/cobrands/fixmystreet/layout.scss +++ b/web/cobrands/fixmystreet/layout.scss @@ -92,15 +92,6 @@ body.mappage { @include background(linear-gradient(#000, #222 10%, #222 90%, #000)); } } - - #reporting { - padding: 1em; - text-align: center; - - h1 { - line-height: 1.2em; - } - } } #main-nav { diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 63625efb8..c7bfef2b0 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -227,10 +227,6 @@ function fixmystreet_onload() { } }); - if (fixmystreet.initial_hide_pins) { - $('#hide_pins_link').click(); - } - $('#all_pins_link').click(function(e) { e.preventDefault(); fixmystreet.markers.setVisibility(true); -- cgit v1.2.3 From 4ae8d597a80d91084dcdcd999d480f41a57c70d1 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 9 Jan 2015 17:58:43 +0000 Subject: Use HTTPS OpenStreetMap tiles. --- perllib/FixMyStreet/Map/OSM.pm | 8 ++++---- web/js/map-OpenStreetMap.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/perllib/FixMyStreet/Map/OSM.pm b/perllib/FixMyStreet/Map/OSM.pm index 74af0e9f3..82ddd293b 100644 --- a/perllib/FixMyStreet/Map/OSM.pm +++ b/perllib/FixMyStreet/Map/OSM.pm @@ -29,10 +29,10 @@ sub map_tiles { my ( $x, $y, $z ) = ( $params{x_tile}, $params{y_tile}, $params{zoom_act} ); my $tile_url = $self->base_tile_url(); return [ - "http://a.$tile_url/$z/" . ($x - 1) . "/" . ($y - 1) . ".png", - "http://b.$tile_url/$z/$x/" . ($y - 1) . ".png", - "http://c.$tile_url/$z/" . ($x - 1) . "/$y.png", - "http://$tile_url/$z/$x/$y.png", + "https://a.$tile_url/$z/" . ($x - 1) . "/" . ($y - 1) . ".png", + "https://b.$tile_url/$z/$x/" . ($y - 1) . ".png", + "https://c.$tile_url/$z/" . ($x - 1) . "/$y.png", + "https://a.$tile_url/$z/$x/$y.png", ]; } diff --git a/web/js/map-OpenStreetMap.js b/web/js/map-OpenStreetMap.js index fc0afedc3..7ef222da7 100644 --- a/web/js/map-OpenStreetMap.js +++ b/web/js/map-OpenStreetMap.js @@ -8,7 +8,7 @@ function set_map_config(perm) { //new OpenLayers.Control.LayerSwitcher(), new OpenLayers.Control.Navigation(), new OpenLayers.Control.PermalinkFMS(permalink_id), - new OpenLayers.Control.PermalinkFMSz('osm_link', 'http://www.openstreetmap.org/'), + new OpenLayers.Control.PermalinkFMSz('osm_link', 'https://www.openstreetmap.org/'), new OpenLayers.Control.PanZoomFMS({id: 'fms_pan_zoom' }) ]; } @@ -31,9 +31,9 @@ OpenLayers.Layer.OSM.Mapnik = OpenLayers.Class(OpenLayers.Layer.OSM, { */ initialize: function(name, options) { var url = [ - "http://a.tile.openstreetmap.org/${z}/${x}/${y}.png", - "http://b.tile.openstreetmap.org/${z}/${x}/${y}.png", - "http://c.tile.openstreetmap.org/${z}/${x}/${y}.png" + "https://a.tile.openstreetmap.org/${z}/${x}/${y}.png", + "https://b.tile.openstreetmap.org/${z}/${x}/${y}.png", + "https://c.tile.openstreetmap.org/${z}/${x}/${y}.png" ]; options = OpenLayers.Util.extend({ /* Below line added to OSM's file in order to allow minimum zoom level */ -- cgit v1.2.3 From 676181084d88b0ec94d42521162b4571cb0c0552 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 9 Jan 2015 22:55:08 +0000 Subject: Use same handling for cron and non-cron email. This means that e.g. SMTP authentication is used when set up by all emails, not just non-cron ones. Fixes #988. --- bin/send-comments | 1 - bin/zurich-overdue-alert | 5 +--- conf/general.yml-example | 2 +- perllib/FixMyStreet/App.pm | 32 +++++++++++++++-------- perllib/FixMyStreet/App/Controller/Contact.pm | 2 ++ perllib/FixMyStreet/App/Model/EmailSend.pm | 4 +-- perllib/FixMyStreet/DB/ResultSet/AlertType.pm | 4 +-- perllib/FixMyStreet/DB/ResultSet/Problem.pm | 6 ++--- perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm | 4 +-- perllib/FixMyStreet/EmailSend.pm | 9 ------- perllib/FixMyStreet/EmailSend/ContactEmail.pm | 9 +++++++ perllib/FixMyStreet/EmailSend/DoNotReply.pm | 9 +++++++ perllib/FixMyStreet/SendReport.pm | 2 ++ perllib/FixMyStreet/SendReport/Email.pm | 32 +++++++++++------------ perllib/FixMyStreet/SendReport/EmptyHomes.pm | 11 +++----- perllib/FixMyStreet/SendReport/NI.pm | 5 +--- perllib/FixMyStreet/SendReport/Zurich.pm | 2 +- t/app/model/problem.t | 2 +- t/app/sendreport/email.t | 4 +-- 19 files changed, 75 insertions(+), 70 deletions(-) delete mode 100644 perllib/FixMyStreet/EmailSend.pm create mode 100644 perllib/FixMyStreet/EmailSend/ContactEmail.pm create mode 100644 perllib/FixMyStreet/EmailSend/DoNotReply.pm diff --git a/bin/send-comments b/bin/send-comments index 03adfb095..2192f674c 100755 --- a/bin/send-comments +++ b/bin/send-comments @@ -21,7 +21,6 @@ use FixMyStreet::App; use Utils; use mySociety::Config; -use mySociety::EmailUtil; use Open311; diff --git a/bin/zurich-overdue-alert b/bin/zurich-overdue-alert index e7c23b493..c09aef1e2 100755 --- a/bin/zurich-overdue-alert +++ b/bin/zurich-overdue-alert @@ -62,16 +62,14 @@ sub send_alert { admin_url => $cobrand->admin_base_url, }; - my $env_to = [ $body_email ]; my $to = [ [ $body_email, $body->name ] ]; if ( $include_parent ) { my $parent = $body->parent; my $parent_email = $parent->endpoint; - push @$env_to, $parent_email; push @$to, [ $parent_email, $parent->name ]; } - my $result = FixMyStreet::App->send_email_cron( + FixMyStreet::App->send_email_cron( { _template_ => $template, _parameters_ => $h, @@ -79,7 +77,6 @@ sub send_alert { From => [ FixMyStreet->config('CONTACT_EMAIL'), FixMyStreet->config('CONTACT_NAME') ], }, FixMyStreet->config('CONTACT_EMAIL'), - $env_to, $nomail ); } diff --git a/conf/general.yml-example b/conf/general.yml-example index fc20a90ea..9770ade86 100644 --- a/conf/general.yml-example +++ b/conf/general.yml-example @@ -37,7 +37,7 @@ DO_NOT_REPLY_EMAIL: 'do-not-reply@example.org' # Whether this is a development site or not. It will mean e.g. templates/ # CSS modified times aren't cached STAGING_SITE: 1 -# Normally, a staging site will route all reports to CONTACT_EMAIL on a +# Normally, a staging site will route all reports to the reporter on a # development site (when STAGING_SITE is 1), to guard against sending fake # reports to live places. Set this to 1 if you want a dev site to route # reports as normal. diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index e5e483937..fd70ffda8 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -10,7 +10,6 @@ use FixMyStreet; use FixMyStreet::Cobrand; use Memcached; use mySociety::Email; -use mySociety::EmailUtil; use mySociety::Random qw(random_bytes); use FixMyStreet::Map; @@ -348,9 +347,19 @@ sub send_email { } sub send_email_cron { - my ( $c, $params, $env_from, $env_to, $nomail, $cobrand, $lang_code ) = @_; - - return 1 if $c->is_abuser( $env_to ); + my ( $c, $params, $env_from, $nomail, $cobrand, $lang_code ) = @_; + + my $first_to; + if (ref($params->{To}) eq 'ARRAY') { + if (ref($params->{To}[0]) eq 'ARRAY') { + $first_to = $params->{To}[0][0]; + } else { + $first_to = $params->{To}[0]; + } + } else { + $first_to = $params->{To}; + } + return 1 if $c->is_abuser($first_to); $params->{'Message-ID'} = sprintf('', time(), unpack('h*', random_bytes(5, 1)), FixMyStreet->config('EMAIL_DOMAIN') @@ -387,15 +396,16 @@ sub send_email_cron { $params->{_line_indent} = ''; my $email = mySociety::Locale::in_gb_locale { mySociety::Email::construct_email($params) }; - if ( FixMyStreet->test_mode ) { - my $sender = Email::Send->new({ mailer => 'Test' }); - $sender->send( $email ); - return 0; - } elsif (!$nomail) { - return mySociety::EmailUtil::send_email( $email, $env_from, @$env_to ); - } else { + if ($nomail) { print $email; return 1; # Failure + } else { + my %model_args; + if (!FixMyStreet->test_mode && $env_from eq FixMyStreet->config('CONTACT_EMAIL')) { + $model_args{mailer} = 'FixMyStreet::EmailSend::ContactEmail'; + } + my $result = $c->model('EmailSend', %model_args)->send($email); + return $result ? 0 : 1; } } diff --git a/perllib/FixMyStreet/App/Controller/Contact.pm b/perllib/FixMyStreet/App/Controller/Contact.pm index 5a51c8494..f48518d77 100644 --- a/perllib/FixMyStreet/App/Controller/Contact.pm +++ b/perllib/FixMyStreet/App/Controller/Contact.pm @@ -4,6 +4,8 @@ use namespace::autoclean; BEGIN { extends 'Catalyst::Controller'; } +use mySociety::EmailUtil; + =head1 NAME FixMyStreet::App::Controller::Contact - Catalyst Controller diff --git a/perllib/FixMyStreet/App/Model/EmailSend.pm b/perllib/FixMyStreet/App/Model/EmailSend.pm index 7f130c26d..475026267 100644 --- a/perllib/FixMyStreet/App/Model/EmailSend.pm +++ b/perllib/FixMyStreet/App/Model/EmailSend.pm @@ -1,5 +1,5 @@ package FixMyStreet::App::Model::EmailSend; -use base 'Catalyst::Model::Adaptor'; +use base 'Catalyst::Model::Factory'; use strict; use warnings; @@ -54,7 +54,7 @@ elsif ( my $smtp_host = FixMyStreet->config('SMTP_SMARTHOST') ) { push @$mailer_args, username => $username, password => $password if $username && $password; $args = { - mailer => 'FixMyStreet::EmailSend', + mailer => 'FixMyStreet::EmailSend::DoNotReply', mailer_args => $mailer_args, }; } diff --git a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm index 5bed95811..b704fa7dd 100644 --- a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm +++ b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm @@ -5,7 +5,6 @@ use strict; use warnings; use mySociety::DBHandle qw(dbh); -use mySociety::EmailUtil; use mySociety::Gaze; use mySociety::Locale; use mySociety::MaPit; @@ -262,13 +261,12 @@ sub _send_aggregated_alert_email(%) { To => $data{alert_email}, }, $sender, - [ $data{alert_email} ], 0, $cobrand, $data{lang} ); - if ($result == mySociety::EmailUtil::EMAIL_SUCCESS) { + unless ($result) { $token->insert(); } else { print "Failed to send alert $data{alert_id}!"; diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm index d3c016be6..a84a309ee 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm @@ -8,7 +8,6 @@ use CronFns; use Utils; use mySociety::Config; -use mySociety::EmailUtil; use mySociety::MaPit; use FixMyStreet::App; @@ -438,7 +437,7 @@ sub send_reports { } } - if ($result == mySociety::EmailUtil::EMAIL_SUCCESS) { + unless ($result) { $row->update( { whensent => \'ms_current_timestamp()', lastupdate => \'ms_current_timestamp()', @@ -501,7 +500,7 @@ sub _send_report_sent_email { my $template = FixMyStreet->get_email_template($row->cobrand, $row->lang, 'confirm_report_sent.txt'); - my $result = FixMyStreet::App->send_email_cron( + FixMyStreet::App->send_email_cron( { _template_ => $template, _parameters_ => $h, @@ -509,7 +508,6 @@ sub _send_report_sent_email { From => mySociety::Config::get('CONTACT_EMAIL'), }, mySociety::Config::get('CONTACT_EMAIL'), - [ $row->user->email ], $nomail, $cobrand ); diff --git a/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm b/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm index b7af9e60e..646967bfc 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm @@ -5,7 +5,6 @@ use strict; use warnings; use Encode; use Utils; -use mySociety::EmailUtil; sub send_questionnaires { my ( $rs, $params ) = @_; @@ -103,11 +102,10 @@ sub send_questionnaires_period { From => [ $sender, $sender_name ], }, $sender, - [ $row->user->email ], $params->{nomail}, $cobrand ); - if ($result == mySociety::EmailUtil::EMAIL_SUCCESS) { + unless ($result) { print " ...success\n" if $params->{verbose}; $row->update(); $token->insert(); diff --git a/perllib/FixMyStreet/EmailSend.pm b/perllib/FixMyStreet/EmailSend.pm deleted file mode 100644 index 8b6eed462..000000000 --- a/perllib/FixMyStreet/EmailSend.pm +++ /dev/null @@ -1,9 +0,0 @@ -package FixMyStreet::EmailSend; -use base Email::Send::SMTP; - -sub get_env_sender { - my $sender = FixMyStreet->config('DO_NOT_REPLY_EMAIL'); - return $sender; -} - -1; diff --git a/perllib/FixMyStreet/EmailSend/ContactEmail.pm b/perllib/FixMyStreet/EmailSend/ContactEmail.pm new file mode 100644 index 000000000..28bcc983b --- /dev/null +++ b/perllib/FixMyStreet/EmailSend/ContactEmail.pm @@ -0,0 +1,9 @@ +package FixMyStreet::EmailSend::ContactEmail; +use base Email::Send::SMTP; + +sub get_env_sender { + my $sender = FixMyStreet->config('CONTACT_EMAIL'); + return $sender; +} + +1; diff --git a/perllib/FixMyStreet/EmailSend/DoNotReply.pm b/perllib/FixMyStreet/EmailSend/DoNotReply.pm new file mode 100644 index 000000000..d1368f00f --- /dev/null +++ b/perllib/FixMyStreet/EmailSend/DoNotReply.pm @@ -0,0 +1,9 @@ +package FixMyStreet::EmailSend::DoNotReply; +use base Email::Send::SMTP; + +sub get_env_sender { + my $sender = FixMyStreet->config('DO_NOT_REPLY_EMAIL'); + return $sender; +} + +1; diff --git a/perllib/FixMyStreet/SendReport.pm b/perllib/FixMyStreet/SendReport.pm index 5087c7ead..40e76ef72 100644 --- a/perllib/FixMyStreet/SendReport.pm +++ b/perllib/FixMyStreet/SendReport.pm @@ -10,6 +10,7 @@ use Module::Pluggable has 'body_config' => ( is => 'rw', isa => 'HashRef', default => sub { {} } ); has 'bodies' => ( is => 'rw', isa => 'ArrayRef', default => sub { [] } ); has 'to' => ( is => 'rw', isa => 'ArrayRef', default => sub { [] } ); +has 'bcc' => ( is => 'rw', isa => 'ArrayRef', default => sub { [] } ); has 'success' => ( is => 'rw', isa => 'Bool', default => 0 ); has 'error' => ( is => 'rw', isa => 'Str', default => '' ); has 'unconfirmed_counts' => ( 'is' => 'rw', isa => 'HashRef', default => sub { {} } ); @@ -44,6 +45,7 @@ sub reset { $self->bodies( [] ); $self->body_config( {} ); $self->to( [] ); + $self->bcc( [] ); } sub add_body { diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm index 19c6405d2..797b41e91 100644 --- a/perllib/FixMyStreet/SendReport/Email.pm +++ b/perllib/FixMyStreet/SendReport/Email.pm @@ -4,11 +4,8 @@ use Moose; BEGIN { extends 'FixMyStreet::SendReport'; } -use mySociety::EmailUtil; - sub build_recipient_list { my ( $self, $row, $h ) = @_; - my %recips; my $all_confirmed = 1; foreach my $body ( @{ $self->bodies } ) { @@ -49,12 +46,10 @@ sub build_recipient_list { } for my $email ( @emails ) { push @{ $self->to }, [ $email, $body_name ]; - $recips{$email} = 1; } } - return () unless $all_confirmed; - return keys %recips; + return $all_confirmed && @{$self->to}; } sub get_template { @@ -76,34 +71,36 @@ sub send { my $self = shift; my ( $row, $h ) = @_; - my @recips = $self->build_recipient_list( $row, $h ); + my $recips = $self->build_recipient_list( $row, $h ); # on a staging server send emails to ourselves rather than the bodies if (mySociety::Config::get('STAGING_SITE') && !mySociety::Config::get('SEND_REPORTS_ON_STAGING') && !FixMyStreet->test_mode) { - @recips = ( $row->user->email ); + $recips = 1; + @{$self->to} = [ $row->user->email, $self->to->[0][1] || $row->name ]; } - unless ( @recips ) { + unless ($recips) { $self->error( 'No recipients' ); return 1; } my ($verbose, $nomail) = CronFns::options(); my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker($row->cobrand)->new(); + my $params = { + _template_ => $self->get_template( $row ), + _parameters_ => $h, + To => $self->to, + From => $self->send_from( $row ), + }; + $params->{Bcc} = $self->bcc if @{$self->bcc}; my $result = FixMyStreet::App->send_email_cron( - { - _template_ => $self->get_template( $row ), - _parameters_ => $h, - To => $self->to, - From => $self->send_from( $row ), - }, + $params, mySociety::Config::get('CONTACT_EMAIL'), - \@recips, $nomail, $cobrand ); - if ( $result == mySociety::EmailUtil::EMAIL_SUCCESS ) { + unless ($result) { $self->success(1); } else { $self->error( 'Failed to send email' ); @@ -143,4 +140,5 @@ sub _get_district_for_contact { ($district) = keys %$district; return $district; } + 1; diff --git a/perllib/FixMyStreet/SendReport/EmptyHomes.pm b/perllib/FixMyStreet/SendReport/EmptyHomes.pm index 4bae6af46..ce69aaac3 100644 --- a/perllib/FixMyStreet/SendReport/EmptyHomes.pm +++ b/perllib/FixMyStreet/SendReport/EmptyHomes.pm @@ -9,7 +9,6 @@ BEGIN { extends 'FixMyStreet::SendReport::Email'; } sub build_recipient_list { my ( $self, $row, $h ) = @_; - my %recips; my $all_confirmed = 1; foreach my $body ( @{ $self->bodies } ) { @@ -31,24 +30,22 @@ sub build_recipient_list { } push @{ $self->to }, [ $body_email, $body->name ]; - $recips{$body_email} = 1; my $area_info = mySociety::MaPit::call('area', $body->body_areas->first->area_id); my $country = $area_info->{country}; if ($country eq 'W') { - $recips{ 'wales@' . mySociety::Config::get('EMAIL_DOMAIN') } = 1; + push @{$self->bcc}, 'wales@' . mySociety::Config::get('EMAIL_DOMAIN'); } elsif ($country eq 'S') { - $recips{ 'scotland@' . mySociety::Config::get('EMAIL_DOMAIN') } = 1; + push @{$self->bcc}, 'scotland@' . mySociety::Config::get('EMAIL_DOMAIN'); } else { - $recips{ 'eha@' . mySociety::Config::get('EMAIL_DOMAIN') } = 1; + push @{$self->bcc}, 'eha@' . mySociety::Config::get('EMAIL_DOMAIN'); } } # Set address email parameter from added data $h->{address} = $row->extra->{address}; - return () unless $all_confirmed; - return keys %recips; + return $all_confirmed && @{$self->to}; } sub get_template { diff --git a/perllib/FixMyStreet/SendReport/NI.pm b/perllib/FixMyStreet/SendReport/NI.pm index e0ea24f9c..c60643566 100644 --- a/perllib/FixMyStreet/SendReport/NI.pm +++ b/perllib/FixMyStreet/SendReport/NI.pm @@ -6,7 +6,6 @@ BEGIN { extends 'FixMyStreet::SendReport::Email'; } sub build_recipient_list { my ( $self, $row, $h ) = @_; - my %recips; my $all_confirmed = 1; foreach my $body ( @{ $self->bodies } ) { @@ -30,11 +29,9 @@ sub build_recipient_list { $row->external_body( 'Roads Service' ); } push @{ $self->to }, [ $email, $name ]; - $recips{$email} = 1; } - return () unless $all_confirmed; - return keys %recips; + return $all_confirmed && @{$self->to}; } 1; diff --git a/perllib/FixMyStreet/SendReport/Zurich.pm b/perllib/FixMyStreet/SendReport/Zurich.pm index d46561e9e..40417b41e 100644 --- a/perllib/FixMyStreet/SendReport/Zurich.pm +++ b/perllib/FixMyStreet/SendReport/Zurich.pm @@ -26,7 +26,7 @@ sub build_recipient_list { } push @{ $self->to }, [ $body_email, $body->name ]; - return $body_email; + return 1; } sub get_template { diff --git a/t/app/model/problem.t b/t/app/model/problem.t index 6ad933db8..c40e9e022 100644 --- a/t/app/model/problem.t +++ b/t/app/model/problem.t @@ -5,9 +5,9 @@ use warnings; use Test::More; +use FixMyStreet::TestMech; use FixMyStreet; use FixMyStreet::App; -use FixMyStreet::TestMech; use mySociety::Locale; use Sub::Override; diff --git a/t/app/sendreport/email.t b/t/app/sendreport/email.t index 8063c928f..b2cab42ed 100644 --- a/t/app/sendreport/email.t +++ b/t/app/sendreport/email.t @@ -50,14 +50,14 @@ foreach my $test ( { }, { desc => 'unconfirmed contact results in no receipients', - count => undef, + count => 0, add_council => 1, unconfirmed => 1, expected_note => 'Body 1000 deleted', }, { desc => 'unconfirmed contact note uses note from contact table', - count => undef, + count => 0, add_council => 1, unconfirmed => 1, note => 'received bounced so unconfirmed', -- cgit v1.2.3 From e0f5f22f770c146986fe5bbdd083fbb48eb9706d Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Tue, 13 Jan 2015 17:15:23 +0000 Subject: Add some bottom padding to .content. And remove it in footer if present (so that a different background doesn't potentially show through). --- web/cobrands/sass/_layout.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/cobrands/sass/_layout.scss b/web/cobrands/sass/_layout.scss index 632385cac..607734c41 100644 --- a/web/cobrands/sass/_layout.scss +++ b/web/cobrands/sass/_layout.scss @@ -388,10 +388,11 @@ body.fullwidthpage { .container { .content { box-shadow: none; - padding: 1em 1em 0em; + padding: 1em; margin-bottom: 0em; footer { margin-top: 0em; + margin-bottom: -1em; .tablewrapper { padding-top: 2em; padding-bottom: 3em; -- cgit v1.2.3 From 6bbca382a56d4a31f60da5de7ba689c15c1222ef Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Wed, 14 Jan 2015 16:30:33 +0000 Subject: Update other uses of text changed in a0a33741. --- templates/web/barnet/report/new/councils_text_all.html | 2 +- templates/web/base/report/new/councils_extra_text.html | 2 +- templates/web/base/report/new/councils_text_some.html | 5 ++--- templates/web/base/report/new/fill_in_details_form.html | 2 +- templates/web/oxfordshire/report/new/councils_text_all.html | 4 ++-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/templates/web/barnet/report/new/councils_text_all.html b/templates/web/barnet/report/new/councils_text_all.html index 20152928b..ae02f7647 100644 --- a/templates/web/barnet/report/new/councils_text_all.html +++ b/templates/web/barnet/report/new/councils_text_all.html @@ -1,4 +1,4 @@

All the information you provide here will be sent to the relevant department. -[% loc('The subject and details of the problem will be public, plus your name if you give us permission.') %] +[% loc('The summary and description will also be made public (see our privacy policy).') %]

diff --git a/templates/web/base/report/new/councils_extra_text.html b/templates/web/base/report/new/councils_extra_text.html index 1088b9f8b..b77758b01 100644 --- a/templates/web/base/report/new/councils_extra_text.html +++ b/templates/web/base/report/new/councils_extra_text.html @@ -1 +1 @@ -[% loc('The subject and details of the problem will be public, plus your name if you give us permission.') %] +[% loc('The summary and description will also be made public (see our privacy policy).') %] diff --git a/templates/web/base/report/new/councils_text_some.html b/templates/web/base/report/new/councils_text_some.html index 8d4768612..70cb97617 100644 --- a/templates/web/base/report/new/councils_text_some.html +++ b/templates/web/base/report/new/councils_text_some.html @@ -7,9 +7,8 @@ [%- '.' IF loop.last %] [% END %] -[% - loc('The subject and details of the problem will be public, plus your name if you give us permission.'); -%] +[% loc('The summary and description will also be made public (see our privacy policy).') %] + [% nget( "We do not yet have details for the other council that covers this location.", diff --git a/templates/web/base/report/new/fill_in_details_form.html b/templates/web/base/report/new/fill_in_details_form.html index ec05e127e..cee0244c7 100644 --- a/templates/web/base/report/new/fill_in_details_form.html +++ b/templates/web/base/report/new/fill_in_details_form.html @@ -15,7 +15,7 @@ loc('the local council') ); %] - [% loc('The subject and details of the problem will be public, plus your name if you give us permission.') %] + [% loc('The summary and description will also be made public (see our privacy policy).') %]

[% ELSE %] [% PROCESS 'report/new/councils_text.html' %] diff --git a/templates/web/oxfordshire/report/new/councils_text_all.html b/templates/web/oxfordshire/report/new/councils_text_all.html index f205418d7..a8c81f39e 100644 --- a/templates/web/oxfordshire/report/new/councils_text_all.html +++ b/templates/web/oxfordshire/report/new/councils_text_all.html @@ -1,5 +1,5 @@

All the information you provide here will be sent to the - relevant department. The subject and details of the - problem will be public, plus your name if you give us permission. + relevant department. The summary and description + will also be made public, plus your name if you give us permission.

-- cgit v1.2.3 From 78bf9e3589f14436befb73e903ec574d273bf66f Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Wed, 14 Jan 2015 16:32:38 +0000 Subject: Fix title of Privacy page, and missing copy. --- .../fixmystreet-uk-councils/static/privacy.html | 131 +++++++++++++++++++++ templates/web/fixmystreet.com/static/privacy.html | 2 +- 2 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 templates/web/fixmystreet-uk-councils/static/privacy.html diff --git a/templates/web/fixmystreet-uk-councils/static/privacy.html b/templates/web/fixmystreet-uk-councils/static/privacy.html new file mode 100644 index 000000000..addce1e2d --- /dev/null +++ b/templates/web/fixmystreet-uk-councils/static/privacy.html @@ -0,0 +1,131 @@ +[% INCLUDE 'header.html', + title = loc('Privacy and cookies'), + bodyclass = 'twothirdswidthpage' %] + + + +

Privacy, cookies, and third party services

+ +

Our use of your data, cookies, and external services: what you +should know, and how to opt out if you want to.

+ +

Summary: We care a lot about our users’ privacy. We provide details below, +and we try our hardest to look after the private data that we hold. Like many +other websites, we sometimes use cookies and Google Analytics to help us make +our websites better. These tools are very common and used by many other sites, +but they do have privacy implications, and as a charity concerned with socially +positive uses of the internet, we think it’s important to explain them in full. +If you don’t want to share your browsing activities on mySociety’s sites with +other companies, you can adjust your usage or install opt-out browser plugins. + +

Privacy

+ +
+
Who gets to see my email address?
+
If you submit a problem, we pass on your details, and details of +the problem, to the council contact or contacts responsible for the area where +you located the problem, or other relevant body (for example, in most of London +we send reports via the central London Report-It service, who may also publish +the public details of your report). Other than the council, who obviously get +your email address, only people we authorise to view the FixMyStreet +administration interface will be able to see your email address and they will +never use it for anything other than to help administer FixMyStreet. Similarly +with email addresses from updates. We will never give or sell your email +address to anyone else, unless we are obliged to by law. Your name, given in +the name field, will not be published anywhere unless you let us (if you give +your name elsewhere, e.g. in the public details section, it will be publicly +available).
+
Will you send nasty, brutish spam to my email address?
+
Never. We will email you if someone leaves an update on a +problem you’ve reported, and send you a questionnaire email four weeks +after you submit a problem, asking for a status update; we’ll only ever +send you emails in relation to your problem.
+
+ +

Cookies

+ +

To make our service easier or more useful, we sometimes place small data +files on your computer or mobile phone, known as cookies; many websites do +this. We use this information to, for example, remember you have logged in so +you don't need to do that on every page, or to measure how people use the +website so we can improve it and make sure it works properly. Below, we list +the cookies and services that this site can use. + + + + + + + + + + + + + + +
NameTypical ContentExpires
fixmystreet_app_sessionA random unique identifierWhen browser is closed, or four weeks if “Keep me signed in” is ticked
+ +

Measuring website usage (Google Analytics)

+ +

We use Google Analytics to collect information about how people use this +site. We do this to make sure it’s meeting its users’ needs and to understand +how we could do it better. Google Analytics stores information such as what +pages you visit, how long you are on the site, how you got here, what you click +on, and information about your web browser. IP addresses are masked (only a +portion is stored) and personal information is only reported in aggregate. We +do not allow Google to use or share our analytics data for any purpose besides +providing us with analytics information, and we recommend that any user of +Google Analytics does the same. + +

If you’re unhappy with data about your visit to be used in this way, you can +install the official browser +plugin for blocking Google Analytics. + +

The cookies set by Google Analytics are as follows: + + + + + + + +
NameTypical ContentExpires
__utmaUnique anonymous visitor ID2 years
__utmbUnique anonymous session ID30 minutes
__utmzInformation on how the site was reached (e.g. direct or via a link/search/advertisement)6 months
__utmxWhich variation of a page you are seeing if we are testing different versions to see which is best2 years
+ +

Google’s Official Statement about Analytics Data

+ +

“This website uses Google Analytics, a web analytics service provided by +Google, Inc. (“Google”). Google Analytics uses “cookies”, which are text files +placed on your computer, to help the website analyze how users use the site. +The information generated by the cookie about your use of the website +(including your IP address) will be transmitted to and stored by Google on +servers in the United States . Google will use this information for the purpose +of evaluating your use of the website, compiling reports on website activity +for website operators and providing other services relating to website activity +and internet usage. Google may also transfer this information to third parties +where required to do so by law, or where such third parties process the +information on Google’s behalf. Google will not associate your IP address with +any other data held by Google. You may refuse the use of cookies by selecting +the appropriate settings on your browser, however please note that if you do +this you may not be able to use the full functionality of this website. By +using this website, you consent to the processing of data about you by Google +in the manner and for the purposes set out above.”

+ +

More general information +on how third party services work

+ +

Credits

+ +

Bits of wording taken from the gov.uk cookies page (under the Open +Government Licence). + +[% INCLUDE 'footer.html' pagefooter = 'yes' %] diff --git a/templates/web/fixmystreet.com/static/privacy.html b/templates/web/fixmystreet.com/static/privacy.html index e7c78384f..addce1e2d 100755 --- a/templates/web/fixmystreet.com/static/privacy.html +++ b/templates/web/fixmystreet.com/static/privacy.html @@ -1,5 +1,5 @@ [% INCLUDE 'header.html', - title = loc('Frequently Asked Questions'), + title = loc('Privacy and cookies'), bodyclass = 'twothirdswidthpage' %]