aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md2
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm37
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm13
-rw-r--r--perllib/FixMyStreet/DB/Result/Comment.pm20
-rw-r--r--t/app/controller/admin_defecttypes.t193
-rw-r--r--t/app/controller/report_inspect.t16
-rw-r--r--t/app/controller/report_updates.t42
-rw-r--r--t/app/controller/reports.t79
-rw-r--r--templates/web/base/auth/sign_out.html2
-rw-r--r--templates/web/base/contact/submit.html2
-rw-r--r--templates/web/base/questionnaire/completed.html2
-rw-r--r--templates/web/base/reports/_list-filters.html12
-rw-r--r--templates/web/base/tokens/confirm_alert.html2
-rw-r--r--templates/web/base/tokens/confirm_problem.html1
-rw-r--r--templates/web/base/tokens/confirm_update.html1
-rwxr-xr-xtemplates/web/fixmystreet.com/about/faq-en-gb.html2
-rw-r--r--templates/web/fixmystreet.com/contact/who.html2
-rw-r--r--templates/web/fixmystreet.com/footer_extra.html6
-rw-r--r--templates/web/fixmystreet.com/next_steps.html24
-rw-r--r--templates/web/fixmystreet.com/questionnaire/completed-open.html2
-rw-r--r--templates/web/fixmystreet.com/static/unresponsive.html2
-rw-r--r--web/cobrands/fixmystreet.com/images/next-step-donate.pngbin0 -> 1034 bytes
-rw-r--r--web/cobrands/fixmystreet.com/layout.scss1
23 files changed, 414 insertions, 49 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0c7bf854e..50d2ca9e0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,8 +5,10 @@
- Body and category names can now be translated in the admin. #1244
- Body users can now create reports as an anonymous user. #1796
- Extra fields can be added to report form site-wide. #1743
+ - Body users can filter reports by all states. #1790
- Front end improvements:
- Always show pagination figures even if only one page.
+ - Report pages list every update to a report. #1806
- Admin improvements:
- Highlight current shortlisted user in list tooltip.
- Extra fields on contacts can be edited. #1743
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index 520efa4dc..48cf53eb3 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -320,7 +320,7 @@ sub inspect : Private {
$c->forward('/auth/check_csrf_token');
my $valid = 1;
- my $update_text;
+ my $update_text = '';
my $reputation_change = 0;
my %update_params = ();
@@ -367,6 +367,8 @@ sub inspect : Private {
if ( $problem->state ne $old_state ) {
$c->forward( '/admin/log_edit', [ $problem->id, 'problem', 'state_change' ] );
+ $update_params{problem_state} = $problem->state;
+
my $state = $problem->state;
$reputation_change = 1 if $c->cobrand->reputation_increment_states->{$state};
$reputation_change = -1 if $c->cobrand->reputation_decrement_states->{$state};
@@ -384,6 +386,7 @@ sub inspect : Private {
# If the state has been changed to action scheduled and they've said
# they want to raise a defect, consider the report to be inspected.
if ($problem->state eq 'action scheduled' && $c->get_param('raise_defect') && !$problem->get_extra_metadata('inspected')) {
+ $update_params{extra} = { 'defect_raised' => 1 };
$problem->set_extra_metadata( inspected => 1 );
$c->forward( '/admin/log_edit', [ $problem->id, 'problem', 'inspected' ] );
}
@@ -419,24 +422,22 @@ sub inspect : Private {
}
$problem->lastupdate( \'current_timestamp' );
$problem->update;
- if ( defined($update_text) ) {
- my $timestamp = \'current_timestamp';
- if (my $saved_at = $c->get_param('saved_at')) {
- $timestamp = DateTime->from_epoch( epoch => $saved_at );
- }
- my $name = $c->user->from_body ? $c->user->from_body->name : $c->user->name;
- $problem->add_to_comments( {
- text => $update_text,
- created => $timestamp,
- confirmed => $timestamp,
- user_id => $c->user->id,
- name => $name,
- state => 'confirmed',
- mark_fixed => 0,
- anonymous => 0,
- %update_params,
- } );
+ my $timestamp = \'current_timestamp';
+ if (my $saved_at = $c->get_param('saved_at')) {
+ $timestamp = DateTime->from_epoch( epoch => $saved_at );
}
+ my $name = $c->user->from_body ? $c->user->from_body->name : $c->user->name;
+ $problem->add_to_comments( {
+ text => $update_text,
+ created => $timestamp,
+ confirmed => $timestamp,
+ user_id => $c->user->id,
+ name => $name,
+ state => 'confirmed',
+ mark_fixed => 0,
+ anonymous => 0,
+ %update_params,
+ } );
# This problem might no longer be visible on the current cobrand,
# if its body has changed (e.g. by virtue of the category changing)
# so redirect to a cobrand where it can be seen if necessary
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index ec18e33d0..2b5777773 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -542,6 +542,19 @@ sub stash_report_filter_status : Private {
$filter_status{unshortlisted} = 1;
}
+ if ($c->user and ($c->user->is_superuser or (
+ $c->stash->{body} and $c->user->belongs_to_body($c->stash->{body}->id)
+ ))) {
+ foreach my $state (FixMyStreet::DB::Result::Problem->visible_states()) {
+ if ($status{$state}) {
+ %filter_problem_states = (%filter_problem_states, ($state => 1));
+ my $pretty_state = $state;
+ $pretty_state =~ tr/ /_/;
+ $filter_status{$pretty_state} = 1;
+ }
+ }
+ }
+
if (keys %filter_problem_states == 0) {
my $s = FixMyStreet::DB::Result::Problem->open_states();
%filter_problem_states = (%filter_problem_states, %$s);
diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm
index 1218d2f76..d688eb8b9 100644
--- a/perllib/FixMyStreet/DB/Result/Comment.pm
+++ b/perllib/FixMyStreet/DB/Result/Comment.pm
@@ -101,6 +101,7 @@ use Moo;
use namespace::clean -except => [ 'meta' ];
with 'FixMyStreet::Roles::Abuser',
+ 'FixMyStreet::Roles::Extra',
'FixMyStreet::Roles::PhotoSet';
my $stz = sub {
@@ -238,10 +239,19 @@ sub meta_line {
} elsif ($body eq 'Royal Borough of Greenwich') {
$body = "$body <img src='/cobrands/greenwich/favicon.png' alt=''>";
}
- if ($c->user_exists and $c->user->has_permission_to('view_body_contribute_details', $self->problem->bodies_str_ids)) {
- $meta = sprintf( _( 'Posted by <strong>%s</strong> (%s) at %s' ), $body, $user_name, Utils::prettify_dt( $self->confirmed ) );
+ my $can_view_contribute = $c->user_exists && $c->user->has_permission_to('view_body_contribute_details', $self->problem->bodies_str_ids);
+ if ($self->text) {
+ if ($can_view_contribute) {
+ $meta = sprintf( _( 'Posted by <strong>%s</strong> (%s) at %s' ), $body, $user_name, Utils::prettify_dt( $self->confirmed ) );
+ } else {
+ $meta = sprintf( _( 'Posted by <strong>%s</strong> at %s' ), $body, Utils::prettify_dt( $self->confirmed ) );
+ }
} else {
- $meta = sprintf( _( 'Posted by <strong>%s</strong> at %s' ), $body, Utils::prettify_dt( $self->confirmed ) );
+ if ($can_view_contribute) {
+ $meta = sprintf( _( 'Updated by <strong>%s</strong> (%s) at %s' ), $body, $user_name, Utils::prettify_dt( $self->confirmed ) );
+ } else {
+ $meta = sprintf( _( 'Updated by <strong>%s</strong> at %s' ), $body, Utils::prettify_dt( $self->confirmed ) );
+ }
}
} else {
$meta = sprintf( _( 'Posted by %s at %s' ), FixMyStreet::Template::html_filter($self->name), Utils::prettify_dt( $self->confirmed ) )
@@ -294,6 +304,10 @@ sub meta_line {
$meta .= ", $update_state";
}
+ if ($self->get_extra_metadata('defect_raised')) {
+ $meta .= ', ' . _( 'and a defect raised' );
+ }
+
$c->stash->{last_state} = $update_state;
return $meta;
diff --git a/t/app/controller/admin_defecttypes.t b/t/app/controller/admin_defecttypes.t
new file mode 100644
index 000000000..e7d0e42af
--- /dev/null
+++ b/t/app/controller/admin_defecttypes.t
@@ -0,0 +1,193 @@
+use FixMyStreet::TestMech;
+
+my $mech = FixMyStreet::TestMech->new;
+
+FixMyStreet::override_config { ALLOWED_COBRANDS => ['bromley'], }, sub {
+ subtest 'check defecttypes menu not available' => sub {
+ my $body = $mech->create_body_ok( 2482, 'Bromley Council' );
+
+ my $user = $mech->create_user_ok(
+ 'bromley@example.com',
+ name => 'Test User',
+ from_body => $body
+ );
+
+ $mech->log_in_ok( $user->email );
+
+ $mech->get_ok('/admin');
+ $mech->content_lacks('Defect Types');
+
+ is $mech->get('/admin/defecttypes')->code, 404, '404 if no permission';
+ is $mech->get('/admin/defecttypes/' . $body->id)->code, 404, '404 if no permission';
+
+ $mech->log_out_ok();
+ };
+};
+
+FixMyStreet::override_config { ALLOWED_COBRANDS => ['oxfordshire'], }, sub {
+
+ my $body = $mech->create_body_ok( 2237, 'Oxfordshire County Council' );
+
+ my $user = $mech->create_user_ok(
+ 'oxford@example.com',
+ name => 'Test User',
+ from_body => $body
+ );
+
+ $mech->log_in_ok( $user->email );
+
+ my $contact = $mech->create_contact_ok(
+ body_id => $body->id,
+ category => 'Traffic lights',
+ email => 'lights@example.com'
+ );
+
+ subtest 'check defecttypes menu not available without permissions' => sub {
+ $mech->get_ok('/admin');
+ $mech->content_lacks('Defect Types');
+
+ is $mech->get('/admin/defecttypes')->code, 404, '404 if no permission';
+ is $mech->get('/admin/defecttypes/' . $body->id)->code, 404, '404 if no permission';
+ };
+
+ $user->user_body_permissions->create( {
+ body => $body,
+ permission_type => 'defect_type_edit',
+ } );
+
+ subtest 'check defecttypes menu available with permissions' => sub {
+ $mech->get_ok('/admin');
+ $mech->content_contains('Defect Types');
+ $mech->get_ok('/admin/defecttypes');
+ is $mech->res->previous->code, 302, 'index redirects...';
+ is $mech->uri->path, '/admin/defecttypes/' . $body->id, '...to body page';
+ };
+
+ subtest 'check missing defect type is 404' => sub {
+ is $mech->get( '/admin/defecttypes/' . $body->id . '/299')->code, 404;
+ };
+
+ subtest 'check adding a defect type' => sub {
+ $mech->get_ok( '/admin/defecttypes/' . $body->id . '/new' );
+
+ $mech->content_contains('Traffic lights');
+
+ $mech->submit_form_ok( {
+ with_fields => {
+ name => 'A defect',
+ description => 'This is a new defect',
+ } } );
+
+ $mech->content_contains('New defect');
+ };
+
+ subtest 'check editing a defect type' => sub {
+ my $defect = FixMyStreet::App->model('DB::DefectType')->search( {
+ name => 'A defect',
+ body_id => $body->id
+ } )->first;
+
+ $mech->get_ok( '/admin/defecttypes/' . $body->id . '/' . $defect->id );
+
+ $mech->submit_form_ok( {
+ with_fields => {
+ name => 'Updated defect',
+ description => 'This is a new defect',
+ }
+ },
+ 'submitted form'
+ );
+
+ $mech->content_lacks('A defect');
+ $mech->content_contains('Updated defect');
+
+ my $defects = FixMyStreet::App->model('DB::DefectType')->search( {
+ body_id => $body->id
+ } );
+
+ is $defects->count, 1, 'only 1 defect';
+ };
+
+ subtest 'check adding a category to a defect' => sub {
+ my $defect = FixMyStreet::App->model('DB::DefectType')->search( {
+ name => 'Updated defect',
+ body_id => $body->id
+ } )->first;
+
+ is $defect->contact_defect_types->count, 0,
+ 'defect has no contact types';
+
+ $mech->get_ok( '/admin/defecttypes/' . $body->id . '/' . $defect->id );
+
+ $mech->submit_form_ok( {
+ with_fields => {
+ name => 'Updated defect',
+ description => 'This is a new defect',
+ categories => [ $contact->id ],
+ }
+ },
+ 'submitted form'
+ );
+
+ $mech->content_contains('Traffic lights');
+
+ $defect->discard_changes;
+ is $defect->contact_defect_types->count, 1, 'defect has a contact type';
+ is $defect->contact_defect_types->first->contact->category,
+ 'Traffic lights', 'defect has correct contact type';
+ };
+
+ subtest 'check removing category from a defect' => sub {
+ my $defect = FixMyStreet::App->model('DB::DefectType')->search( {
+ name => 'Updated defect',
+ body_id => $body->id
+ } )->first;
+
+ is $defect->contact_defect_types->count, 1,
+ 'defect has one contact types';
+
+ $mech->get_ok( '/admin/defecttypes/' . $body->id . '/' . $defect->id );
+
+ $mech->submit_form_ok( {
+ with_fields => {
+ name => 'Updated defect',
+ description => 'This is a new defect',
+ categories => '',
+ }
+ },
+ 'submitted form'
+ );
+
+ $mech->content_lacks('Traffic lights');
+
+ $defect->discard_changes;
+ is $defect->contact_defect_types->count, 0,
+ 'defect has no contact type';
+ };
+
+ subtest 'check adding codes to a defect' => sub {
+ my $defect = FixMyStreet::App->model('DB::DefectType')->search( {
+ name => 'Updated defect',
+ body_id => $body->id
+ } )->first;
+
+ $mech->get_ok( '/admin/defecttypes/' . $body->id . '/' . $defect->id );
+
+ $mech->submit_form_ok( {
+ with_fields => {
+ name => 'Updated defect',
+ description => 'This is a new defect',
+ 'extra[activity_code]' => 1,
+ 'extra[defect_code]' => 2,
+ }
+ },
+ 'submitted form'
+ );
+
+ $defect->discard_changes;
+ is_deeply $defect->get_extra_metadata,
+ { activity_code => 1, defect_code => 2 }, 'defect codes set';
+ };
+};
+
+done_testing();
diff --git a/t/app/controller/report_inspect.t b/t/app/controller/report_inspect.t
index e668fddbf..33486aa28 100644
--- a/t/app/controller/report_inspect.t
+++ b/t/app/controller/report_inspect.t
@@ -79,10 +79,21 @@ FixMyStreet::override_config {
public_update => "This is a public update.", include_update => "1",
state => 'action scheduled', raise_defect => 1,
} });
+ $mech->get_ok("/report/$report_id");
+ $mech->submit_form_ok({ with_fields => {
+ update => "This is a second public update, of normal update form, no actual change.",
+ } });
$report->discard_changes;
- is $report->comments->first->text, "This is a public update.", 'Update was created';
+ my $comment = ($report->comments( undef, { order_by => { -desc => 'id' } } )->all)[1]->text;
+ is $comment, "This is a public update.", 'Update was created';
is $report->get_extra_metadata('inspected'), 1, 'report marked as inspected';
is $report->user->get_extra_metadata('reputation'), $reputation, "User reputation wasn't changed";
+ $mech->get_ok("/report/$report_id");
+ my $meta = $mech->extract_update_metas;
+ like $meta->[0], qr/Updated by .*action scheduled/, 'First update mentions action scheduled';
+ like $meta->[1], qr/Posted by .*defect raised/, 'Update mentions defect raised';
+ unlike $meta->[2], qr/Posted by .*action scheduled/, 'Update does not mention action scheduled';
+
$user->unset_extra_metadata('categories');
$user->update;
};
@@ -245,6 +256,9 @@ FixMyStreet::override_config {
} });
$report->discard_changes;
is $report->get_extra_metadata('inspected'), 1, 'report marked as inspected';
+ $mech->get_ok("/report/$report_id");
+ my $meta = $mech->extract_update_metas;
+ like $meta->[-1], qr/Updated by .*defect raised/, 'Update mentions defect raised';
};
subtest "Oxfordshire-specific traffic management options are shown" => sub {
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t
index 81174181c..4cb035bac 100644
--- a/t/app/controller/report_updates.t
+++ b/t/app/controller/report_updates.t
@@ -928,6 +928,48 @@ subtest 'check meta correct for second comment marking as reopened' => sub {
like $update_meta->[1], qr/reopened/, 'update meta says reopened';
};
+subtest "check first comment with status change but no text is displayed" => sub {
+ $user->from_body( $body->id );
+ $user->update;
+
+ $report->comments->delete;
+
+ my $comment = FixMyStreet::App->model('DB::Comment')->create(
+ {
+ user => $user,
+ name => $user->from_body->name,
+ problem_id => $report->id,
+ text => '',
+ confirmed => DateTime->now( time_zone => 'local'),
+ problem_state => 'investigating',
+ anonymous => 0,
+ mark_open => 0,
+ mark_fixed => 0,
+ state => 'confirmed',
+ }
+ );
+ $mech->log_in_ok( $user->email );
+
+ $mech->get_ok("/report/$report_id");
+
+ my $update_meta = $mech->extract_update_metas;
+ like $update_meta->[0], qr/Updated by/, 'updated by meta if no text';
+ unlike $update_meta->[0], qr/Test User/, 'commenter name not included';
+ like $update_meta->[0], qr/investigating/, 'update meta includes state change';
+
+ ok $user->user_body_permissions->create({
+ body => $body,
+ permission_type => 'view_body_contribute_details'
+ }), 'Give user view_body_contribute_details permissions';
+
+ $mech->get_ok("/report/$report_id");
+ $update_meta = $mech->extract_update_metas;
+ like $update_meta->[0], qr/Updated by/, 'updated by meta if no text';
+ like $update_meta->[0], qr/Test User/, 'commenter name included if user has view contribute permission';
+ like $update_meta->[0], qr/investigating/, 'update meta includes state change';
+};
+
+
$user->from_body(undef);
$user->update;
diff --git a/t/app/controller/reports.t b/t/app/controller/reports.t
index 9f28a6c89..f3958a0a5 100644
--- a/t/app/controller/reports.t
+++ b/t/app/controller/reports.t
@@ -277,6 +277,85 @@ subtest "it lists shortlisted reports" => sub {
};
};
+subtest "it allows body users to filter by subtypes" => sub {
+ FixMyStreet::override_config {
+ MAPIT_URL => 'http://mapit.uk/'
+ }, sub {
+ my $body = FixMyStreet::App->model('DB::Body')->find( $body_edin_id );
+ my $user = $mech->log_in_ok( 'test@example.com' );
+ $user->update({ from_body => $body });
+
+ my ($investigating_problem) = $mech->create_problems_for_body(1, $body_edin_id, 'Investigating report');
+ my ($scheduled_problem) = $mech->create_problems_for_body(1, $body_edin_id, 'A Scheduled report');
+ my ($in_progress_problem) = $mech->create_problems_for_body(1, $body_edin_id, 'In progress report');
+
+ $investigating_problem->update({ state => 'investigating' });
+ $scheduled_problem->update({ state => 'action scheduled' });
+ $in_progress_problem->update({ state => 'in progress' });
+
+ $mech->get_ok('/reports/City+of+Edinburgh+Council');
+ $mech->content_contains('<option value="investigating">Investigating</option>');
+ $mech->content_contains('<option value="in progress">In progress</option>');
+ $mech->content_contains('<option value="action scheduled">Action scheduled</option>');
+ $mech->content_contains('<option value="unable to fix">No further action</option>');
+ $mech->content_contains('<option value="not responsible">Not responsible</option>');
+ $mech->content_contains('<option value="internal referral">Internal referral</option>');
+ $mech->content_contains('<option value="duplicate">Duplicate</option>');
+
+ $mech->get_ok('/reports/City+of+Edinburgh+Council?status=investigating');
+
+ $in_progress_problem->discard_changes();
+
+ $mech->content_contains('Investigating report');
+ $mech->content_lacks('In progress report');
+ $mech->content_lacks('A Scheduled report');
+
+ $mech->get_ok('/reports/City+of+Edinburgh+Council?status=in progress');
+
+ $mech->content_lacks('Investigating report');
+ $mech->content_contains('In progress report');
+ $mech->content_lacks('A Scheduled report');
+ };
+};
+
+subtest "it does not allow non body users to filter by subtypes" => sub {
+ FixMyStreet::override_config {
+ MAPIT_URL => 'http://mapit.uk/'
+ }, sub {
+ my $user = $mech->log_in_ok( 'test@example.com' );
+ $user->update({ from_body => undef });
+
+ $mech->get_ok('/reports/City+of+Edinburgh+Council');
+ $mech->content_lacks('<option value="investigating">Investigating</option>');
+ $mech->content_lacks('<option value="in progress">In progress</option>');
+ $mech->content_lacks('<option value="action scheduled">Action scheduled</option>');
+ $mech->content_lacks('<option value="unable to fix">No further action</option>');
+ $mech->content_lacks('<option value="not responsible">Not responsible</option>');
+ $mech->content_lacks('<option value="internal referral">Internal referral</option>');
+ $mech->content_lacks('<option value="duplicate">Duplicate</option>');
+ };
+};
+
+subtest "it does not allow body users to filter subcategories for other bodies" => sub {
+ FixMyStreet::override_config {
+ MAPIT_URL => 'http://mapit.uk/'
+ }, sub {
+ my $body = FixMyStreet::App->model('DB::Body')->find( $body_west_id );
+ my $user = $mech->log_in_ok( 'test@example.com' );
+ $user->update({ from_body => $body });
+
+ $mech->get_ok('/reports/City+of+Edinburgh+Council');
+
+ $mech->content_lacks('<option value="investigating">Investigating</option>');
+ $mech->content_lacks('<option value="in progress">In progress</option>');
+ $mech->content_lacks('<option value="action scheduled">Action scheduled</option>');
+ $mech->content_lacks('<option value="unable to fix">No further action</option>');
+ $mech->content_lacks('<option value="not responsible">Not responsible</option>');
+ $mech->content_lacks('<option value="internal referral">Internal referral</option>');
+ $mech->content_lacks('<option value="duplicate">Duplicate</option>');
+ };
+};
+
subtest "can use translated body name" => sub {
FixMyStreet::override_config {
MAPIT_URL => 'http://mapit.uk/',
diff --git a/templates/web/base/auth/sign_out.html b/templates/web/base/auth/sign_out.html
index c95efacf5..1a468b278 100644
--- a/templates/web/base/auth/sign_out.html
+++ b/templates/web/base/auth/sign_out.html
@@ -5,6 +5,6 @@
<p>[% tprintf( loc('Please feel free to <a href="%s">sign in again</a>, or go back to the <a href="/">front page</a>.'), c.uri_for('/auth') ) %]</p>
</div>
-[% INCLUDE next_steps.html %]
+[% INCLUDE next_steps.html utm_content='signed out' %]
[% INCLUDE 'footer.html' %]
diff --git a/templates/web/base/contact/submit.html b/templates/web/base/contact/submit.html
index 4bf82dcd6..acb7caad9 100644
--- a/templates/web/base/contact/submit.html
+++ b/templates/web/base/contact/submit.html
@@ -16,6 +16,6 @@
[% END %]
-[% INCLUDE next_steps.html %]
+[% INCLUDE next_steps.html utm_content='contact form submitted' %]
[% INCLUDE 'footer.html' %]
diff --git a/templates/web/base/questionnaire/completed.html b/templates/web/base/questionnaire/completed.html
index 32aa8bd68..280cc33b8 100644
--- a/templates/web/base/questionnaire/completed.html
+++ b/templates/web/base/questionnaire/completed.html
@@ -16,6 +16,6 @@
[% END %]
</div>
-[% INCLUDE next_steps.html %]
+[% INCLUDE next_steps.html utm_content='questionnaire completed' %]
[% INCLUDE 'footer.html' %]
diff --git a/templates/web/base/reports/_list-filters.html b/templates/web/base/reports/_list-filters.html
index 73afe64f4..ef7c7ad78 100644
--- a/templates/web/base/reports/_list-filters.html
+++ b/templates/web/base/reports/_list-filters.html
@@ -9,9 +9,21 @@
<option value="shortlisted"[% ' selected' IF filter_status.shortlisted %]>[% loc('Shortlisted') %]</option>
<option value="unshortlisted"[% ' selected' IF filter_status.unshortlisted %]>[% loc('Unshortlisted') %]</option>
[% END %]
+ [% IF c.user_exists AND c.user.is_superuser OR c.user.belongs_to_body(body.id) %]
+ <option value="confirmed"[% ' selected' IF filter_status.confirmed %]>[% loc('Open') %]</option>
+ <option value="investigating"[% ' selected' IF filter_status.investigating %]>[% loc('Investigating') %]</option>
+ <option value="in progress"[% ' selected' IF filter_status.in_progress %]>[% loc('In progress') %]</option>
+ <option value="action scheduled"[% ' selected' IF filter_status.action_scheduled %]>[% loc('Action scheduled') %]</option>
+ <option value="fixed"[% ' selected' IF filter_status.fixed %]>[% loc('Fixed reports') %]</option>
+ <option value="unable to fix"[% ' selected' IF filter_status.unable_to_fix %]>[% loc('No further action') %]</option>
+ <option value="not responsible"[% ' selected' IF filter_status.not_responsible %]>[% loc('Not responsible') %]</option>
+ <option value="internal referral"[% ' selected' IF filter_status.internal_referral %]>[% loc('Internal referral') %]</option>
+ <option value="duplicate"[% ' selected' IF filter_status.duplicate %]>[% loc('Duplicate') %]</option>
+ [% ELSE %]
<option value="open"[% ' selected' IF filter_status.open %]>[% loc('Unfixed reports') %]</option>
<option value="closed"[% ' selected' IF filter_status.closed %]>[% loc('Closed reports') %]</option>
<option value="fixed"[% ' selected' IF filter_status.fixed %]>[% loc('Fixed reports') %]</option>
+ [% END %]
</select>
[% END %]
diff --git a/templates/web/base/tokens/confirm_alert.html b/templates/web/base/tokens/confirm_alert.html
index f0ad12ff8..0154f0225 100644
--- a/templates/web/base/tokens/confirm_alert.html
+++ b/templates/web/base/tokens/confirm_alert.html
@@ -14,6 +14,6 @@
</div>
-[% INCLUDE next_steps.html %]
+[% INCLUDE next_steps.html utm_content='email alert set up' %]
[% INCLUDE 'footer.html' %]
diff --git a/templates/web/base/tokens/confirm_problem.html b/templates/web/base/tokens/confirm_problem.html
index a4573b5e6..ff9882d4b 100644
--- a/templates/web/base/tokens/confirm_problem.html
+++ b/templates/web/base/tokens/confirm_problem.html
@@ -36,6 +36,7 @@
[% INCLUDE
next_steps.html,
just_interacted = 1,
+ utm_content = 'problem confirmed',
share_url = c.cobrand.base_url_for_report(report) _ report.url,
twitter_comment = loc('I just reported a problem on @fixmystreet')
%]
diff --git a/templates/web/base/tokens/confirm_update.html b/templates/web/base/tokens/confirm_update.html
index 005a8a7ac..6b03308a5 100644
--- a/templates/web/base/tokens/confirm_update.html
+++ b/templates/web/base/tokens/confirm_update.html
@@ -20,6 +20,7 @@ END;
[% INCLUDE
next_steps.html,
just_interacted = 1,
+ utm_content = 'update confirmed',
share_url = c.cobrand.base_url_for_report(problem) _ problem.url,
twitter_comment = loc('I just updated a problem on @fixmystreet')
%]
diff --git a/templates/web/fixmystreet.com/about/faq-en-gb.html b/templates/web/fixmystreet.com/about/faq-en-gb.html
index f9bffdf01..fddac7952 100755
--- a/templates/web/fixmystreet.com/about/faq-en-gb.html
+++ b/templates/web/fixmystreet.com/about/faq-en-gb.html
@@ -318,7 +318,7 @@ correspondence to you – or if you only have an auto-response, you may be able
to find further contact details there.
<p>If you still have no joy, we suggest starting a new FixMyStreet report. You
may also like to use another useful mySociety website, <a
-href="https://www.writetothem.com/?utm_source=fixmystreet.com&utm_campaign=static_links&utm_medium=link&utm_content=help+what_now">WriteToThem</a>,
+href="https://www.writetothem.com/?utm_source=fixmystreet.com&amp;utm_campaign=static_links&amp;utm_medium=link&amp;utm_content=help+what_now">WriteToThem</a>,
to contact your local councillors and ask them to help.
</dd>
diff --git a/templates/web/fixmystreet.com/contact/who.html b/templates/web/fixmystreet.com/contact/who.html
index 5fad05dd2..e16809e48 100644
--- a/templates/web/fixmystreet.com/contact/who.html
+++ b/templates/web/fixmystreet.com/contact/who.html
@@ -44,7 +44,7 @@
<p>
<strong>If you're not having any luck getting your community problems fixed</strong>,
you could try contacting your local councillor, using another useful mySociety site:
- <a href="https://www.writetothem.com/?utm_source=fixmystreet.com&utm_campaign=contact_workflow_links&utm_medium=link&utm_content=contact+not_fixed">WriteToThem</a>.
+ <a href="https://www.writetothem.com/?utm_source=fixmystreet.com&amp;utm_campaign=contact_workflow_links&amp;utm_medium=link&amp;utm_content=contact+not_fixed">WriteToThem</a>.
</p>
[% END %]
diff --git a/templates/web/fixmystreet.com/footer_extra.html b/templates/web/fixmystreet.com/footer_extra.html
index 0eee4a802..4d14d8fb5 100644
--- a/templates/web/fixmystreet.com/footer_extra.html
+++ b/templates/web/fixmystreet.com/footer_extra.html
@@ -47,7 +47,7 @@
<div class="col-sm-3">
<div class="mysoc-footer__donate">
<p>Your donations keep this site and others like it running</p>
- <a href="https://www.mysociety.org/donate?utm_source=fixmystreet.com&utm_content=footer+donate+now&utm_medium=link&utm_campaign=mysoc_footer" class="mysoc-footer__donate__button">Donate now</a>
+ <a href="https://www.mysociety.org/donate?utm_source=fixmystreet.com&amp;utm_content=footer+donate+now&amp;utm_medium=link&amp;utm_campaign=mysoc_footer" class="mysoc-footer__donate__button">Donate now</a>
</div>
</div>
@@ -59,7 +59,7 @@
<div class="mysoc-footer__orgs">
<p class="mysoc-footer__org">
Built by
- <a href="https://www.mysociety.org?utm_source=fixmystreet.com&utm_content=footer+logo&utm_medium=link&utm_campaign=mysoc_footer" class="mysoc-footer__org__logo mysoc-footer__org__logo--mysociety">mySociety</a>
+ <a href="https://www.mysociety.org?utm_source=fixmystreet.com&amp;utm_content=footer+logo&amp;utm_medium=link&amp;utm_campaign=mysoc_footer" class="mysoc-footer__org__logo mysoc-footer__org__logo--mysociety">mySociety</a>
</p>
<p class="mysoc-footer__org">
Powered by
@@ -70,7 +70,7 @@
<div class="col-sm-4">
<div class="mysoc-footer__legal">
- <p>mySociety Limited is a project of UK Citizens Online Democracy, a registered charity in England and Wales. For full details visit <a href="https://www.mysociety.org?utm_source=fixmystreet.com&utm_content=footer+full+legal+details&utm_medium=link&utm_campaign=mysoc_footer">mysociety.org</a>.</p>
+ <p>mySociety Limited is a project of UK Citizens Online Democracy, a registered charity in England and Wales. For full details visit <a href="https://www.mysociety.org?utm_source=fixmystreet.com&amp;utm_content=footer+full+legal+details&amp;utm_medium=link&amp;utm_campaign=mysoc_footer">mysociety.org</a>.</p>
</div>
</div>
diff --git a/templates/web/fixmystreet.com/next_steps.html b/templates/web/fixmystreet.com/next_steps.html
index 2bfc23ddb..e561b9d98 100644
--- a/templates/web/fixmystreet.com/next_steps.html
+++ b/templates/web/fixmystreet.com/next_steps.html
@@ -2,23 +2,8 @@
[% DEFAULT share_url = c.cobrand.base_url %]
[% DEFAULT twitter_comment = 'I just used @fixmystreet, you should try it!' %]
-[% SET app_step = 1 IF NOT report OR NOT report.service %]
-<div class="next-steps[% ' next-steps--two' IF NOT app_step %]">
- [% IF app_step %]
- <div class="next-steps__step next-steps__step--apps">
- [% IF just_interacted %]
- <h2>[% loc('Next time, try our mobile app!') %]</h2>
- [% ELSE %]
- <h2>[% loc('Have you tried our mobile app?') %]</h2>
- [% END %]
- <p>[% loc('Download it now, and it’ll be ready to use when you next pick up your phone.') %]</p>
- <p class="next-steps__step__cta">
- <a href="https://itunes.apple.com/gb/app/fixmystreet/id297456545"><img src="/cobrands/fixmystreet.com/images/next-step-apple.png" alt="Download on the App Store" width="120" height="37"></a>
- <a href="https://play.google.com/store/apps/details?id=org.mysociety.FixMyStreet"><img src="/cobrands/fixmystreet.com/images/next-step-google.png" alt="Android app on Google Play" width="120" height="37"></a>
- </p>
- </div>
- [% END %]
+<div class="next-steps">
<div class="next-steps__step next-steps__step--social">
[% IF just_interacted %]
<h2>[% loc('Great work. Now spread the word!') %]</h2>
@@ -32,6 +17,13 @@
<a href="https://www.facebook.com/sharer/sharer.php?u=[% share_url | uri %]"><img src="/cobrands/fixmystreet.com/images/next-step-facebook.png" alt="Share on Facebook" width="120" height="37"></a>
</p>
</div>
+ <div class="next-steps__step next-steps__step--donate">
+ <h2>[% loc('Help support FixMyStreet') %]</h2>
+ <p>[% loc('Even a small donation of £5 today will help mySociety run sites like FixMyStreet.') %]</p>
+ <p class="next-steps__step__cta">
+ <a href="https://www.mysociety.org/donate?utm_source=fixmystreet.com&amp;utm_content=[% utm_content | uri %]&amp;utm_medium=link&amp;utm_campaign=fms_thankyou_pages"><img src="/cobrands/fixmystreet.com/images/next-step-donate.png" alt="Donate now" width="138" height="37"></a>
+ </p>
+ </div>
<div class="next-steps__step next-steps__step--goodies">
<h2>[% loc('Free FixMyStreet goodies for you!') %]</h2>
<a href="/posters">
diff --git a/templates/web/fixmystreet.com/questionnaire/completed-open.html b/templates/web/fixmystreet.com/questionnaire/completed-open.html
index f10d5d266..86ea4742a 100644
--- a/templates/web/fixmystreet.com/questionnaire/completed-open.html
+++ b/templates/web/fixmystreet.com/questionnaire/completed-open.html
@@ -13,7 +13,7 @@
</p>
<p>
- You can do this on <a href="https://www.writetothem.com/?utm_source=fixmystreet.com&utm_campaign=workflow_links&utm_medium=link&utm_content=completed+unfixed">WriteToThem</a>, another
+ You can do this on <a href="https://www.writetothem.com/?utm_source=fixmystreet.com&amp;utm_campaign=workflow_links&amp;utm_medium=link&amp;utm_content=completed+unfixed">WriteToThem</a>, another
useful mySociety website.
</p>
[% END %]
diff --git a/templates/web/fixmystreet.com/static/unresponsive.html b/templates/web/fixmystreet.com/static/unresponsive.html
index 8014ab8e1..5d9b4bfab 100644
--- a/templates/web/fixmystreet.com/static/unresponsive.html
+++ b/templates/web/fixmystreet.com/static/unresponsive.html
@@ -26,7 +26,7 @@
<h2>If you’d prefer to use FixMyStreet next time:</h2>
- <a href="https://www.writetothem.com/?utm_source=fixmystreet.com&utm_campaign=workflow_links&utm_medium=link&utm_content=unresponsive_council+cta" class="unresponsive-council-cta">
+ <a href="https://www.writetothem.com/?utm_source=fixmystreet.com&amp;utm_campaign=workflow_links&amp;utm_medium=link&amp;utm_content=unresponsive_council+cta" class="unresponsive-council-cta">
<strong>Write to your MP or local councillors</strong> to let them know this isn’t okay
</a>
diff --git a/web/cobrands/fixmystreet.com/images/next-step-donate.png b/web/cobrands/fixmystreet.com/images/next-step-donate.png
new file mode 100644
index 000000000..20e136fd4
--- /dev/null
+++ b/web/cobrands/fixmystreet.com/images/next-step-donate.png
Binary files differ
diff --git a/web/cobrands/fixmystreet.com/layout.scss b/web/cobrands/fixmystreet.com/layout.scss
index ee9d8725e..60b65569f 100644
--- a/web/cobrands/fixmystreet.com/layout.scss
+++ b/web/cobrands/fixmystreet.com/layout.scss
@@ -179,6 +179,7 @@ body.frontpage {
.next-steps {
@include clearfix;
+ @include flex-container();
margin-bottom: 2em; // add some space between this and the footer
}