From: Tom Hughes Date: Mon, 2 Apr 2018 14:41:35 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/pull/1804' X-Git-Tag: live~4181 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/be35dda9c36904779a1f34d417e4d7357b1e4415?hp=65ceb77eabe239a8d755c0e55ef52255510dbdb3 Merge remote-tracking branch 'upstream/pull/1804' --- diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 392183cc6..2b3319f8f 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -54,6 +54,10 @@ OSM.Directions = function (map) { } }); + input.on("keydown", function() { + input.removeClass("error"); + }); + input.on("change", function (e) { awaitingGeocode = true; @@ -87,7 +91,8 @@ OSM.Directions = function (map) { endpoint.awaitingGeocode = false; endpoint.hasGeocode = true; if (json.length === 0) { - alert(I18n.t('javascripts.directions.errors.no_place')); + input.addClass("error"); + alert(I18n.t('javascripts.directions.errors.no_place', {place: endpoint.value})); return; } diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 4353e5e65..0a5d9164e 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -938,6 +938,10 @@ header .search_forms, border-radius: 0 2px 2px 0; } + input.error { + background-color: rgba($red, 0.4); + } + select { /* this next line is to polyfill the vertical alignment of text within a select element, * which is different between firefox and chrome. */ diff --git a/config/locales/en.yml b/config/locales/en.yml index 2aca45255..af33f34f8 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2325,7 +2325,7 @@ en: distance: "Distance" errors: no_route: "Couldn't find a route between those two places." - no_place: "Sorry - couldn't find that place." + no_place: "Sorry - couldn't locate '%{place}'." instructions: continue_without_exit: Continue on %{name} slight_right_without_exit: Slight right onto %{name} @@ -2341,6 +2341,7 @@ en: onramp_right_with_directions: Turn right onto the ramp towards %{directions} onramp_right_with_name_directions: Turn right on the ramp onto %{name}, towards %{directions} onramp_right_without_directions: Turn right onto the ramp + onramp_right: Turn right onto the ramp endofroad_right_without_exit: At the end of the road turn right onto %{name} merge_right_without_exit: Merge right onto %{name} fork_right_without_exit: At the fork turn right onto %{name} @@ -2361,6 +2362,7 @@ en: onramp_left_with_directions: Turn left onto the ramp towards %{directions} onramp_left_with_name_directions: Turn left on the ramp onto %{name}, towards %{directions} onramp_left_without_directions: Turn left onto the ramp + onramp_left: Turn left onto the ramp endofroad_left_without_exit: At the end of the road turn left onto %{name} merge_left_without_exit: Merge left onto %{name} fork_left_without_exit: At the fork turn left onto %{name}