diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Reports.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/FixMyStreet.pm | 6 | ||||
-rw-r--r-- | t/cobrand/fixmystreet.t | 6 | ||||
-rw-r--r-- | templates/web/fixmystreet.com/about/council-dashboard.html | 18 | ||||
-rw-r--r-- | web/cobrands/fixmystreet.com/base.scss | 6 |
5 files changed, 19 insertions, 19 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm index 15a220644..037458538 100644 --- a/perllib/FixMyStreet/App/Controller/Reports.pm +++ b/perllib/FixMyStreet/App/Controller/Reports.pm @@ -413,6 +413,8 @@ sub summary : Private { my ($self, $c) = @_; my $dashboard = $c->forward('load_dashboard_data'); + $c->log->info($c->user->email . ' viewed ' . $c->req->uri->path_query) if $c->user_exists; + eval { my $data = path(FixMyStreet->path_to('../data/all-reports-dashboard.json'))->slurp_utf8; $data = decode_json($data); diff --git a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm index 591234877..6c826ec01 100644 --- a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm +++ b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm @@ -136,7 +136,7 @@ sub about_hook { $c->stash->{form_name} = $c->get_param('name') || ''; $c->stash->{email} = $c->get_param('username') || ''; if ($c->user_exists) { - my $body = _user_to_body($c); + my $body = $c->user->from_body || _user_to_body($c); if ($body) { $c->stash->{body} = $body; $c->stash->{wards} = [ { name => 'summary' } ]; @@ -152,9 +152,7 @@ sub about_hook { $c->stash->{template} = 'auth/general.html'; $c->detach('/auth/general'); } else { - $c->stash->{no_body_found} = 1; - $c->set_param('em', $email); # What the contact form wants - $c->detach('/contact/submit'); + $c->stash->{error} = 'bad_email'; } } } diff --git a/t/cobrand/fixmystreet.t b/t/cobrand/fixmystreet.t index 30d5765a2..57ab51198 100644 --- a/t/cobrand/fixmystreet.t +++ b/t/cobrand/fixmystreet.t @@ -18,6 +18,9 @@ FixMyStreet::override_config { $data = FixMyStreet::Script::UpdateAllReports::generate_dashboard($body); }; +FixMyStreet::App->log->disable('info'); +END { FixMyStreet::App->log->enable('info'); } + FixMyStreet::override_config { MAPIT_URL => 'http://mapit.uk/', TEST_DASHBOARD_DATA => $data, @@ -29,8 +32,7 @@ FixMyStreet::override_config { is $mech->uri->path, '/about/council-dashboard'; $mech->submit_form_ok({ with_fields => { username => 'someone@somewhere.example.org' }}); - $mech->content_contains('We will be in touch'); - # XXX Check email arrives + $mech->content_contains('did not recognise your email'); $mech->log_in_ok('someone@somewhere.example.org'); $mech->get_ok('/reports/Birmingham/summary'); diff --git a/templates/web/fixmystreet.com/about/council-dashboard.html b/templates/web/fixmystreet.com/about/council-dashboard.html index 60a52b3e2..1d4bca18d 100644 --- a/templates/web/fixmystreet.com/about/council-dashboard.html +++ b/templates/web/fixmystreet.com/about/council-dashboard.html @@ -2,15 +2,6 @@ title = 'Dashboard :: Request Access', bodyclass = 'fullwidthpage' %] -[% IF no_body_found %] - -<div class="confirmation-header confirmation-header--inbox"> - <h1>Thanks!</h1> - <p>We will be in touch with a confirmation link soon.</p> -</div> - -[% ELSE %] - <div class="council-dashboard-login"> <form method="post"> @@ -31,7 +22,12 @@ <label for="demo-email">Contact email</label> <span class="required">required</span> <input class="form-control" type="email" name="username" id="demo-email" required value="[% email | html %]"> - <p class="form-note">Ending in .gov.uk, or other official council domain</p> + <p class="form-note"> + [% IF error == 'bad_email' %]<strong>[% END ~%] + Ending in .gov.uk, or other official council domain + [% IF error == 'bad_email' %]– please <a href="/contact?name=[% form_name | uri %]&em=[% email | uri %]">contact us</a> + if we did not recognise your email</strong>[% END ~%] + </p> </div> <div class="form-group submit-group"> <input type="hidden" name="r" value="about/council-dashboard"> @@ -47,6 +43,4 @@ </div> -[% END %] - [% INCLUDE footer.html %] diff --git a/web/cobrands/fixmystreet.com/base.scss b/web/cobrands/fixmystreet.com/base.scss index 484c39716..9d263d865 100644 --- a/web/cobrands/fixmystreet.com/base.scss +++ b/web/cobrands/fixmystreet.com/base.scss @@ -476,6 +476,10 @@ input.postcode-form-test__postcode { background: #b2b2b2 url(/cobrands/fixmystreet.com/images/dashboard-teaser-blurred.jpg) 0 0 no-repeat; background-size: 100%; + strong { + color: #c00; + } + form { max-width: 24em; padding: 2em; @@ -515,4 +519,4 @@ input.postcode-form-test__postcode { & > :last-child { margin-bottom: 0; } -}
\ No newline at end of file +} |