diff options
-rw-r--r-- | .cypress/cypress/integration/regressions.js | 9 | ||||
-rw-r--r-- | .cypress/cypress/integration/simple_spec.js | 29 | ||||
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rwxr-xr-x | bin/fixmystreet.com/fixture | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Dashboard.pm | 13 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 19 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/Update.pm | 14 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 5 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 27 | ||||
-rw-r--r-- | perllib/FixMyStreet/Script/Reports.pm | 3 | ||||
-rw-r--r-- | t/app/controller/report_as_other.t | 31 | ||||
-rwxr-xr-x | templates/web/base/around/_updates.html | 2 | ||||
-rw-r--r-- | templates/web/base/report/display_tools.html | 2 | ||||
-rw-r--r-- | templates/web/fixmystreet.com/around/postcode_form.html | 34 | ||||
-rw-r--r-- | web/cobrands/fixmystreet.com/base.scss | 64 | ||||
-rw-r--r-- | web/cobrands/fixmystreet.com/layout.scss | 29 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 18 | ||||
-rw-r--r-- | web/cobrands/sass/_layout.scss | 3 |
19 files changed, 254 insertions, 54 deletions
diff --git a/.cypress/cypress/integration/regressions.js b/.cypress/cypress/integration/regressions.js new file mode 100644 index 000000000..a0d5b3fc9 --- /dev/null +++ b/.cypress/cypress/integration/regressions.js @@ -0,0 +1,9 @@ +describe('Regression tests', function() { + it('Shows the sub-map links after clicking Try again', function() { + cy.viewport(480, 800); + cy.visit('/around?pc=BS10+5EE&js=1'); + cy.get('#map_box').click(200, 200); + cy.get('#try_again').click(); + cy.get('#sub_map_links').should('be.visible'); + }); +}); diff --git a/.cypress/cypress/integration/simple_spec.js b/.cypress/cypress/integration/simple_spec.js index 39000a022..30f2a0218 100644 --- a/.cypress/cypress/integration/simple_spec.js +++ b/.cypress/cypress/integration/simple_spec.js @@ -1,16 +1,35 @@ -describe('My First Test', function() { - it('Visits the home page', function() { +describe('Clicking the map', function() { + before(function(){ cy.visit('/'); cy.contains('Go'); cy.get('[name=pc]').type('BS10 5EE'); - cy.get('#postcodeForm').submit(); + cy.get('[name=pc]').parents('form').submit(); + }); + + it('allows me to report a new problem', function() { cy.url().should('include', '/around'); cy.get('#map_box').click(200, 200); cy.get('[name=title]').type('Title'); cy.get('[name=detail]').type('Detail'); cy.get('[name=username]').type('user@example.org'); cy.get('[name=password_sign_in]').type('password'); - cy.get('form').submit(); - cy.get('form').submit(); + cy.get('[name=password_sign_in]').parents('form').submit(); + cy.get('#map_sidebar').should('contain', 'check and confirm your details'); + cy.get('#map_sidebar').parents('form').submit(); + cy.get('body').should('contain', 'Thank you for reporting this issue'); + }); +}); + +describe('Clicking the "big green banner" on a map page', function() { + before(function() { + cy.visit('/'); + cy.get('[name=pc]').type('BS10 5EE'); + cy.get('[name=pc]').parents('form').submit(); + cy.get('.big-green-banner').click(); + }); + + it('begins a new report', function() { + cy.url().should('include', '/report/new'); + cy.get('#form_title').should('be.visible'); }); }); diff --git a/.travis.yml b/.travis.yml index de3ec7b29..fbe8ad240 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,7 +55,7 @@ before_script: - 'if [ "$TRAVIS_PERL_VERSION" = "5.24" ]; then export HARNESS_PERL_SWITCHES="-MDevel::Cover=+ignore,local/lib/perl5,commonlib,perllib/Catalyst/[^A],perllib/DBIx,perllib/Email,perllib/Template,^t"; fi' script: - 'if [ "$CYPRESS" = "0" ]; then script/test --jobs 3 t; fi' - - 'if [ "$CYPRESS" = "1" ]; then PATH=$(npm bin):$PATH bin/browser-tests run --record; fi' + - 'if [ "$CYPRESS" = "1" ]; then PATH=$(npm bin):$PATH bin/browser-tests run ${CYPRESS_RECORD_KEY:+--record}; fi' after_success: - .travis/after_script - 'if [ "$TRAVIS_PERL_VERSION" = "5.24" ]; then cover --report codecov; fi' diff --git a/CHANGELOG.md b/CHANGELOG.md index a0e8bb1d6..613883ff3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,16 +12,19 @@ - Increase size of "sub map links" (hide pins, permalink, etc) #2003 - Edge-to-edge email layout on narrow screens #2010 - Add default placeholder to report extra fields. #2027 + - Clicking the "Click map" instruction banner now begins a new report #2033 - Bugfixes: - Stop asset layers obscuring marker layer. #1999 - Don't delete hidden field values when inspecting reports. #1999 - Fix text layout issues in /reports/…/summary dashboard charts. - Fix post-edit issues on admin report edit page. - Truncate dates in Open311 output to the second. #2023 + - Fix check for visible sub map links after 'Try again'. - Admin improvements: - Inspectors can set non_public status of reports. #1992 - Default start date is shown on the dashboard. - Users with 'user_edit' permission can search for users/reports. #2027 + - Don't send sent-report emails to as-body/as-anonymous reports. - Development improvements: - Add HTML email previewer. diff --git a/bin/fixmystreet.com/fixture b/bin/fixmystreet.com/fixture index 1aa85564f..091fcab9d 100755 --- a/bin/fixmystreet.com/fixture +++ b/bin/fixmystreet.com/fixture @@ -16,6 +16,7 @@ BEGIN { } use List::Util qw(shuffle); +use Path::Tiny; use FixMyStreet; use FixMyStreet::Cobrand; use FixMyStreet::DB::Factories; diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm index 7cdf150aa..866deb98e 100644 --- a/perllib/FixMyStreet/App/Controller/Dashboard.pm +++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm @@ -360,21 +360,16 @@ sub generate_csv : Private { my $fixed_states = FixMyStreet::DB::Result::Problem->fixed_states; my $closed_states = FixMyStreet::DB::Result::Problem->closed_states; - my $wards = 0; - my $comments = 0; - foreach (@{$c->stash->{csv}->{columns}}) { - $wards = 1 if $_ eq 'wards'; - $comments = 1 if $_ eq 'acknowledged'; - } + my %asked_for = map { $_ => 1 } @{$c->stash->{csv}->{columns}}; my $problems = $c->stash->{csv}->{problems}; while ( my $report = $problems->next ) { - my $hashref = $report->as_hashref($c); + my $hashref = $report->as_hashref($c, \%asked_for); $hashref->{user_name_display} = $report->anonymous ? '(anonymous)' : $report->user->name; - if ($comments) { + if ($asked_for{acknowledged}) { for my $comment ($report->comments) { my $problem_state = $comment->problem_state or next; next unless $comment->state eq 'confirmed'; @@ -389,7 +384,7 @@ sub generate_csv : Private { } } - if ($wards) { + if ($asked_for{wards}) { $hashref->{wards} = join ', ', map { $c->stash->{children}->{$_}->{name} } grep {$c->stash->{children}->{$_} } diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index e4e82f091..a41aeb6ea 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -1300,9 +1300,17 @@ sub save_user_and_report : Private { if ( $c->cobrand->never_confirm_reports ) { $report->user->update_or_insert; $report->confirm(); - } elsif ( $c->forward('created_as_someone_else', [ $c->stash->{bodies} ]) ) { - # If created on behalf of someone else, we automatically confirm it, - # but we don't want to update the user account + # If created on behalf of someone else, we automatically confirm it, + # but we don't want to update the user account + } elsif ($c->stash->{contributing_as_another_user}) { + $report->set_extra_metadata( contributed_as => 'another_user'); + $report->set_extra_metadata( contributed_by => $c->user->id ); + $report->confirm(); + } elsif ($c->stash->{contributing_as_body}) { + $report->set_extra_metadata( contributed_as => 'body' ); + $report->confirm(); + } elsif ($c->stash->{contributing_as_anonymous_user}) { + $report->set_extra_metadata( contributed_as => 'anonymous_user' ); $report->confirm(); } elsif ( !$report->user->in_storage ) { # User does not exist. @@ -1342,11 +1350,6 @@ sub save_user_and_report : Private { return 1; } -sub created_as_someone_else : Private { - my ($self, $c, $bodies) = @_; - return $c->stash->{contributing_as_another_user} || $c->stash->{contributing_as_body} || $c->stash->{contributing_as_anonymous_user}; -} - =head2 generate_map Add the html needed to for the map to the stash. diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm index 99eae8659..9d97688c5 100644 --- a/perllib/FixMyStreet/App/Controller/Report/Update.pm +++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm @@ -444,9 +444,17 @@ sub save_update : Private { if ( $c->cobrand->never_confirm_updates ) { $update->user->update_or_insert; $update->confirm(); - } elsif ( $c->forward('/report/new/created_as_someone_else', [ $update->problem->bodies_str ]) ) { - # If created on behalf of someone else, we automatically confirm it, - # but we don't want to update the user account + # If created on behalf of someone else, we automatically confirm it, + # but we don't want to update the user account + } elsif ($c->stash->{contributing_as_another_user}) { + $update->set_extra_metadata( contributed_as => 'another_user'); + $update->set_extra_metadata( contributed_by => $c->user->id ); + $update->confirm(); + } elsif ($c->stash->{contributing_as_body}) { + $update->set_extra_metadata( contributed_as => 'body' ); + $update->confirm(); + } elsif ($c->stash->{contributing_as_anonymous_user}) { + $update->set_extra_metadata( contributed_as => 'anonymous_user' ); $update->confirm(); } elsif ( !$update->user->in_storage ) { # User does not exist. diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index c8af63987..453300cd5 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -1172,11 +1172,12 @@ sub admin_stats { sub export_as_csv { my ($self, $c, $params) = @_; + $c->model('DB')->schema->storage->sql_maker->quote_char('"'); my $csv = $c->stash->{csv} = { problems => $c->model('DB::Problem')->search_rs( $params, { - join => 'admin_log_entries', + join => ['admin_log_entries', 'user'], distinct => 1, columns => [ 'id', 'created', @@ -1190,6 +1191,7 @@ sub export_as_csv { 'service', 'extra', { sum_time_spent => { sum => 'admin_log_entries.time_spent' } }, + 'name', 'user.id', 'user.email', 'user.phone', 'user.name', ] } ), @@ -1258,6 +1260,7 @@ sub export_as_csv { filename => 'stats', }; $c->forward('/dashboard/generate_csv'); + $c->model('DB')->schema->storage->sql_maker->quote_char(''); } sub problem_confirm_email_extras { diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index 2deeb3084..fac0fc7ef 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -653,7 +653,8 @@ sub body { my $body; if ($problem->external_body) { if ($problem->cobrand eq 'zurich') { - $body = $c->model('DB::Body')->find({ id => $problem->external_body }); + my $cache = $problem->result_source->schema->cache; + return $cache->{bodies}{$problem->external_body} //= $c->model('DB::Body')->find({ id => $problem->external_body }); } else { $body = $problem->external_body; } @@ -918,12 +919,11 @@ sub add_send_method { } sub as_hashref { - my $self = shift; - my $c = shift; + my ($self, $c, $cols) = @_; my $state_t = FixMyStreet::DB->resultset("State")->display($self->state); - return { + my $out = { id => $self->id, title => $self->title, category => $self->category, @@ -935,16 +935,17 @@ sub as_hashref { state => $self->state, state_t => $state_t, used_map => $self->used_map, - is_fixed => $self->fixed_states->{ $self->state } ? 1 : 0, - photos => [ map { $_->{url} } @{$self->photos} ], - meta => $self->confirmed ? $self->meta_line( $c ) : '', - ($self->confirmed ? ( - confirmed => $self->confirmed, - confirmed_pp => $c->cobrand->prettify_dt( $self->confirmed ), - ) : ()), - created => $self->created, - created_pp => $c->cobrand->prettify_dt( $self->created ), + created => $self->created, }; + $out->{is_fixed} = $self->fixed_states->{ $self->state } ? 1 : 0 if !$cols || $cols->{is_fixed}; + $out->{photos} = [ map { $_->{url} } @{$self->photos} ] if !$cols || $cols->{photos}; + $out->{meta} = $self->confirmed ? $self->meta_line( $c ) : '' if !$cols || $cols->{meta}; + $out->{created_pp} = $c->cobrand->prettify_dt( $self->created ) if !$cols || $cols->{created_pp}; + if ($self->confirmed) { + $out->{confirmed} = $self->confirmed if !$cols || $cols->{confirmed}; + $out->{confirmed_pp} = $c->cobrand->prettify_dt( $self->confirmed ) if !$cols || $cols->{confirmed_pp}; + } + return $out; } =head2 latest_moderation_log_entry diff --git a/perllib/FixMyStreet/Script/Reports.pm b/perllib/FixMyStreet/Script/Reports.pm index b8c3d6d0d..1d19ee283 100644 --- a/perllib/FixMyStreet/Script/Reports.pm +++ b/perllib/FixMyStreet/Script/Reports.pm @@ -294,6 +294,9 @@ sub _send_report_sent_email { # Don't send 'report sent' text return unless $row->user->email_verified; + my $contributed_as = $row->get_extra_metadata('contributed_as') || ''; + return if $contributed_as eq 'body' || $contributed_as eq 'anonymous_user'; + FixMyStreet::Email::send_cron( $row->result_source->schema, 'confirm_report_sent.txt', diff --git a/t/app/controller/report_as_other.t b/t/app/controller/report_as_other.t index e8f65eb7b..367d9a1d4 100644 --- a/t/app/controller/report_as_other.t +++ b/t/app/controller/report_as_other.t @@ -1,5 +1,6 @@ use FixMyStreet::TestMech; use FixMyStreet::App; +use FixMyStreet::Script::Reports; # disable info logs for this test run FixMyStreet::App->log->disable('info'); @@ -15,7 +16,7 @@ my $test_email = 'body-user@example.net'; my $user = $mech->log_in_ok($test_email); $user->update({ from_body => $body->id, name => 'Body User' }); -my ($report_to_update) = $mech->create_problems_for_body(1, $body->id, 'Title'); +my ($report_to_update) = $mech->create_problems_for_body(1, $body->id, 'Title', { category => 'Potholes' }); subtest "Body user, no permissions, no special reporting tools shown" => sub { start_report(); @@ -100,6 +101,9 @@ subtest "Body user, has permission to add report as another user with landline n }; subtest "Body user, has permission to add report as another (existing) user with email" => sub { + FixMyStreet::Script::Reports::send(); + $mech->clear_emails_ok; + $mech->create_user_ok('existing@example.net', name => 'Existing User'); my $report = add_report( 'contribute_as_another_user', @@ -116,6 +120,15 @@ subtest "Body user, has permission to add report as another (existing) user with isnt $report->user->id, $user->id, 'user does not match'; like $mech->get_text_body_from_email, qr/Your report to Oxfordshire County Council has been logged/; push @users, $report->user; + + my $send_confirmation_mail_override = Sub::Override->new( + "FixMyStreet::Cobrand::Default::report_sent_confirmation_email", + sub { return 1; } + ); + FixMyStreet::Script::Reports::send(); + $mech->email_count_is(2); + $mech->clear_emails_ok; + $send_confirmation_mail_override->restore(); }; subtest "Body user, has permission to add report as another (existing) user with phone" => sub { @@ -138,6 +151,9 @@ subtest "Body user, has permission to add report as another (existing) user with }; subtest "Body user, has permission to add report as anonymous user" => sub { + FixMyStreet::Script::Reports::send(); + $mech->clear_emails_ok; + my $report = add_report( 'contribute_as_anonymous_user', form_as => 'anonymous_user', @@ -149,6 +165,19 @@ subtest "Body user, has permission to add report as anonymous user" => sub { is $report->user->name, 'Body User', 'user name unchanged'; is $report->user->id, $user->id, 'user matches'; is $report->anonymous, 1, 'report anonymous'; + + my $send_confirmation_mail_override = Sub::Override->new( + "FixMyStreet::Cobrand::Default::report_sent_confirmation_email", + sub { return 1; } + ); + + FixMyStreet::Script::Reports::send(); + # No report sent email is sent + $mech->email_count_is(1); + my $email = $mech->get_email; + like $email->header('Subject'), qr/Problem Report: Test Report/, 'report email title correct'; + $mech->clear_emails_ok; + $send_confirmation_mail_override->restore(); }; subtest "Body user, has permission to add update as council" => sub { diff --git a/templates/web/base/around/_updates.html b/templates/web/base/around/_updates.html index 6121b218b..e5af69da0 100755 --- a/templates/web/base/around/_updates.html +++ b/templates/web/base/around/_updates.html @@ -1,5 +1,5 @@ <div class="shadow-wrap"> <ul id="key-tools"> - <li><a class="feed" id="key-tool-around-updates" href="[% email_url | html %]">[% loc("Get updates") %]</a></li> + <li><a class="feed js-feed" id="key-tool-around-updates" href="[% email_url | html %]">[% loc("Get updates") %]</a></li> </ul> </div> diff --git a/templates/web/base/report/display_tools.html b/templates/web/base/report/display_tools.html index bb76cc388..8ed86c228 100644 --- a/templates/web/base/report/display_tools.html +++ b/templates/web/base/report/display_tools.html @@ -11,7 +11,7 @@ %]</a></li> [% END %] [% IF c.cobrand.moniker != 'zurich' %] - <li><a rel="nofollow" id="key-tool-report-updates" class="feed" href="[% c.uri_for( '/alert/subscribe', { id => problem.id } ) %]">[% loc('Get updates' ) %]</a></li> + <li><a rel="nofollow" id="key-tool-report-updates" class="feed js-feed" href="[% c.uri_for( '/alert/subscribe', { id => problem.id } ) %]">[% loc('Get updates' ) %]</a></li> [% END %] [% IF c.cobrand.moniker == 'fixmystreet' %] <li><a rel="nofollow" id="key-tool-report-share" class="share" href="#report-share">[% loc('Share') %]</a></li> diff --git a/templates/web/fixmystreet.com/around/postcode_form.html b/templates/web/fixmystreet.com/around/postcode_form.html new file mode 100644 index 000000000..c1d3198c0 --- /dev/null +++ b/templates/web/fixmystreet.com/around/postcode_form.html @@ -0,0 +1,34 @@ +<div id="front-main"> + <div id="front-main-container"> + [% UNLESS possible_location_matches %] + [% INCLUDE 'around/intro.html' %] + [% END %] + + [% + question = c.cobrand.enter_postcode_text || loc('Enter a nearby street name and area'); + %] + + <form action="[% c.uri_for('/around') %]" method="get" name="postcodeForm" class="js-geolocate postcode-form-test"> + <label for="pc">[% question %]:</label> + <input type="text" name="pc" value="[% pc | html %]" id="pc" size="10" maxlength="200" placeholder="[% tprintf(loc('e.g. ‘%s’ or ‘%s’'), c.cobrand.example_places) %]" class="postcode-form-test__postcode"> + <a href="[% c.uri_for('/around') %]" id="geolocate_link" class="btn btn--geolocate">[% loc('or locate me automatically') %]</a> + + [%# Form will be submitted via this button when user presses Enter key %] + <button type="submit" class="visuallyhidden" aria-hidden="true" tabindex="-1">Go</button> + + <div class="postcode-form-test__buttons"> + [%# We can now segment users in Google Analytics by looking at "intent" query string param %] + <button type="submit" name="intent" value="report" class="btn">[% loc('Report a new problem') %]</button> + <button type="submit" name="intent" value="browse" class="btn">[% loc('Show problems') %]</button> + </div> + + [% IF partial_token %] + <input type="hidden" name="partial" value="[% partial_token.token %]"> + [% END %] + + [% IF c.user_exists AND c.user.categories.size %] + <input type="hidden" name="filter_category" value="[% c.user.categories.join(",") | html %]"> + [% END %] + </form> + </div> +</div> diff --git a/web/cobrands/fixmystreet.com/base.scss b/web/cobrands/fixmystreet.com/base.scss index aed038a6e..b78d5ce5b 100644 --- a/web/cobrands/fixmystreet.com/base.scss +++ b/web/cobrands/fixmystreet.com/base.scss @@ -323,3 +323,67 @@ html.lazyload .js-lazyload { margin-bottom: 0; } } + +.postcode-form-test { + margin: 0 -1em; + padding: 1em; + background-color: $primary; + color: $primary_text; + + label { + margin: 0; + } + + // Lots of !important flags here to overpower + // selectors like `#front-main a#geolocate_link` and + // `body.fullwidthpage #front-main a#geolocate_link` + // in the core and fixmystreet.com styles. + #geolocate_link { + background: transparent !important; + border: none; + height: auto !important; + margin-top: 0 !important; + padding: 1em !important; + + &:before { + vertical-align: -0.3em; + } + } +} + +// Overloaded selector to beat input[type="text"] +input.postcode-form-test__postcode { + max-width: 100%; + width: 30em; + margin: 0.5em auto 0 auto; + padding: 0.75em; + border: 1px solid darken($primary, 10%); + box-shadow: 0 1px 1px rgba(#000, 0.2); +} + +.postcode-form-test__buttons { + margin: 1em -10px 0 -10px; + + // Browsers without flex support will just lay out the buttons + // side-by-side, breaking onto two lines at narrow widths. + @include flex-container(); + @include justify-content(center); + + $btn-blue: #469bfc; + + .btn { + color: #fff !important; + background: $btn-blue; + background-image: linear-gradient($btn-blue, darken($btn-blue, 5%)); + border: none; + border-radius: 2px; + text-shadow: 0 1px 1px rgba(0,0,0,0.2); + box-shadow: 0 1px 1px rgba(0,0,0,0.2); + margin: 0 10px 10px 10px; + + &:hover, &:focus { + background-color: darken($btn-blue, 5%); + background-image: linear-gradient(darken($btn-blue, 5%), darken($btn-blue, 10%)); + } + } +} diff --git a/web/cobrands/fixmystreet.com/layout.scss b/web/cobrands/fixmystreet.com/layout.scss index 0e37c9723..9c7f575a2 100644 --- a/web/cobrands/fixmystreet.com/layout.scss +++ b/web/cobrands/fixmystreet.com/layout.scss @@ -53,6 +53,8 @@ font-style: normal; } +$body-font: MuseoSans, Helmet, Freesans, sans-serif; + /* Opera has a bug (from around 10.5 upwards to current 11.6) with showing the * table caption *at all* if the header is set to a font-face :( */ noindex:-o-prefocus, #site-header { @@ -122,17 +124,17 @@ body.fullwidthpage { h1 { font-size: 3em; font-weight: bold; - font-family: MuseoSans,Helmet,Freesans,sans-serif; + font-family: $body-font; } h2 { - font-family: MuseoSans,Helmet,Freesans,sans-serif; + font-family: $body-font; } #postcodeForm { div { font-size: 1.3em; width: 24em; label { - font-family: MuseoSans,Helmet,Freesans,sans-serif; + font-family: $body-font; } input#pc { color: #777; @@ -147,13 +149,13 @@ body.fullwidthpage { font-size: 1.1em; height: 2.4em; width: 3.5em; - font-family: MuseoSans,Helmet,Freesans,sans-serif; + font-family: $body-font; font-weight: bold; } } } a#geolocate_link { - font-family: MuseoSans,Helmet,Freesans,sans-serif; + font-family: $body-font; background: url(images/locate-me.png) $left 0 no-repeat; height: 34px; padding-#{$left}: 24px; @@ -169,6 +171,21 @@ body.fullwidthpage { } } +.postcode-form-test { + background: transparent; + padding-top: 1.5em; +} + +// Overloaded selector to beat input[type="text"] +input.postcode-form-test__postcode { + max-width: 25em; // down from 27em, now that "GO" button has gone + font-size: 1.2em; +} + +.postcode-form-test__buttons .btn { + font-size: 1.2em; +} + body.frontpage { #site-logo { margin: 2em 0; @@ -207,7 +224,7 @@ body.frontpage { } .next-steps__step { - font-family: MuseoSans,Helmet,Freesans,sans-serif; + font-family: $body-font; float: $left; width: 33%; padding: 1.8em; diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index d85a5cdbc..443d7d986 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -669,6 +669,14 @@ $.extend(fixmystreet.set_up, { }); }, + clicking_banner_begins_report: function() { + $('.big-green-banner').on('click', function(){ + if (fixmystreet.map.getCenter) { + fixmystreet.display.begin_report( fixmystreet.map.getCenter() ); + } + }); + }, + map_controls: function() { //add permalink on desktop, force hide on mobile //add links container (if its not there) @@ -682,11 +690,11 @@ $.extend(fixmystreet.set_up, { } if ($('.mobile').length) { - $('#map_permalink').hide(); + $('#map_permalink').addClass('hidden'); // Make sure we end up with one Get updates link - if ($('#key-tools a.feed').length) { - $('#sub_map_links a.feed').remove(); - $('#key-tools a.feed').appendTo('#sub_map_links'); + if ($('#key-tools a.js-feed').length) { + $('#sub_map_links a.js-feed').remove(); + $('#key-tools a.js-feed').appendTo('#sub_map_links'); } $('#key-tools li:empty').remove(); $('#report-updates-data').insertAfter($('#map_box')); @@ -696,7 +704,7 @@ $.extend(fixmystreet.set_up, { } // Show/hide depending on whether it has any children to show - if ($('#sub_map_links a:visible').length) { + if ($('#sub_map_links a').not('.hidden').length) { $('#sub_map_links').show(); } else { $('#sub_map_links').hide(); diff --git a/web/cobrands/sass/_layout.scss b/web/cobrands/sass/_layout.scss index 2bd57f14a..3c5faf219 100644 --- a/web/cobrands/sass/_layout.scss +++ b/web/cobrands/sass/_layout.scss @@ -107,6 +107,9 @@ h1 { background-color: transparent; border-bottom: none; } + a:visited { + color: $nav_fg; + } } .nav-menu--main { a, span { |