From c4169478a3cd94902b9d4d5ca166dbd85bca09ce Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Wed, 19 Dec 2018 12:36:13 +0000 Subject: Make who question more prominent. --- t/app/controller/contact.t | 8 ++-- templates/web/base/contact/index.html | 7 ++- templates/web/fixmystreet.com/contact/who.html | 64 ++++++++++++++------------ web/cobrands/sass/_base.scss | 6 +++ web/js/contact.js | 14 ++++++ 5 files changed, 64 insertions(+), 35 deletions(-) create mode 100644 web/js/contact.js diff --git a/t/app/controller/contact.t b/t/app/controller/contact.t index 254522b92..3fa83be9b 100644 --- a/t/app/controller/contact.t +++ b/t/app/controller/contact.t @@ -346,6 +346,7 @@ for my $test ( page_errors => [ 'There were problems with your report. Please see below.', 'Please enter who your message is for', + 'You can only contact the team behind FixMyStreet using our contact form', # The JS-hidden one ] }, { @@ -391,11 +392,12 @@ for my $test ( $test->{fields}->{'extra.phone'} = ''; is_deeply $mech->visible_form_values, $test->{fields}, 'form values'; + # Ugh, but checking div not hidden; text always shown and hidden with CSS if ( $test->{fields}->{dest} and $test->{fields}->{dest} eq 'update' ) { - $mech->content_contains( 'www.writetothem.com', 'includes link to WTT if trying to update report' ); + $mech->content_contains('
'); } elsif ( $test->{fields}->{dest} and $test->{fields}->{dest} eq 'council' ) { - $mech->content_lacks( 'www.writetothem.com', 'does not include link to WTT if trying to contact council' ); - $mech->content_contains( 'should find contact details', 'mentions checking council website for contact details' ); + # Ugh, but checking div not hidden + $mech->content_contains('
'); } } }; diff --git a/templates/web/base/contact/index.html b/templates/web/base/contact/index.html index 8e0894312..f71c36fb1 100644 --- a/templates/web/base/contact/index.html +++ b/templates/web/base/contact/index.html @@ -1,3 +1,6 @@ +[% extra_js = [ + version('/js/contact.js') +] -%] [% INCLUDE 'header.html', title = loc('Contact Us') robots = 'noindex,nofollow' @@ -71,6 +74,8 @@ [% END %] + [% INCLUDE 'contact/who.html' %] + [% IF field_errors.name %]
[% field_errors.name %]
@@ -95,8 +100,6 @@ [% END %] - [% INCLUDE 'contact/who.html' %] - [% IF field_errors.message %]
[% field_errors.message %]
diff --git a/templates/web/fixmystreet.com/contact/who.html b/templates/web/fixmystreet.com/contact/who.html index e16809e48..a683412b7 100644 --- a/templates/web/fixmystreet.com/contact/who.html +++ b/templates/web/fixmystreet.com/contact/who.html @@ -3,10 +3,37 @@ [% IF field_errors.dest %]
[% field_errors.dest %]
-[% ELSIF field_errors.not_for_us %] -
You can only contact the team behind FixMyStreet using our contact form
+[% END %] + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +