diff options
44 files changed, 181 insertions, 246 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 18197b9ca..c838aa7bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ - Improve map JavaScript defensiveness. - Upgrade jquery-validation plugin. #2540 - Pass ‘filter_category’ param to front page to pre-filter map. + - Remove on-map Permalink. + - Darken front page step numbers, and improve nested heading structure. - Admin improvements: - Add new roles system, to group permissions and apply to users. #2483 - Contact form emails now include user admin links. diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 554fbc3b7..9a18d0e32 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -771,6 +771,8 @@ sub setup_categories_and_bodies : Private { my %category_groups = (); for my $category (@category_options) { my $group = $category->{group} // $category->get_extra_metadata('group') // ['']; + # multiple groups from open311 can contain " which upsets the html so strip them + $group =~ s/^"|"$//g; # this could be an array ref or a string my @groups = ref $group eq 'ARRAY' ? @$group : ($group); push( @{$category_groups{$_}}, $category ) for @groups; diff --git a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm index 015da5e0b..e5327b084 100644 --- a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm +++ b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm @@ -200,4 +200,14 @@ sub updates_disallowed { return $self->next::method(@_); } +sub suppress_reporter_alerts { + my $self = shift; + my $c = $self->{c}; + my $problem = $c->stash->{report}; + if ($problem->to_body_named('Westminster')) { + return 1; + } + return 0; +} + 1; diff --git a/perllib/FixMyStreet/Cobrand/Hounslow.pm b/perllib/FixMyStreet/Cobrand/Hounslow.pm index 58da5160c..2146f2b67 100644 --- a/perllib/FixMyStreet/Cobrand/Hounslow.pm +++ b/perllib/FixMyStreet/Cobrand/Hounslow.pm @@ -73,14 +73,8 @@ sub link_to_council_cobrand { "Hounslow Highways" } # Instead, force the borough council name to be used. sub all_reports_single_body { { name => "Hounslow Borough Council" } } -sub open311_pre_send { - my ($self, $row, $open311, $h) = @_; - - return unless $row->isa("FixMyStreet::DB::Result::Problem"); - - # Reload the problem from the DB, as we want to save our changes to it - # without affecting the existing instance. - $row = $row->result_source->resultset->find( { id => $row->id } ); +sub open311_post_send { + my ($self, $row, $h) = @_; # Stop the email being sent for each Open311 failure; only the once. return if $row->get_extra_metadata('hounslow_email_sent'); @@ -88,8 +82,7 @@ sub open311_pre_send { my $e = join( '@', 'enquiries', $self->council_url . 'highways.org' ); my $sender = FixMyStreet::SendReport::Email->new( to => [ [ $e, 'Hounslow Highways' ] ] ); if (!$sender->send($row, $h)) { - $row->set_extra_metadata('hounslow_email_sent', 1); - $row->update; + $row->set_extra_metadata('hounslow_email_sent', 1); } } diff --git a/perllib/FixMyStreet/Cobrand/Northamptonshire.pm b/perllib/FixMyStreet/Cobrand/Northamptonshire.pm index f16700820..7baeaba96 100644 --- a/perllib/FixMyStreet/Cobrand/Northamptonshire.pm +++ b/perllib/FixMyStreet/Cobrand/Northamptonshire.pm @@ -76,6 +76,17 @@ sub open311_config { $params->{multi_photos} = 1; } +sub open311_get_update_munging { + my ($self, $comment) = @_; + + # If we've received an update via Open311, let us always take its state change + my $state = $comment->problem_state; + my $p = $comment->problem; + if ($state && $p->state ne $state && $p->is_visible) { + $p->state($state); + } +} + sub should_skip_sending_update { my ($self, $comment) = @_; diff --git a/perllib/FixMyStreet/SendReport/Open311.pm b/perllib/FixMyStreet/SendReport/Open311.pm index 7445699a2..fcb6f7298 100644 --- a/perllib/FixMyStreet/SendReport/Open311.pm +++ b/perllib/FixMyStreet/SendReport/Open311.pm @@ -74,7 +74,7 @@ sub send { my $open311 = Open311->new( %open311_params ); - $cobrand->call_hook(open311_pre_send => $row, $open311, $h); + $cobrand->call_hook(open311_pre_send => $row, $open311); my $resp = $open311->send_service_request( $row, $h, $contact->email ); if (FixMyStreet->test_mode) { diff --git a/t/cobrand/westminster.t b/t/cobrand/westminster.t index 1ceeef6cb..cadd6b18d 100644 --- a/t/cobrand/westminster.t +++ b/t/cobrand/westminster.t @@ -162,21 +162,23 @@ FixMyStreet::override_config { }; }; -FixMyStreet::override_config { - ALLOWED_COBRANDS => 'westminster', - MAPIT_URL => 'http://mapit.uk/', -}, sub { - subtest 'No reporter alert created' => sub { - my $user = $mech->log_in_ok('test@example.org'); - $mech->get_ok('/'); - $mech->submit_form_ok( { with_fields => { pc => 'SW1A1AA' } }, "submit location" ); - $mech->follow_link_ok( { text_regex => qr/skip this step/i, }, "follow 'skip this step' link" ); - $mech->submit_form_ok( { with_fields => { - title => 'Title', detail => 'Detail', category => 'Abandoned bike', name => 'Test Example', - } }, 'submitted okay' ); - is $user->alerts->count, 0; +for my $cobrand (qw(westminster fixmystreet)) { + FixMyStreet::override_config { + ALLOWED_COBRANDS => $cobrand, + MAPIT_URL => 'http://mapit.uk/', + }, sub { + subtest "No reporter alert created in $cobrand" => sub { + my $user = $mech->log_in_ok('test@example.org'); + $mech->get_ok('/'); + $mech->submit_form_ok( { with_fields => { pc => 'SW1A1AA' } }, "submit location" ); + $mech->follow_link_ok( { text_regex => qr/skip this step/i, }, "follow 'skip this step' link" ); + $mech->submit_form_ok( { with_fields => { + title => 'Title', detail => 'Detail', category => 'Abandoned bike', name => 'Test Example', + } }, 'submitted okay' ); + is $user->alerts->count, 0; + }; }; -}; +} my $westminster = FixMyStreet::Cobrand::Westminster->new; subtest 'correct config returned for USRN/UPRN lookup' => sub { diff --git a/t/sendreport/open311.t b/t/sendreport/open311.t index 382df39f0..1cec5dd68 100644 --- a/t/sendreport/open311.t +++ b/t/sendreport/open311.t @@ -155,4 +155,45 @@ subtest 'test handles bad category', sub { like $bad_category_report->send_fail_reason, qr/Category Flytipping does not exist for body/, 'failure message set'; }; +my $hounslow = $mech->create_body_ok( 2483, 'Hounslow Borough Council'); +my $contact2 = $mech->create_contact_ok( body_id => $hounslow->id, category => 'Graffiti', email => 'GRAF' ); +$contact2->set_extra_fields( + { code => 'easting', datatype => 'number' }, + { code => 'northing', datatype => 'number' }, + { code => 'fixmystreet_id', datatype => 'number' }, +); +$contact2->update; + +my ($hounslow_report) = $mech->create_problems_for_body( 1, $hounslow->id, 'Test', { + cobrand => 'hounslow', + category => 'Graffiti', + user => $user, + latitude => 51.482286, + longitude => -0.328163, + cobrand => 'hounslow', +}); + +subtest 'Hounslow sends email upon Open311 submission', sub { + $hounslow->update( { send_method => 'Open311', endpoint => 'http://endpoint.example.com', jurisdiction => 'hounslow', api_key => 'test' } ); + $mech->clear_emails_ok; + FixMyStreet::override_config { + STAGING_FLAGS => { send_reports => 1 }, + ALLOWED_COBRANDS => [ 'hounslow' ], + MAPIT_URL => 'http://mapit.uk/', + }, sub { + FixMyStreet::Script::Reports::send(); + }; + $hounslow_report->discard_changes; + ok $hounslow_report->whensent, 'Report marked as sent'; + ok $hounslow_report->get_extra_metadata('hounslow_email_sent'), "Enquiries inbox email marked as sent"; + my ($hounslow_email, $user_email) = $mech->get_email; + my $body = $mech->get_text_body_from_email($hounslow_email); + like $body, qr/A user of FixMyStreet has submitted the following report/; + like $body, qr/Category: Graffiti/; + like $body, qr/Enquiry ref: 248/; + $body = $mech->get_text_body_from_email($user_email); + like $body, qr/reference number is 248/; +}; + + done_testing(); diff --git a/templates/web/base/alert/_index_text.html b/templates/web/base/alert/_index_text.html new file mode 100644 index 000000000..92e84478e --- /dev/null +++ b/templates/web/base/alert/_index_text.html @@ -0,0 +1,25 @@ +<p> +[% IF c.cobrand.is_council %] +[% tprintf(loc('%s has a variety of RSS feeds and email alerts for local +problems, including alerts for all problems within a particular ward, or all +problems within a certain distance of a particular location.', "%s is the site name"), site_name) %] +[% ELSE %] +[% tprintf(loc('%s has a variety of RSS feeds and email alerts for local problems, including +alerts for all problems within a particular ward or council, or all problems +within a certain distance of a particular location.', "%s is the site name"), site_name) %] +[% END %] +</p> + +[% IF location_error %] + <div class="error">[% location_error %]</div> +[% ELSE %] + [% INCLUDE 'errors.html' %] +[% END %] + +<p> +[% IF c.cobrand.is_council %] +[% tprintf(loc('To find out what local alerts we have for you, please enter your %s postcode or street name and area:'), c.cobrand.council_area) %] +[% ELSE %] +[% loc('To find out what local alerts we have for you, please enter your postcode or street name and area' ) %] +[% END %] +</p> diff --git a/templates/web/base/alert/_list.html b/templates/web/base/alert/_list.html index b9d955466..3dbd6b8d2 100644 --- a/templates/web/base/alert/_list.html +++ b/templates/web/base/alert/_list.html @@ -22,16 +22,7 @@ <h3>[% loc('Problems in an area') %]</h3> [% END %] - <p id="rss_local"> - <a href="[% rss_feed_uri %]" class="alerts-rss-link"> - <img src="/i/feed.png" width="16" height="16" title="[% loc('RSS feed of nearby problems') %]" alt="[% loc('RSS feed') %]"> - </a> - <label class="label-containing-checkbox" for="[% rss_feed_id %]"> - <input type="radio" name="feed" id="[% rss_feed_id %]" value="[% rss_feed_id %]"[% IF rss_feed_id == selected_feed || selected_feed == '' %] checked[% END %]> - [% tprintf( loc('Problems within %.1fkm of %s'), population_radius, name_of_location ) %] - [% loc('(covers roughly 200,000 people)') %] - </label> - </p> + [% PROCESS 'alert/_list_rss_local.html' %] <p id="rss_local_alt"> [% SET distance_options = '<a href="' _ rss_feed_2k _ ' ">2km</a> / <a href="' _ rss_feed_5k _ ' ">5km</a> / <a href="' _ rss_feed_10k _ '">10km</a> / <a href="' _ rss_feed_20k _ '">20km</a>' %] diff --git a/templates/web/base/alert/_list_rss_local.html b/templates/web/base/alert/_list_rss_local.html new file mode 100644 index 000000000..a7fd82ca2 --- /dev/null +++ b/templates/web/base/alert/_list_rss_local.html @@ -0,0 +1,10 @@ + <p id="rss_local"> + <a href="[% rss_feed_uri %]" class="alerts-rss-link"> + <img src="/i/feed.png" width="16" height="16" title="[% loc('RSS feed of nearby problems') %]" alt="[% loc('RSS feed') %]"> + </a> + <label class="label-containing-checkbox" for="[% rss_feed_id %]"> + <input type="radio" name="feed" id="[% rss_feed_id %]" value="[% rss_feed_id %]"[% IF rss_feed_id == selected_feed || selected_feed == '' %] checked[% END %]> + [% tprintf( loc('Problems within %.1fkm of %s'), population_radius, name_of_location ) %] + [% loc('(covers roughly 200,000 people)') %] + </label> + </p> diff --git a/templates/web/base/alert/index.html b/templates/web/base/alert/index.html index ba3c64baf..3c7ff9e8b 100644 --- a/templates/web/base/alert/index.html +++ b/templates/web/base/alert/index.html @@ -3,33 +3,11 @@ <h1>[% loc('Local RSS feeds and email alerts') %]</h1> -<p> -[% IF c.cobrand.is_council %] -[% tprintf(loc('%s has a variety of RSS feeds and email alerts for local -problems, including alerts for all problems within a particular ward, or all -problems within a certain distance of a particular location.', "%s is the site name"), site_name) %] -[% ELSE %] -[% tprintf(loc('%s has a variety of RSS feeds and email alerts for local problems, including -alerts for all problems within a particular ward or council, or all problems -within a certain distance of a particular location.', "%s is the site name"), site_name) %] -[% END %] -</p> - -[% IF location_error %] - <div class="error">[% location_error %]</div> -[% ELSE %] - [% INCLUDE 'errors.html' %] -[% END %] +[% PROCESS 'alert/_index_text.html' %] -<p> -[% IF c.cobrand.is_council %] -[% tprintf(loc('To find out what local alerts we have for you, please enter your %s postcode or street name and area:'), c.cobrand.council_area) %] -[% ELSE %] -[% loc('To find out what local alerts we have for you, please enter your postcode or street name and area' ) %] -[% END %] -</p> <form method="get" action="/alert/list" class="form-box js-geolocate"> <fieldset> + <legend class="visuallyhidden">[% loc('Search for location of email alert or RSS feed') %]</legend> <label for="pc">[% loc('Postcode or street name and area') %]</label> <p class="form-hint" id="pc-hint">[% tprintf(loc('e.g. ‘%s’ or ‘%s’'), c.cobrand.example_places) %]</p> <div class="form-txt-submit-box"> diff --git a/templates/web/base/around/tabbed_lists.html b/templates/web/base/around/tabbed_lists.html index f135684b9..b3284468a 100755 --- a/templates/web/base/around/tabbed_lists.html +++ b/templates/web/base/around/tabbed_lists.html @@ -1,5 +1,7 @@ [% INCLUDE "reports/_list-filters.html" %] +<h2 class="hidden-js">[% loc('Reports') %]</h2> + <div class="js-pagination"> [% INCLUDE 'pagination.html' param = 'p' %] </div> diff --git a/templates/web/base/js/translation_strings.html b/templates/web/base/js/translation_strings.html index 21591203d..5ccd9863e 100644 --- a/templates/web/base/js/translation_strings.html +++ b/templates/web/base/js/translation_strings.html @@ -68,8 +68,6 @@ fixmystreet.password_minimum_length = [% c.cobrand.password_minimum_length %]; expand_map: '[% loc('Expand map') | replace("'", "\\'") %]', collapse_map: '[% loc('Collapse map') | replace("'", "\\'") %]', - permalink: '[% loc('Permalink') | replace("'", "\\'") %]', - filter: '[% loc('Filter') | replace("'", "\\'") %]', show_pins: '[% loc('Show pins') | replace("'", "\\'") %]', diff --git a/templates/web/base/report/form/user_loggedout_by_email_heading.html b/templates/web/base/report/form/user_loggedout_by_email_heading.html index 6aa90c2fd..221b75101 100644 --- a/templates/web/base/report/form/user_loggedout_by_email_heading.html +++ b/templates/web/base/report/form/user_loggedout_by_email_heading.html @@ -1,13 +1,13 @@ [% IF c.config.SMS_AUTHENTICATION %] [% IF type == 'update' %] - <h5 class="hidden-js">[% loc('<strong>No</strong> Let me confirm my update by email/text') %]</h5> + <h3 class="hidden-js">[% loc('<strong>No</strong> Let me confirm my update by email/text') %]</h3> [% ELSE %] - <h5 class="hidden-js">[% loc('<strong>No</strong> Let me confirm my report by email/text') %]</h5> + <h3 class="hidden-js">[% loc('<strong>No</strong> Let me confirm my report by email/text') %]</h3> [% END %] [% ELSE %] [% IF type == 'update' %] - <h5 class="hidden-js">[% loc('<strong>No</strong> Let me confirm my update by email') %]</h5> + <h3 class="hidden-js">[% loc('<strong>No</strong> Let me confirm my update by email') %]</h3> [% ELSE %] - <h5 class="hidden-js">[% loc('<strong>No</strong> Let me confirm my report by email') %]</h5> + <h3 class="hidden-js">[% loc('<strong>No</strong> Let me confirm my report by email') %]</h3> [% END %] [% END %] diff --git a/templates/web/base/report/form/user_loggedout_password.html b/templates/web/base/report/form/user_loggedout_password.html index 40a028b24..4b8611fcb 100644 --- a/templates/web/base/report/form/user_loggedout_password.html +++ b/templates/web/base/report/form/user_loggedout_password.html @@ -1,7 +1,7 @@ <!-- user_loggedout_password.html --> <div id="form_sign_in_yes" class="form-box hidden-js js-new-report-sign-in-shown"> - <h5 class="hidden-js">[% loc('<strong>Yes</strong> I have a password') %]</h5> + <h3 class="hidden-js">[% loc('<strong>Yes</strong> I have a password') %]</h3> <p class="hidden-nojs"> [% loc('No account?') %] diff --git a/templates/web/base/report/new/fill_in_details_form.html b/templates/web/base/report/new/fill_in_details_form.html index c9bb2bf87..448941647 100644 --- a/templates/web/base/report/new/fill_in_details_form.html +++ b/templates/web/base/report/new/fill_in_details_form.html @@ -1,4 +1,4 @@ -<h1>[% loc('Report your problem') %]</h1> +[% PROCESS 'report/new/form_heading.html' %] <div class="js-new-report-user-hidden"> diff --git a/templates/web/base/report/new/form_after_heading.html b/templates/web/base/report/new/form_after_heading.html new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/templates/web/base/report/new/form_after_heading.html diff --git a/templates/web/base/report/new/form_heading.html b/templates/web/base/report/new/form_heading.html index e69de29bb..bd61baa95 100644 --- a/templates/web/base/report/new/form_heading.html +++ b/templates/web/base/report/new/form_heading.html @@ -0,0 +1 @@ +<h1>[% loc('Report your problem') %]</h1> diff --git a/templates/web/base/report/new/form_report.html b/templates/web/base/report/new/form_report.html index 52133ba68..9f99b86c3 100644 --- a/templates/web/base/report/new/form_report.html +++ b/templates/web/base/report/new/form_report.html @@ -1,7 +1,7 @@ [% SET form_show_category_only = NOT category || field_errors.category || disable_form_message || have_disable_qn_to_answer %] <!-- report/new/form_report.html --> -[% INCLUDE 'report/new/form_heading.html' %] +[% INCLUDE 'report/new/form_after_heading.html' %] [% IF field_errors.bodies %] <p class='form-error'>[% field_errors.bodies %]</p> diff --git a/templates/web/base/report/new/login_success_form.html b/templates/web/base/report/new/login_success_form.html index b9abf2023..22da33265 100644 --- a/templates/web/base/report/new/login_success_form.html +++ b/templates/web/base/report/new/login_success_form.html @@ -1,4 +1,4 @@ -<h1>[% loc('Report your problem') %]</h1> +[% PROCESS 'report/new/form_heading.html' %] <p class='form-success'>[% loc('You have successfully signed in; please check and confirm your details are accurate:') %]</p> diff --git a/templates/web/base/report/new/oauth_email_form.html b/templates/web/base/report/new/oauth_email_form.html index 8e5b9a7ae..a5ca1c290 100644 --- a/templates/web/base/report/new/oauth_email_form.html +++ b/templates/web/base/report/new/oauth_email_form.html @@ -1,4 +1,4 @@ -<h1>[% loc('Report your problem') %]</h1> +[% PROCESS 'report/new/form_heading.html' %] <p class="form-error"> [% loc('Please note your report has <strong>not yet been sent</strong>.') %] diff --git a/templates/web/buckinghamshire/report/new/form_heading.html b/templates/web/buckinghamshire/report/new/form_after_heading.html index 81bff156a..81bff156a 100644 --- a/templates/web/buckinghamshire/report/new/form_heading.html +++ b/templates/web/buckinghamshire/report/new/form_after_heading.html diff --git a/templates/web/oxfordshire/report/new/form_heading.html b/templates/web/oxfordshire/report/new/form_after_heading.html index a561c7efb..a561c7efb 100644 --- a/templates/web/oxfordshire/report/new/form_heading.html +++ b/templates/web/oxfordshire/report/new/form_after_heading.html diff --git a/templates/web/zurich/report/new/fill_in_details_form.html b/templates/web/zurich/report/new/fill_in_details_form.html index 17e308f07..4c266bbad 100644 --- a/templates/web/zurich/report/new/fill_in_details_form.html +++ b/templates/web/zurich/report/new/fill_in_details_form.html @@ -7,7 +7,7 @@ <fieldset> <div id="problem_form"> - [% INCLUDE 'report/new/form_heading.html' %] + [% INCLUDE 'report/new/form_after_heading.html' %] [% IF field_errors.bodies %] diff --git a/web/cobrands/bromley/base.scss b/web/cobrands/bromley/base.scss index b2492d928..0f316b955 100644 --- a/web/cobrands/bromley/base.scss +++ b/web/cobrands/bromley/base.scss @@ -243,6 +243,12 @@ input.field, input.text, -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; + + #postcodeForm & { + margin: 0; + height: auto; + line-height: 1; + } } // Bromley's silly A-Z menu diff --git a/web/cobrands/fixmystreet.com/layout.scss b/web/cobrands/fixmystreet.com/layout.scss index 5ab22c081..f6d7c9096 100644 --- a/web/cobrands/fixmystreet.com/layout.scss +++ b/web/cobrands/fixmystreet.com/layout.scss @@ -140,7 +140,6 @@ body.fullwidthpage { color: #777; font-size: 0.9em; height: 2.6em; - width: 20em; &:focus { outline: 0; } @@ -148,7 +147,6 @@ body.fullwidthpage { input#sub { font-size: 1.1em; height: 2.4em; - width: 3.5em; font-family: $body-font; font-weight: bold; } diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index 8bcb71a3a..24b8a6d0f 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -809,19 +809,14 @@ $.extend(fixmystreet.set_up, { }, map_controls: function() { - //add permalink on desktop, force hide on mobile //add links container (if its not there) if (fixmystreet.cobrand != 'zurich') { if ($('#sub_map_links').length === 0) { $('<p class="sub-map-links" id="sub_map_links" />').insertAfter($('#map')); } - if ($('#map_permalink').length === 0) { - $('#sub_map_links').append('<a href="#" id="map_permalink">' + translation_strings.permalink + '</a>'); - } } if ($('.mobile').length) { - $('#map_permalink').addClass('hidden'); // Make sure we end up with one Get updates link if ($('#key-tools a.js-feed').length) { $('#sub_map_links a.js-feed').remove(); diff --git a/web/cobrands/oxfordshire/base.scss b/web/cobrands/oxfordshire/base.scss index 989c3b19c..999321a7e 100644 --- a/web/cobrands/oxfordshire/base.scss +++ b/web/cobrands/oxfordshire/base.scss @@ -88,28 +88,14 @@ a:not([class]):focus { } div { - display: block; - width: auto; - background: transparent; border: none; font-size: 1.25em; margin-top: 0.5em; max-width: 24em; - @include flex-container(); - input#pc { - display: block; margin: 0 0.5em 0 0; - padding: 0.5em; - } - - input#sub { - padding-top: 0.6em; - padding-bottom: 0.5em; - width: auto; - height: auto; } } } diff --git a/web/cobrands/oxfordshire/layout.scss b/web/cobrands/oxfordshire/layout.scss index 52b5544ef..1b415903a 100644 --- a/web/cobrands/oxfordshire/layout.scss +++ b/web/cobrands/oxfordshire/layout.scss @@ -117,28 +117,16 @@ $mappage-header-height: 10em; overflow: visible; div { - display: block; width: auto; max-width: 38em; margin: 0.75em 0 0 0; - overflow: visible; - - @include flex-container(); input#pc { - display: block; - margin: 0 0.5em 0 0; - padding: 0.5em; - height: auto; - width: 100%; max-width: 80%; } input#sub { padding: 0.6em 1.5em; - width: auto; - height: auto; - text-transform: none; } } } diff --git a/web/cobrands/sass/_base.scss b/web/cobrands/sass/_base.scss index 2d67b3986..4cdb483ae 100644 --- a/web/cobrands/sass/_base.scss +++ b/web/cobrands/sass/_base.scss @@ -13,7 +13,7 @@ $link-hover-text-decoration: underline !default; $itemlist_item_background: #f6f6f6 !default; $itemlist_item_background_hover: #e6e6e6 !default; -$col_big_numbers: #ccc !default; +$col_big_numbers: #666 !default; $col_fixed_label: #00BD08 !default; $col_fixed_label_light: mix($col_fixed_label, #fff, 10%) !default; @@ -442,7 +442,7 @@ small#or:after { margin: 0 0 0.5em; } - h5 { + h3 { margin: 0 0 1em; font-size: 1.125em; font-weight: normal; @@ -489,20 +489,22 @@ small#or:after { .form-txt-submit-box { @include clearfix(); + @include flex-container(); + @include flex-wrap(wrap); input[type=password], input[type=tel], input[type=number], input[type=text], input[type=email] { - width: 65%; - float: $left; + width: auto; + max-width: none; + @include flex(72 0 auto); } input[type=submit] { - float: $right; - width:28%; - margin-#{$right}: 0.25em; - padding-top:0.6em; - padding-bottom:0.5em; + @include flex(28 0 auto); + margin: 0 0.25em 0.5em; + padding-top: 0.6em; + padding-bottom: 0.5em; } } @@ -1761,11 +1763,6 @@ html.js #map .noscript { background-position: -24px 0; } - #map_permalink:after { - @extend %sub-map-link-icon; - background-position: -48px 0; - } - #fms_shortlist_all:after { @extend %sub-map-link-icon; background-position: -60px 0; @@ -1903,10 +1900,6 @@ html.js #map .noscript { .olControlAttribution img { vertical-align: bottom; } -.olControlPermalink { - bottom: 3px !important; - #{$right}: 3px; -} .olControlDragFeatureFMSOver { cursor: move; cursor: -webkit-grab; @@ -2276,31 +2269,26 @@ label .muted { margin-bottom: 0.5em; } div { - display:table; - width:100%; + @include flex-container; + @include flex-wrap(wrap); + width: 100%; background:#fff; border:1px solid $primary_b; input#pc { - display:table-cell; - margin:0; - padding:0.25em 2%; - width:86%; + @include flex(86 0 auto); + width: 50%; border:none; background:none; line-height:1.5em; } input#sub { - display:table-cell; border:none; - padding:0; - margin:0; - width:14%; - height:35px; + padding: 0.5em; + @include flex(14 0 auto); background:#000; color:#fff; - text-transform:uppercase; @include border-radius(0); - &:hover { + &:hover, &:focus { background:#333; } } diff --git a/web/cobrands/sass/_layout.scss b/web/cobrands/sass/_layout.scss index b27305d31..aafb6656a 100644 --- a/web/cobrands/sass/_layout.scss +++ b/web/cobrands/sass/_layout.scss @@ -11,6 +11,8 @@ $mappage-actions-width--medium: 20em; $header-top-border-width: 0.25em !default; $header-top-border: $header-top-border-width solid $primary !default; +$container-max-width: 60em !default; + .internal-link-fixed-header { display: block; position: relative; @@ -824,7 +826,7 @@ textarea.form-error { margin: 0; padding: 1em; #front-main-container { - max-width: 60em; + max-width: $container-max-width; margin: 0 auto; } h2 { @@ -845,24 +847,8 @@ textarea.form-error { margin-top: -0.25em; } div { - display:block; margin:0 auto; width:20em; - overflow:hidden; - input#pc { - display:block; - float: $left; - padding:0.25em 0.5em; - height:2em; - width:17em; - } - input#sub { - display:block; - float: $right; - width:3em; - height:2.3em; - padding-top:0.2em; - } } } a { diff --git a/web/cobrands/warwickshire/base.scss b/web/cobrands/warwickshire/base.scss index d3560e0a4..224346195 100644 --- a/web/cobrands/warwickshire/base.scss +++ b/web/cobrands/warwickshire/base.scss @@ -32,23 +32,14 @@ background: transparent; div { - display: block; - width: auto; background: #fff; border: none; margin-top: 0.5em; max-width: 24em; - - @include flex-container(); - @include flex-align(stretch); - box-shadow: 0 0.1em 0.2em rgba(0, 0, 0, 0.2); input#pc { - display: block; - margin: 0; - padding: 0.5em; font-family: inherit; color: $primary_text; @@ -73,7 +64,8 @@ // or wrap the text content in an element we can hide? text-indent: -9000px; - &:hover { + &:hover, + &:focus { background-color: $primary; @include svg-background-image('/cobrands/warwickshire/images/search'); background-repeat: no-repeat; @@ -81,10 +73,8 @@ background-size: 20px 20px; } - // TODO: Because of our text-indent, this draws a - // gigantic yellow box off the screen!!! &:focus { - outline: 3px solid $warwickshire-yellow; + background-color: $warwickshire-yellow; } } } diff --git a/web/cobrands/warwickshire/layout.scss b/web/cobrands/warwickshire/layout.scss index cf98ba32a..ac360f16d 100644 --- a/web/cobrands/warwickshire/layout.scss +++ b/web/cobrands/warwickshire/layout.scss @@ -33,22 +33,9 @@ max-width: 38em; margin-left: 0; margin-right: 0; - overflow: visible; - - @include flex-container(); input#pc { - width: 100%; - height: auto; - margin: 0; max-width: none; - padding: 0.5em; - } - - input#sub { - width: 40px; - height: auto; - padding-top: 0; } } diff --git a/web/cobrands/westminster/base.scss b/web/cobrands/westminster/base.scss index 06504be32..c67a67f6d 100644 --- a/web/cobrands/westminster/base.scss +++ b/web/cobrands/westminster/base.scss @@ -50,34 +50,27 @@ body.frontpage { color: inherit; div { - display: block; border: none; background: transparent; position: relative; + background: #fff; + box-shadow: 1px 1px 5px 1px rgba(104, 104, 104, 0.4); input#pc { - display: block; - width: 100%; box-sizing: border-box; padding: 10px 22px; - box-shadow: 1px 1px 5px 1px rgba(104, 104, 104, 0.4); - background: #fff; } input#sub { - position: absolute; - top: 0; - right: 0; - bottom: 0; - display: block; width: 0; - height: auto; padding-left: 50px; overflow: hidden; + @include flex(0 0 auto); background: transparent url(/cobrands/westminster/images/search-icon.png) no-repeat 50% 50%; background-size: 25px 25px; - &:hover { + &:hover, + &:focus { background: transparent url(/cobrands/westminster/images/search-icon.png) no-repeat 50% 50%; background-size: 25px 25px; } diff --git a/web/cobrands/westminster/layout.scss b/web/cobrands/westminster/layout.scss index 7864f37ac..94483a523 100644 --- a/web/cobrands/westminster/layout.scss +++ b/web/cobrands/westminster/layout.scss @@ -28,21 +28,6 @@ div { margin: 0; - overflow: visible; - - input#pc { - float: none; - height: auto; - width: 100%; - padding: 10px 22px; - } - - input#sub { - float: none; - height: auto; - width: 0; - padding-top: 0; - } } } diff --git a/web/js/map-OpenStreetMap.js b/web/js/map-OpenStreetMap.js index 52eb95493..9ed3a2ee3 100644 --- a/web/js/map-OpenStreetMap.js +++ b/web/js/map-OpenStreetMap.js @@ -1,14 +1,10 @@ fixmystreet.maps.config = function() { - var permalink_id; - if ($('#map_permalink').length) { - permalink_id = 'map_permalink'; - } fixmystreet.controls = [ new OpenLayers.Control.ArgParserFMS(), new OpenLayers.Control.Attribution(), //new OpenLayers.Control.LayerSwitcher(), new OpenLayers.Control.Navigation(), - new OpenLayers.Control.PermalinkFMS(permalink_id), + new OpenLayers.Control.PermalinkFMS('map'), new OpenLayers.Control.PanZoomFMS({id: 'fms_pan_zoom' }) ]; }; diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js index 6c9ab8a62..4e01ff58b 100644 --- a/web/js/map-bing-ol.js +++ b/web/js/map-bing-ol.js @@ -1,14 +1,9 @@ fixmystreet.maps.config = function() { - var permalink_id; - if ($('#map_permalink').length) { - permalink_id = 'map_permalink'; - } - fixmystreet.controls = [ new OpenLayers.Control.Attribution(), new OpenLayers.Control.ArgParserFMS(), new OpenLayers.Control.Navigation(), - new OpenLayers.Control.PermalinkFMS(permalink_id), + new OpenLayers.Control.PermalinkFMS('map'), new OpenLayers.Control.PanZoomFMS({id: 'fms_pan_zoom' }) ]; /* Linking back to around from report page, keeping track of map moves */ diff --git a/web/js/map-google-ol.js b/web/js/map-google-ol.js index 4b2d818c9..2769853ce 100644 --- a/web/js/map-google-ol.js +++ b/web/js/map-google-ol.js @@ -17,15 +17,10 @@ $(function(){ }); fixmystreet.maps.config = function() { - var permalink_id; - if ($('#map_permalink').length) { - permalink_id = 'map_permalink'; - } - fixmystreet.controls = [ new OpenLayers.Control.ArgParserFMS(), new OpenLayers.Control.Navigation(), - new OpenLayers.Control.PermalinkFMS(permalink_id), + new OpenLayers.Control.PermalinkFMS('map'), new OpenLayers.Control.PanZoomFMS({id: 'fms_pan_zoom' }) ]; diff --git a/web/js/map-streetview.js b/web/js/map-streetview.js index 4701a7f20..f36b7eaea 100644 --- a/web/js/map-streetview.js +++ b/web/js/map-streetview.js @@ -2,7 +2,7 @@ fixmystreet.maps.config = function() { fixmystreet.controls = [ new OpenLayers.Control.ArgParserFMS(), new OpenLayers.Control.Navigation(), - new OpenLayers.Control.Permalink(), + new OpenLayers.Control.PermalinkFMS('map'), new OpenLayers.Control.PanZoomFMS() ]; fixmystreet.map_type = OpenLayers.Layer.StreetView; diff --git a/web/js/map-toner-lite.js b/web/js/map-toner-lite.js index 0700dbb55..6e44437a0 100644 --- a/web/js/map-toner-lite.js +++ b/web/js/map-toner-lite.js @@ -1,12 +1,8 @@ fixmystreet.maps.config = function() { - var permalink_id; - if ($('#map_permalink').length) { - permalink_id = 'map_permalink'; - } fixmystreet.controls = [ new OpenLayers.Control.ArgParserFMS(), new OpenLayers.Control.Navigation(), - new OpenLayers.Control.PermalinkFMS(permalink_id), + new OpenLayers.Control.PermalinkFMS('map'), new OpenLayers.Control.PanZoomFMS({id: 'fms_pan_zoom' }) ]; fixmystreet.layer_options = [ { diff --git a/web/js/map-wmts-bristol.js b/web/js/map-wmts-bristol.js index 88db20c52..757f347df 100644 --- a/web/js/map-wmts-bristol.js +++ b/web/js/map-wmts-bristol.js @@ -98,15 +98,10 @@ fixmystreet.maps.matrix_ids = [ * to setup the way the map should operate. */ fixmystreet.maps.config = function() { - var permalink_id; - if ($('#map_permalink').length) { - permalink_id = 'map_permalink'; - } - fixmystreet.controls = [ new OpenLayers.Control.ArgParserFMS(), new OpenLayers.Control.Navigation(), - new OpenLayers.Control.PermalinkFMS(permalink_id) + new OpenLayers.Control.PermalinkFMS('map') ]; if ( fixmystreet.page != 'report' || !$('html').hasClass('mobile') ) { fixmystreet.controls.push( new OpenLayers.Control.PanZoomFMS({id: 'fms_pan_zoom' }) ); diff --git a/web/js/map-wmts-buckinghamshire.js b/web/js/map-wmts-buckinghamshire.js index bb76a800b..ee5ac8753 100644 --- a/web/js/map-wmts-buckinghamshire.js +++ b/web/js/map-wmts-buckinghamshire.js @@ -115,15 +115,10 @@ fixmystreet.maps.matrix_ids = [ * to setup the way the map should operate. */ fixmystreet.maps.config = function() { - var permalink_id; - if ($('#map_permalink').length) { - permalink_id = 'map_permalink'; - } - fixmystreet.controls = [ new OpenLayers.Control.ArgParserFMS(), new OpenLayers.Control.Navigation(), - new OpenLayers.Control.PermalinkFMS(permalink_id), + new OpenLayers.Control.PermalinkFMS('map'), new OpenLayers.Control.PanZoomFMS({id: 'fms_pan_zoom' }) ]; diff --git a/web/js/map-wmts-hounslow.js b/web/js/map-wmts-hounslow.js index ea414a3d8..1f8927b3f 100644 --- a/web/js/map-wmts-hounslow.js +++ b/web/js/map-wmts-hounslow.js @@ -162,15 +162,10 @@ fixmystreet.maps.matrix_ids = [ * to setup the way the map should operate. */ fixmystreet.maps.config = function() { - var permalink_id; - if ($('#map_permalink').length) { - permalink_id = 'map_permalink'; - } - fixmystreet.controls = [ new OpenLayers.Control.ArgParserFMS(), new OpenLayers.Control.Navigation(), - new OpenLayers.Control.PermalinkFMS(permalink_id), + new OpenLayers.Control.PermalinkFMS('map'), new OpenLayers.Control.PanZoomFMS({id: 'fms_pan_zoom' }) ]; |