X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/501d13e1c0936cc3ba3d9639620517bae34e5784..08a0fc90e371c20b3f78d25dc81440d7eb505a19:/app/views/layouts/_head.html.erb diff --git a/app/views/layouts/_head.html.erb b/app/views/layouts/_head.html.erb index 1c91e68ec..b879d90bd 100644 --- a/app/views/layouts/_head.html.erb +++ b/app/views/layouts/_head.html.erb @@ -32,9 +32,12 @@ I18n.defaultLocale = "<%= I18n.default_locale %>"; I18n.locale = "<%= I18n.locale %>"; I18n.fallbacks = true; - <% if @user and !@user.home_lon.nil? and !@user.home_lat.nil? -%> + <% if @user -%> + OSM.user = <%= @user.id.to_json.html_safe %>; + <% unless @user.home_lon.nil? or @user.home_lat.nil? -%> OSM.home = <%= { :lat => @user.home_lat, :lon => @user.home_lon }.to_json.html_safe %>; <% end -%> + <% end -%> <% if session[:location] -%> OSM.location = <%= session[:location].to_json.html_safe %>; <% end -%>