[openstreetmap/openstreetmap-website] Unlocateable place now highlighted in red and specified in error message (#1800)

Tom Hughes notifications at github.com
Thu Mar 29 21:13:23 UTC 2018

tomhughes requested changes on this pull request.

> @@ -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'));
+          alert(I18n.t('javascripts.directions.errors.no_place_with_name', {place: endpoint.value}));
+          input.css("background-color", "rgba(255, 0, 0, 0.5)");

Rather than manipulating CSS directly like this please add a new rule to the style sheet that is triggered by a class and then add and remove the class in javascript.

> @@ -2326,6 +2326,7 @@ en:
         no_route: "Couldn't find a route between those two places."
         no_place: "Sorry - couldn't find that place."
+        no_place_with_name: "Sorry - couldn't locate '%{place}'."

Can the old `no_place` translation be removed? or does something else use it still?

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20180329/b1c40a55/attachment.html>

More information about the rails-dev mailing list