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

index 1a3e0d4ecae558056b2b9867c4ea2ea0fe4b9920..1057fa58d5337077a1401ad7bd864cff355daa22 100644 (file)
@@ -53,6 +53,10 @@ OSM.Directions = function (map) {
       }
     });
 
+    input.on("keydown", function() {
+      input.removeClass("error");
+    });
+
     input.on("change", function (e) {
       awaitingGeocode = true;
       
@@ -86,7 +90,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 4540e74e8b9321fdfd562bf1cd36f9d0f8a02fcc..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}