]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/1804'
authorTom Hughes <tom@compton.nu>
Mon, 2 Apr 2018 14:41:35 +0000 (15:41 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 2 Apr 2018 14:41:35 +0000 (15:41 +0100)
app/assets/javascripts/index/directions.js
app/assets/stylesheets/common.scss
config/locales/en.yml

index 392183cc601263ac24eaaac37be189c24b555e25..2b3319f8f35c1e95279b88af763c5b348ac78521 100644 (file)
@@ -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;
         }
 
index 4353e5e659d85628ff9a8f175d291ffdd4465652..0a5d9164e211e3ef5db259c8e0dcb78054919637 100644 (file)
@@ -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. */
index 2aca45255291e4d609731038019d52b31d777686..af33f34f8b97f23c90d78ebaaebf4efacb11ebd7 100644 (file)
@@ -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}