diff options
51 files changed, 1033 insertions, 192 deletions
diff --git a/bin/generate_council_location b/bin/generate_council_location index c7aea8074..c7aea8074 100644..100755 --- a/bin/generate_council_location +++ b/bin/generate_council_location 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('<fms-cron-%s-%s@%s>', 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/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; diff --git a/perllib/FixMyStreet/Cobrand/Harrogate.pm b/perllib/FixMyStreet/Cobrand/Harrogate.pm new file mode 100644 index 000000000..6bcc2f227 --- /dev/null +++ b/perllib/FixMyStreet/Cobrand/Harrogate.pm @@ -0,0 +1,242 @@ +package FixMyStreet::Cobrand::Harrogate; +use base 'FixMyStreet::Cobrand::UKCouncils'; + +use strict; +use warnings; +use feature 'say'; + +sub council_id { return 2407; } +sub council_area { return 'Harrogate'; } +sub council_name { return 'Harrogate Borough Council'; } +sub council_url { return 'harrogate'; } +sub is_two_tier { return 1; } # with North Yorkshire CC 2235 + +sub disambiguate_location { + my $self = shift; + my $string = shift; + + my $town = 'Harrogate'; + + # as it's the requested example location, try to avoid a disambiguation page + $town .= ', HG1 1DH' if $string =~ /^\s*king'?s\s+r(?:oa)?d\s*(?:,\s*har\w+\s*)?$/i; + + return { + %{ $self->SUPER::disambiguate_location() }, + town => $town, + centre => '54.0671557690306,-1.59581319536637', + span => '0.370193897090822,0.829517054931808', + bounds => [ 53.8914112467619, -2.00450542308575, 54.2616051438527, -1.17498836815394 ], + }; +} + +sub example_places { + return ( 'HG1 2SG', "King's Road" ); +} + +sub enter_postcode_text { + my ($self) = @_; + return 'Enter a Harrogate district postcode, or street name and area'; +} + +# increase map zoom level so street names are visible +sub default_map_zoom { return 3; } + + +=head2 temp_email_to_update, temp_update_contacts + +Temporary helper routines to update the extra for potholes (temporary setup +hack, cargo-culted from ESCC, may in future be superseded either by +Open311/integration or a better mechanism for manually creating rich contacts). + +Can run with a script or command line like: + + bin/cron-wrapper perl -MFixMyStreet::App -MFixMyStreet::Cobrand::Harrogate -e \ + 'FixMyStreet::Cobrand::Harrogate->new({c => FixMyStreet::App->new})->temp_update_contacts' + +=cut + +sub temp_email_to_update { + return 'CustomerServices@harrogate.gov.uk'; +} + +sub temp_update_contacts { + my $self = shift; + + my $contact_rs = $self->{c}->model('DB::Contact'); + + my $email = $self->temp_email_to_update; + my $_update = sub { + my ($category, $field, $category_details) = @_; + # NB: we're accepting just 1 field, but supply as array [ $field ] + + my $contact = $contact_rs->find_or_create( + { + body_id => $self->council_id, + category => $category, + + confirmed => 1, + deleted => 0, + email => $email, + editor => 'automated script', + note => '', + send_method => '', + whenedited => \'NOW()', + %{ $category_details || {} }, + }, + { + key => 'contacts_body_id_category_idx' + } + ); + + say "Editing category: $category"; + + my %default = ( + variable => 'true', + order => '1', + required => 'no', + datatype => 'string', + datatype_description => 'a string', + ); + + if ($field->{datatype} || '' eq 'boolean') { + my $description = $field->{description}; + %default = ( + %default, + datatype => 'singlevaluelist', + datatype_description => 'Yes or No', + values => { value => [ + { key => ['No'], name => ['No'] }, + { key => ['Yes'], name => ['Yes'] }, + ] }, + ); + } + + $contact->update({ + extra => [ { %default, %$field } ], + confirmed => 1, + deleted => 0, + editor => 'automated script', + whenedited => \'NOW()', + note => 'Edited by script as per requirements Dec 2014', + }); + }; + + $_update->( 'Abandoned vehicles', { + code => 'registration', + description => 'Vehicle Registration number:', + }); + + $_update->( 'Dead animals', { + code => 'INFO_TEXT', + variable => 'false', + description => 'We do not remove small species, e.g. squirrels, rabbits, and small birds.', + }); + + $_update->( 'Flyposting', { + code => 'offensive', + description => 'Is it offensive?', + datatype => 'boolean', # mapped onto singlevaluelist + }); + + $_update->( 'Flytipping', { + code => 'size', + description => 'Size?', + datatype => 'singlevaluelist', + values => { value => [ + { key => ['Single Item'], name => ['Single item'] }, + { key => ['Car boot load'], name => ['Car boot load'] }, + { key => ['Small van load'], name => ['Small van load'] }, + { key => ['Transit van load'], name => ['Transit van load'] }, + { key => ['Tipper lorry load'], name => ['Tipper lorry load'] }, + { key => ['Significant load'], name => ['Significant load'] }, + ] }, + }); + + $_update->( 'Graffiti', { + code => 'offensive', + description => 'Is it offensive?', + datatype => 'boolean', # mapped onto singlevaluelist + }); + + $_update->( 'Parks and playgrounds', { + code => 'dangerous', + description => 'Is it dangerous or could cause injury?', + datatype => 'boolean', # mapped onto singlevaluelist + }); + + $_update->( 'Trees', { + code => 'dangerous', + description => 'Is it dangerous or could cause injury?', + datatype => 'boolean', # mapped onto singlevaluelist + }); + + # also ensure that the following categories are created: + for my $category ( + 'Car parking', + 'Dog and litter bins', + 'Dog fouling', + 'Other', + 'Rubbish (refuse and recycling)', + 'Street cleaning', + 'Street lighting', + 'Street nameplates', + ) { + say "Creating $category if required"; + my $contact = $contact_rs->find_or_create( + { + body_id => $self->council_id, + category => $category, + confirmed => 1, + deleted => 0, + email => $email, + editor => 'automated script', + note => 'Created by script as per requirements Dec 2014', + send_method => '', + whenedited => \'NOW()', + } + ); + } + + my @to_delete = ( + 'Parks/landscapes', # delete in favour of to parks and playgrounds + 'Public toilets', # as no longer in specs + ); + say sprintf "Deleting: %s (if present)", join ',' => @to_delete; + $contact_rs->search({ + body_id => $self->council_id, + category => \@to_delete, + deleted => 0 + })->update({ + deleted => 1, + editor => 'automated script', + whenedited => \'NOW()', + note => 'Deleted by script as per requirements Dec 2014', + }); +} + +sub contact_email { + my $self = shift; + return join( '@', 'customerservices', 'harrogate.gov.uk' ); +} + +sub process_additional_metadata_for_email { + my ($self, $problem, $h) = @_; + + my $additional = ''; + if (my $extra = $problem->extra) { + $additional = join "\n\n", map { + if ($_->{name} eq 'INFO_TEXT') { + (); + } + else { + sprintf '%s: %s', $_->{description}, $_->{value}; + } + } @$extra; + $additional = "\n\n$additional" if $additional; + } + + $h->{additional_information} = $additional; +} + +1; + 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 5d70bf47d..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; @@ -323,6 +322,10 @@ sub send_reports { $h{user_details} .= sprintf(_('Email: %s'), $row->user->email) . "\n\n"; } + if ($cobrand->can('process_additional_metadata_for_email')) { + $cobrand->process_additional_metadata_for_email($row, \%h); + } + my %reporters = (); my ( $sender_count ); if ($site eq 'emptyhomes') { @@ -434,7 +437,7 @@ sub send_reports { } } - if ($result == mySociety::EmailUtil::EMAIL_SUCCESS) { + unless ($result) { $row->update( { whensent => \'ms_current_timestamp()', lastupdate => \'ms_current_timestamp()', @@ -497,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, @@ -505,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/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.pm b/perllib/FixMyStreet/EmailSend/DoNotReply.pm index 8b6eed462..d1368f00f 100644 --- a/perllib/FixMyStreet/EmailSend.pm +++ b/perllib/FixMyStreet/EmailSend/DoNotReply.pm @@ -1,4 +1,4 @@ -package FixMyStreet::EmailSend; +package FixMyStreet::EmailSend::DoNotReply; use base Email::Send::SMTP; sub get_env_sender { 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/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', diff --git a/templates/email/harrogate/submit.txt b/templates/email/harrogate/submit.txt new file mode 100644 index 000000000..87df45c0c --- /dev/null +++ b/templates/email/harrogate/submit.txt @@ -0,0 +1,43 @@ +Subject: Problem Report: <?=$values['title']?> + +Dear <?=$values['bodies_name']?>, + +<?=$values['missing']?><?=$values['multiple']?>A user of +FixMyStreet has submitted the following report +of a local problem that they believe might require your attention. + +<?=$values['fuzzy']?>, or to provide an update on the problem, +please visit the following link: + + <?=$values['url']?> + +<?=$values['has_photo']?>---------- + +Name: <?=$values['name']?> + +Email: <?=$values['email']?> + +<?=$values['phone_line']?><?=$values['category_line']?>Subject: <?=$values['title']?> + +<?=$values['detail']?> <?=$values['additional_information']?> + +<?=$values['easting_northing']?>Latitude: <?=$values['latitude']?> + +Longitude: <?=$values['longitude']?> + +<?=$values['closest_address']?>---------- + +Replies to this email will go to the user who submitted the problem. + +<?=$values['signature']?> + +This message was sent via FixMyStreet, a project of UKCOD, registered charity +number 1076346. If there is a more appropriate email address for messages about +<?=$values['category_footer']?>, please let us know by visiting <https://www.fixmystreet.com/contact>. +This will help improve the service for local people. We +also welcome any other feedback you may have. + +FixMyStreet is now available for full integration into council +websites, making life easier for both you and your residents. +Read more here: https://www.mysociety.org/services/fixmystreet-for-councils/ + diff --git a/templates/web/base/auth/change_password.html b/templates/web/base/auth/change_password.html index 5f2861aa3..b4170c23e 100644 --- a/templates/web/base/auth/change_password.html +++ b/templates/web/base/auth/change_password.html @@ -1,4 +1,4 @@ -[% INCLUDE 'header.html', title = loc('Change password') %] +[% INCLUDE 'header.html', title = loc('Change password'), bodyclass = 'authpage' %] <h1>[% loc('Change password') %]</h1> diff --git a/templates/web/base/report/new/category_extras.html b/templates/web/base/report/new/category_extras.html index 928b61041..6b15cbef9 100644 --- a/templates/web/base/report/new/category_extras.html +++ b/templates/web/base/report/new/category_extras.html @@ -11,14 +11,16 @@ <div class="form-field"> <label for="form_[% meta_name %]">[% meta.description _ ':' %]</label> - [% IF meta.exists('values') %] - <select name="[% meta_name %]" id="form_[% meta_name %]"[% meta.required == 'true' ? ' required' : '' %]> - [% FOR option IN meta.values.value.value %] - <option value="[% option.key.0 %]"[% IF option.key.0 == report_meta.$meta_name.value %] selected[% END %]>[% option.name.0 %]</option> + [% IF meta.variable != 'false' %] + [% IF meta.exists('values') + <select name="[% meta_name %]" id="form_[% meta_name %]"[% meta.required == 'true' ? ' required' : '' %]> + [% FOR option IN meta.values.value.value %] + <option value="[% option.key.0 %]"[% IF option.key.0 == report_meta.$meta_name.value %] selected[% END %]>[% option.name.0 %]</option> + [% END %] + </select> + [% ELSE %] + <input type="text" value="[% report_meta.$meta_name | html %]" name="[% meta_name %]" id="form_[% meta_name %]"[% meta.required == 'true' ? ' required' : '' %]> [% END %] - </select> - [% ELSE %] - <input type="text" value="[% report_meta.$meta_name | html %]" name="[% meta_name %]" id="form_[% meta_name %]"[% meta.required == 'true' ? ' required' : '' %]> [% END %] </div> [%- END %] 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 %] - -<h1 class="big-green-banner variant0"> - [% loc( 'Click map to report a problem' ) %] - [% IF c.cobrand.moniker == 'bromley' %] - <span>Yellow pins show existing reports</span> - [% END %] -</h1> -<a id="skip-this-step" class="variant0" href="[% url_skip %]" rel="nofollow"> - [% loc("Can't see the map? <em>Skip this step</em>") %] -</a> 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 @@ -<menu id="problems-nav" class="tab-nav"> - <ul class="variant0"> - <li><a href="#current_tab">[% loc('Problems on the map') %]</a></li> - <li><a href="#current_near_tab">[% loc( 'Problems nearby' ) %]</a></li> - </ul> - <ul class="variant1"> - <li><a href="#reporting">[% loc('Report a problem') %]</a></li> - <li><a href="#current_near_tab">[% loc( 'Problems near here' ) %]</a></li> - </ul> -</menu> - -<div class="variant1"> -<div id="reporting" class="tab"> - <h1>[% loc( 'Click the map to<br/>report a problem' ) %]</h1> - - <a id="skip-this-step" href="[% url_skip %]" rel="nofollow"> - [% loc("Can't see the map? <em>Skip this step</em>") %] - </a> - - <p>Don’t worry if it’s not in precisely the right place,<br/> - you can move the pin afterwards.</p> -</div> -</div> - -<div class="variant0"> -<div id="current_tab" class="tab"> - <ul id="current" class="issue-list-a"> - [% INCLUDE "around/on_map_list_items.html" %] - </ul> -</div> -</div> - -<div id="current_near_tab" class="tab"> - <ul id="current_near" class="issue-list-a"> - [% INCLUDE "around/around_map_list_items.html" %] - </ul> -</div> - -<script> -if (typeof variation !== 'undefined' && variation == 1) { - fixmystreet.initial_hide_pins = true; - $(function(){ - $('#current').insertBefore('#current_near'); - }); -} -</script> 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 @@ <script src="[% start %][% version('/js/jquery.cookie.min.js') %]" type="text/javascript" charset="utf-8"></script> -[%# We are conducting an A/B experiment on the first step of reporting process %] -[% IF page == 'around' %] -<script src="//www.google-analytics.com/cx/api.js?experiment=1gdSSsSMQgy99AsCPeBalg"></script> -<script> -if (window.matchMedia) { - var desktop = window.matchMedia("(min-width: 48em)").matches; - if (desktop) { - var variation = cxApi.chooseVariation(), - docElement = document.documentElement, - className = docElement.className; - docElement.className = className + ' ' + 'variant' + variation; - } -} -</script> -<style> -html .variant1 { display: none !important; } -html.variant1 .variant0 { display: none !important; } -html.variant1 .variant1 { display: block !important; } -</style> -[% END %] - [% INCLUDE 'tracking_code.html' %] diff --git a/templates/web/fixmystreet/auth/general.html b/templates/web/fixmystreet/auth/general.html index 3f3fe5b99..45239073d 100644 --- a/templates/web/fixmystreet/auth/general.html +++ b/templates/web/fixmystreet/auth/general.html @@ -1,4 +1,5 @@ -[% INCLUDE 'header.html', title = loc('Sign in or create an account') %] +[% INCLUDE 'header.html', bodyclass='authpage', title = loc('Sign in or create an account') %] +[%# should bodyclass='twothirdspage' instead? Need override for Harrogate %] <h1>[% loc('Sign in') %]</h1> diff --git a/templates/web/fixmystreet/report/new/category_extras.html b/templates/web/fixmystreet/report/new/category_extras.html index ae1214c35..48a38435d 100644 --- a/templates/web/fixmystreet/report/new/category_extras.html +++ b/templates/web/fixmystreet/report/new/category_extras.html @@ -9,14 +9,16 @@ [% IF field_errors.$meta_name %] <p class='form-error'>[% field_errors.$meta_name %]</p> [% END -%] - [% IF meta.exists('values') %] - <select name="[% meta_name %]" id="form_[% meta_name %]"[% meta.required == 'true' ? ' required' : '' %]> - [% FOR option IN meta.values.value %] - <option value="[% option.key.0 %]"[% IF option.key.0 == report_meta.$meta_name.value %] selected[% END %]>[% option.name.0 %]</option> - [% END %] - </select> - [% ELSE %] - <input type="text" value="[% report_meta.$meta_name.value | html %]" name="[% meta_name %]" id="form_[% meta_name %]"[% meta.required == 'true' ? ' required' : '' %]> + [% IF meta.variable != 'false' %] + [% IF meta.exists('values') %] + <select name="[% meta_name %]" id="form_[% meta_name %]"[% meta.required == 'true' ? ' required' : '' %]> + [% FOR option IN meta.values.value %] + <option value="[% option.key.0 %]"[% IF option.key.0 == report_meta.$meta_name.value %] selected[% END %]>[% option.name.0 %]</option> + [% END %] + </select> + [% ELSE %] + <input type="text" value="[% report_meta.$meta_name.value | html %]" name="[% meta_name %]" id="form_[% meta_name %]"[% meta.required == 'true' ? ' required' : '' %]> + [% END %] [% END %] [%- END %] diff --git a/templates/web/harrogate/around/intro.html b/templates/web/harrogate/around/intro.html new file mode 100644 index 000000000..53476965d --- /dev/null +++ b/templates/web/harrogate/around/intro.html @@ -0,0 +1,4 @@ + <div id="postcode-intro"> + <h1> Report something in Harrogate district that needs to be fixed, cleaned, or cleared. </h1> + <h2> (like graffiti, fly tipping, broken playground equipment, or street lighting) </h2> + </div> diff --git a/templates/web/harrogate/faq/faq-en-gb.html b/templates/web/harrogate/faq/faq-en-gb.html new file mode 100755 index 000000000..e5c9e5480 --- /dev/null +++ b/templates/web/harrogate/faq/faq-en-gb.html @@ -0,0 +1,134 @@ +[% INCLUDE 'header.html', title = 'Help', bodyclass = 'twothirdswidthpage' %] + +<div class="sticky-sidebar"> + <aside> + <ul class="plain-list"> + <li><a href="#faq">Frequently Asked Questions</a></li> + <li><a href="/privacy">Privacy and cookies</a></li> + <li><a href="/contact">Contact FixMyStreet</a></li> + </ul> + </aside> +</div> + +<h1> Frequently Asked Questions </h1> + +<p>These pages are for reporting things which are broken, dirty, damaged or +dumped, and need fixing, cleaning or clearing: </p> +<ul> + <li>graffiti + <li>flytipping + <li>broken playground equipment + <li>street lighting + <li>potholes + </ul> + <p> + Note that though most of these services are provided by Harrogate Borough Council, + FixMyStreet will forward some categories of issue to North Yorkshire County Council. + </p> + +<dl> + <dt><a name="emergencies"></a>Reporting emergencies (Out of Hours)</dt> + <dd> + <p> Please do not report problems which present an immediate risk to life, + for example missing manhole covers or a fallen lamp column. </p> + <p> Issues reported via the website are only actioned during office hours. + If you require an Out of Hours service please ring our main number + 01423 500600 and a message will direct you to the relevant Council Out of Hours + service. </p> + + </dd> + + <dt>How do I report a problem here?</dt> + <dd>After entering a postcode or location, you are shown +a map of that area. You can view problems already reported in that area, +or report ones of your own by clicking on the map at the location of +the problem.</dd> + <dt>How are the problems solved?</dt> + <dd>They are reported directly to us so we can then resolve the problem. + You can also discuss the problem on the website with others if you wish.</dd> + + <dt>Do you remove silly or illegal content?</dt> + <dd>Harrogate Borough Council and FixMyStreet are not responsible for the content and accuracy +of material submitted by its users. We reserve the right to edit or remove any +problems or updates which we consider to be inappropriate upon being informed +by a user of the site.</dd> + + <dt>Can I use FixMyStreet on my mobile?</dt> + <dd> + <p>The FixMyStreet website will already work on your mobile phone, adapting to + the size of your screen automatically. Using an app has some advantages, though + — for example, you can create a report even when you have no network + connection. + <ul> + <li> + <a href="https://itunes.apple.com/gb/app/fixmystreet/id297456545">FixMyStreet app for iPhone</a> + <li> + <a href="https://play.google.com/store/apps/details?id=org.mysociety.FixMyStreet">FixMyStreet app for Android</a> + <li><em>Nokia:</em> A volunteer, Thomas Forth, has written an app available from the + <a href="http://store.ovi.com/content/107557">Ovi Store</a>. + </ul> + </dd> + + <dt>Can I use these pages to report problems outside of the Harrogate district?</dd> + <dd>Yes, if you enter a postcode or address outside the borough you will be re-directed to the main FixMyStreet site that will enable you to report problems elsewhere. FixMyStreet will forward these on to the relevant council.</dd> + + <dt>The site is powered by FixMyStreet, who are they?</dt> + <dd>FixMyStreet was built by <a href="http://www.mysociety.org/">mySociety</a>, in conjunction with the <a href="http://www.youngfoundation.org.uk/">Young Foundation</a>. +mySociety is the project of a registered charity which has grown out of the community of +volunteers who built sites like <a href="http://www.theyworkforyou.com/">TheyWorkForYou</a>. +mySociety’s primary mission is to build Internet projects which give people simple, tangible +benefits in the civic and community aspects of their lives. +The charity is called UK Citizens Online Democracy and is charity number 1076346. mySociety +can be contacted by email at <a href="mailto:hello@mysociety.org">hello@mysociety.org</a>, +or by post at mySociety, 483 Green Lanes, London, N13 4BS.</dd> + + <dt>Why does the site use kilometres for measurements?</dt> + <dd>The British national + grid reference system, devised by Ordnance Survey (the British national + mapping agency) around the time of the second world war, uses eastings and + northings measured in metres and kilometres; the maps we use are from + Ordnance Survey and so this is what we use to display distances. + There you have it: not everything British is in miles!</dd> + + <dt>Why can’t I zoom out more on the reporting map?</dt> + <dd>We want to keep reports locally focused, so we restrict the ability to + move radically between areas. The map on <a href="/my">Your Reports</a> will let you see all + the reports you’ve made, wherever they are.</dd> + + <dt>I’d like a site like this for my own location/ where’s the "source code" to this site?</dt> + <dd> +The mySociety software behind this site is open source, and available +under the GNU Affero GPL software license. You can <a +href="http://github.com/mysociety/fixmystreet">download the +source code</a> and help mySociety develop it. +You’re welcome to use it in your own projects, although you must also +make available the source code to any such projects. +<a href="http://www.fiksgatami.no/">Fiksgatami</a> is an example of our code +being used in a Norwegian version of this site. +</dd> + +</dl> + + <h2><a name="privacy"></a>Privacy Questions</h2> + + <dl> + <dt>Who gets to see my email address?</dt> + <dd> +<p>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.</p> +<p>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.</p> +</dd> + + <dt>What emails will you send to me?</dt> + <dd>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.</dd> + + </dl> + +[% INCLUDE 'footer.html' pagefooter = 'yes' %] diff --git a/templates/web/harrogate/footer.html b/templates/web/harrogate/footer.html new file mode 100644 index 000000000..116b318a3 --- /dev/null +++ b/templates/web/harrogate/footer.html @@ -0,0 +1,55 @@ + [% IF pagefooter %] + <footer role="content-info"> + [% INCLUDE 'front/footer-marketing.html' %] + </footer> + [% END %] + </div><!-- .content role=main --> + </div><!-- .container --> + [% IF c.cobrand.moniker == 'fixmystreet' AND bodyclass != 'mappage' %] + [% INCLUDE 'footer-nav.html' %] + [% END %] + </div><!-- .table-cell --> + + <div class="nav-wrapper"> + <div class="nav-wrapper-2"> + <div id="main-nav" role="navigation"> + + <ul id="main-menu"> + [% selected = c.req.uri.path == '/' %] + <li [% selected ? 'class="menu-item-selected"' : '' %]> + <[% IF selected %]span[% ELSE %]a href="/"[% END %] class="report-a-problem-btn"> + [% loc("Report a problem") %]</[% selected == '/' ? 'span' : 'a' %]></li> + + [% selected = c.req.uri.path == '/my' %] + <li [% selected ? 'class="menu-item-selected"' : '' %]> + <[% IF selected %]span[% ELSE %]a href="/my"[% END %]> + [% loc("Your reports") %]</[% selected ? 'span' : 'a' %]></li> + + [% selected = c.req.uri.path == '/reports/Harrogate' %] + <li [% selected ? 'class="menu-item-selected"' : '' %]> + <[% IF selected %]span[% ELSE %]a href="/reports"[% END %]> + [% loc("All reports") %]</[% selected ? 'span' : 'a' %]></li> + + [% selected = c.req.uri.path == '/alert' %] + <li [% selected ? 'class="menu-item-selected"' : '' %]> + <[% IF selected %]span[% ELSE %]a href="/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]"[% END %]> + [% loc("Local alerts") %]</[% selected ? 'span' : 'a' %]></li> + + [% selected = c.req.uri.path == '/faq' %] + <li [% selected ? 'class="menu-item-selected"' : '' %]> + <[% IF selected %]span[% ELSE %]a href="/faq"[% END %]> + [% loc("Help") %]</[% selected ? 'span' : 'a' %]></li> + + [% selected = c.req.uri.path == '/privacy' %] + <li id="top-nav-privacy" [% selected ? 'class="menu-item-selected"' : '' %]> + <[% IF selected %]span[% ELSE %]a href="/privacy"[% END %]> + [% loc("Privacy") %]</[% selected ? 'span' : 'a' %]></li> + </ul> + </div> + </div> + </div> + +<!-- [% INCLUDE 'debug_footer.html' %] --> + </div> <!-- .wrapper --> +</body> +</html> diff --git a/templates/web/harrogate/front/footer-marketing.html b/templates/web/harrogate/front/footer-marketing.html new file mode 100644 index 000000000..495a17fc5 --- /dev/null +++ b/templates/web/harrogate/front/footer-marketing.html @@ -0,0 +1,19 @@ + <div class="tablewrapper bordered"> + <div id="footer-mobileapps"> + <h4>The FixMyStreet App</h4> + <p> + <a href="https://itunes.apple.com/gb/app/fixmystreet/id297456545"> + <img alt="FixMyStreet app on the App Store" src="/cobrands/fixmystreet/images/itunes_store_logo.png" /> + </a> + <a href="https://play.google.com/store/apps/details?id=org.mysociety.FixMyStreet"> + <img alt="FixMyStreet Android app on Google Play" src="/cobrands/fixmystreet/images/google_play_logo.png" /> + </a> + </p> + </div> + + <div id="footer-help"> + <p> + Powered by <a class="platform-logo" href="http://fixmystreet.org/">FixMyStreet Platform</a> + </p> + </div> + </div> diff --git a/templates/web/harrogate/header.html b/templates/web/harrogate/header.html new file mode 100644 index 000000000..3d69fbac6 --- /dev/null +++ b/templates/web/harrogate/header.html @@ -0,0 +1,63 @@ +<!doctype html> +<!--[if lt IE 7]><html class="no-js ie6 oldie" lang="[% lang_code %]"><![endif]--> +<!--[if IE 7]> <html class="no-js ie7 oldie" lang="[% lang_code %]"><![endif]--> +<!--[if IE 8]> <html class="no-js ie8 oldie" lang="[% lang_code %]"><![endif]--> +<!--[if IE 9]> <html class="no-js ie9 oldie" lang="[% lang_code %]"><![endif]--> +<!--[if gt IE 9]><!--><html class="no-js" lang="[% lang_code %]"><!--<![endif]--> + <head> + <meta name="viewport" content="initial-scale=1.0"> + + <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> + <meta name="HandHeldFriendly" content="true"> + <meta name="mobileoptimized" content="0"> + + [% INCLUDE 'header_opengraph.html' %] + +[% SET start = c.config.ADMIN_BASE_URL IF admin %] + + <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/base.css') %]"> + <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]" media="(min-width:48em)"> + [% extra_css %] + <!--[if (lt IE 9) & (!IEMobile)]> + <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]"> + <![endif]--> + + <script src="[% start %][% version('/js/modernizr.custom.js') %]" charset="utf-8"></script> + <script src="[% start %][% version('/cobrands/fixmystreet/position_map.js') %]" charset="utf-8"></script> + [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js', site_title = c.cobrand.site_title %] + [% extra_js %] + + [% IF c.req.uri.host == 'osm.fixmystreet.com' %] + <link rel="canonical" href="https://www.fixmystreet.com[% c.req.uri.path_query %]"> + [% END %] + + [% TRY %][% PROCESS 'header_extra.html' %][% CATCH file %][% END %] + + </head> + [% TRY %][% PROCESS 'set_body_class.html' %][% CATCH file %][% END %] + <body class="[% bodyclass | html IF bodyclass %]"> + + <div class="wrapper"> + <div class="table-cell"> + <header id="site-header" role="banner"> + <div class="container"> + [% INCLUDE 'header_logo.html' %] + <a href="#main-nav" id="nav-link">Main Navigation</a> + </div> + </header> + + [% IF c.user_exists %] + <div id="user-meta"> + <p> + [% tprintf(loc('Hi %s'), c.user.name || c.user.email) %] + <a href="/auth/sign_out">[% loc('sign out') %]</a> + </p> + </div> + [% END %] + + [% pre_container_extra %] + + <div class="container"> + <div class="content[% " $mainclass" | html IF mainclass %]" role="main"> + + <!-- [% INCLUDE 'debug_header.html' %] --> 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 @@ +<div id="council_responsibilities_note"> +<p> +<b>NB:</b> 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 +<a href="https://www.fixmystreet.com/reports/North+Yorkshire">FixMyStreet.com</a>. +</p> +</div> + +Do not use this to <a href="/faq#emergencies">report emergencies outside of working hours</a>. 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' %] + +<div class="sticky-sidebar"> + <aside> + <ul class="plain-list"> + <li><a href="/faq">Frequently Asked Questions</a></li> + <li><strong>Privacy and cookies</strong></li> + <li><a href="/contact">Contact [% c.cobrand.site_title %]</a></li> + </ul> + </aside> +</div> + +<h1>Privacy, cookies, and third party services</h1> + +<p><strong>Our use of your data, cookies, and external services: what you +should know, and how to opt out if you want to.</strong></p> + +<h2>Privacy</h2> + + <dl> + <dt>Who gets to see my email address?</dt> + <dd> + <p>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.</p> + <p>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.</p> + </dd> + + <dt>What emails will you send to me?</dt> + <dd>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.</dd> + + </dl> + <dl> + +<h2>Cookies</h2> + +<p>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. + +<table cellpadding=5> +<tr align="left"><th scope="col">Name</th><th scope="col">Typical Content</th><th scope="col">Expires</th></tr> +<tr><td>fixmystreet_app_session</td><td nowrap>A random unique identifier</td><td>When browser is closed, or four weeks if “Keep me signed in” is ticked</td></tr> +</table> + +[% INCLUDE 'footer.html' pagefooter = 'yes' %] diff --git a/templates/web/warwickshire/front/stats.html b/templates/web/warwickshire/front/stats.html new file mode 100644 index 000000000..57eb4789c --- /dev/null +++ b/templates/web/warwickshire/front/stats.html @@ -0,0 +1 @@ +<!-- stats suppressed at WCC request. Remove this file to reenable --> 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/cobrands/harrogate/HBCLogo-cropped.png b/web/cobrands/harrogate/HBCLogo-cropped.png Binary files differnew file mode 100755 index 000000000..4421820d2 --- /dev/null +++ b/web/cobrands/harrogate/HBCLogo-cropped.png diff --git a/web/cobrands/harrogate/HBCLogo-mobile.png b/web/cobrands/harrogate/HBCLogo-mobile.png Binary files differnew file mode 100755 index 000000000..7b4cd6063 --- /dev/null +++ b/web/cobrands/harrogate/HBCLogo-mobile.png diff --git a/web/cobrands/harrogate/HBCLogo.png b/web/cobrands/harrogate/HBCLogo.png Binary files differnew file mode 100644 index 000000000..11ee7c79c --- /dev/null +++ b/web/cobrands/harrogate/HBCLogo.png diff --git a/web/cobrands/harrogate/HBLogo.png b/web/cobrands/harrogate/HBLogo.png Binary files differnew file mode 100755 index 000000000..03cf2b4f5 --- /dev/null +++ b/web/cobrands/harrogate/HBLogo.png diff --git a/web/cobrands/harrogate/_colours.scss b/web/cobrands/harrogate/_colours.scss new file mode 100644 index 000000000..a79b7acfb --- /dev/null +++ b/web/cobrands/harrogate/_colours.scss @@ -0,0 +1,22 @@ +/* COLOURS */ + +$harrogate_primary: #7EB7D8; + +$primary: $harrogate_primary; +$primary_dark: darken($harrogate_primary, 20%); + +$col_click_map: $harrogate_primary; +$col_click_map_dark: $harrogate_primary; +$col_fixed_label_dark: $harrogate_primary; +$col_fixed_label: $harrogate_primary; + +$primary_b: #000000; +$primary_text: #ffffff; + +$base_bg: #fff; +$base_fg: #1a1a1a; + +/* Following seem to be required in layout.scss */ +$map_nav_bg: #222; +$nav_fg: #000; +$nav_fg_hover: #444; diff --git a/web/cobrands/harrogate/base.scss b/web/cobrands/harrogate/base.scss new file mode 100644 index 000000000..eccb1a84f --- /dev/null +++ b/web/cobrands/harrogate/base.scss @@ -0,0 +1,65 @@ +@import "../sass/h5bp"; +@import "./_colours"; +@import "../sass/mixins"; +@import "compass"; + +@import "../sass/base"; + + +body.frontpage #site-logo, +.ie6 body.frontpage #site-logo, +#site-logo +{ + display: block; + margin: 2px; + padding-left: 10px; + position: static; + + background: url("/cobrands/harrogate/HBCLogo-mobile.png") 0 0 no-repeat; + width: 106px; + height: 37px; +} + +#main-nav ul#main-menu li { + + // blue button background, darker if selected + 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/config.rb b/web/cobrands/harrogate/config.rb new file mode 100644 index 000000000..cab97b18f --- /dev/null +++ b/web/cobrands/harrogate/config.rb @@ -0,0 +1,25 @@ +# Require any additional compass plugins here. + +# Set this to the root of your project when deployed: +http_path = "/" +css_dir = "" +sass_dir = "" +images_dir = "" +javascripts_dir = "" + +# You can select your preferred output style here (can be overridden via the command line): +# output_style = :expanded or :nested or :compact or :compressed + +# To enable relative paths to assets via compass helper functions. Uncomment: +# relative_assets = true + +# To disable debugging comments that display the original location of your selectors. Uncomment: +# line_comments = false + +# If you prefer the indented syntax, you might want to regenerate this +# project again passing --syntax sass, or you can uncomment this: +# preferred_syntax = :sass +# and then run: +# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass + +line_comments = false # by Compass.app diff --git a/web/cobrands/harrogate/layout.scss b/web/cobrands/harrogate/layout.scss new file mode 100644 index 000000000..480a07f5d --- /dev/null +++ b/web/cobrands/harrogate/layout.scss @@ -0,0 +1,185 @@ +@import "_colours"; +@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: 1.2em; + margin: 0; + 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; +} + +#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; + + } +} 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; diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index facb9d3f2..baa8d7810 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); 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 */ |