From: Tom Hughes Date: Sun, 7 Jul 2024 09:47:56 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/pull/4954' X-Git-Tag: live~923 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/625e7c3296c46141d199a8a0c69822bc1b38ae6a?hp=8ee3d678319062d4f2f27918d3f98d3465d9eb36 Merge remote-tracking branch 'upstream/pull/4954' --- diff --git a/app/assets/images/confirm-illustration.png b/app/assets/images/confirm-illustration.png deleted file mode 100644 index 08a954a45..000000000 Binary files a/app/assets/images/confirm-illustration.png and /dev/null differ diff --git a/app/assets/images/confirm-illustration.svg b/app/assets/images/confirm-illustration.svg index 9bb5715b8..999ac6c16 100644 --- a/app/assets/images/confirm-illustration.svg +++ b/app/assets/images/confirm-illustration.svg @@ -1,1255 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 101010101010100011100010101010011010101010101001010110010111010000011010000101010000110001101010110010101101101010111010101011 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - 101010101010100011100010101010011010101010101001010110010111010101011010000101010000110001101010110010101101101010111010101011 - - - - - - - - - - - - - - - - - - 101010101010100011100010101010011010101010101001010110010111010101011010000101010000110001101010110010101101101010111010101011 - - + diff --git a/app/assets/images/sign-up-illustration.png b/app/assets/images/sign-up-illustration.png deleted file mode 100644 index e785ec602..000000000 Binary files a/app/assets/images/sign-up-illustration.png and /dev/null differ diff --git a/app/assets/images/sign-up-illustration.svg b/app/assets/images/sign-up-illustration.svg index 7f3a3338f..ffa41b9f7 100644 --- a/app/assets/images/sign-up-illustration.svg +++ b/app/assets/images/sign-up-illustration.svg @@ -1,1359 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 101010101010100011100010101010011010101010101001010110010111010000011010000101010000110001101010110010101101101010111010101011 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - 101010101010100011100010101010011010101010101001010110010111010101011010000101010000110001101010110010101101101010111010101011 - - - - - - - - - - - - - - - - - 101010101010100011100010101010011010101010101001010110010111010101011010000101010000110001101010110010101101101010111010101011 - - - - - - - - - + diff --git a/app/assets/images/terms-illustration.png b/app/assets/images/terms-illustration.png deleted file mode 100644 index 7c32f4f30..000000000 Binary files a/app/assets/images/terms-illustration.png and /dev/null differ diff --git a/app/assets/images/terms-illustration.svg b/app/assets/images/terms-illustration.svg index 2bb1aaf99..762c44b6b 100644 --- a/app/assets/images/terms-illustration.svg +++ b/app/assets/images/terms-illustration.svg @@ -1,1620 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 101010101010100011100010101010011010101010101001010110010111010000011010000101010000110001101010110010101101101010111010101011 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 101010101010100011100010101010011010101010101001010110010111010101011010000101010000110001101010110010101101101010111010101011 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - 101010101010100011100010101010011010101010101001010110010111010101011010000101010000110001101010110010101101101010111010101011 - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/app/assets/javascripts/index/contextmenu.js b/app/assets/javascripts/index/contextmenu.js index cac5e6fbf..ffc0eadb7 100644 --- a/app/assets/javascripts/index/contextmenu.js +++ b/app/assets/javascripts/index/contextmenu.js @@ -51,7 +51,7 @@ OSM.initializeContextMenu = function (map) { lat = latlng.lat.toFixed(precision), lng = latlng.lng.toFixed(precision); - OSM.router.route("/search?whereami=1&query=" + encodeURIComponent(lat + "," + lng)); + OSM.router.route("/search?lat=" + encodeURIComponent(lat) + "&lon=" + encodeURIComponent(lng)); } }); diff --git a/app/assets/javascripts/index/search.js b/app/assets/javascripts/index/search.js index 94bb52a1b..2f3882e3a 100644 --- a/app/assets/javascripts/index/search.js +++ b/app/assets/javascripts/index/search.js @@ -33,10 +33,11 @@ OSM.Search = function (map) { $(".describe_location").on("click", function (e) { e.preventDefault(); var center = map.getCenter().wrap(), - precision = OSM.zoomPrecision(map.getZoom()); - OSM.router.route("/search?whereami=1&query=" + encodeURIComponent( - center.lat.toFixed(precision) + "," + center.lng.toFixed(precision) - )); + precision = OSM.zoomPrecision(map.getZoom()), + lat = center.lat.toFixed(precision), + lng = center.lng.toFixed(precision); + + OSM.router.route("/search?lat=" + encodeURIComponent(lat) + "&lon=" + encodeURIComponent(lng)); }); $("#sidebar_content") diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 69e82666f..a1734682e 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -686,7 +686,7 @@ tr.turn { } .header-illustration { - background-position: 0 0; + background-position: right; background-repeat: no-repeat; position: relative; min-height: 200px; @@ -695,16 +695,16 @@ tr.turn { bottom: 0; &.new-user-main { - background-image: image-url("sign-up-illustration.png"); - background-position-x: 50px; + background-image: image-url("sign-up-illustration.svg"); + background-position-x: 70px; } &.confirm-main { - background-image: image-url("confirm-illustration.png"); + background-image: image-url("confirm-illustration.svg"); } &.new-user-terms { - background-image: image-url("terms-illustration.png"); + background-image: image-url("terms-illustration.svg"); } } diff --git a/app/controllers/geocoder_controller.rb b/app/controllers/geocoder_controller.rb index ee3c3479c..8ec0ab6b7 100644 --- a/app/controllers/geocoder_controller.rb +++ b/app/controllers/geocoder_controller.rb @@ -221,7 +221,7 @@ class GeocoderController < ApplicationController elsif latlon = query.match(%r{^([+-]?\d+(\.\d*)?)(?:\s+|\s*[,/]\s*)([+-]?\d+(\.\d*)?)$}) params.merge!(:lat => latlon[1].to_f, :lon => latlon[3].to_f).delete(:query) - params[:latlon_digits] = true unless params[:whereami] + params[:latlon_digits] = true end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index b7c156bd9..0830e51d4 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -262,40 +262,38 @@ class UsersController < ApplicationController private def save_new_user(email_hmac, referer = nil) - if check_signup_allowed(current_user.email) - current_user.data_public = true - current_user.description = "" if current_user.description.nil? - current_user.creation_ip = request.remote_ip - current_user.languages = http_accept_language.user_preferred_languages - current_user.terms_agreed = Time.now.utc - current_user.tou_agreed = Time.now.utc - current_user.terms_seen = true - - if current_user.auth_uid.blank? - current_user.auth_provider = nil - current_user.auth_uid = nil - elsif email_hmac && ActiveSupport::SecurityUtils.secure_compare(email_hmac, UsersController.message_hmac(current_user.email)) - current_user.activate - end + current_user.data_public = true + current_user.description = "" if current_user.description.nil? + current_user.creation_ip = request.remote_ip + current_user.languages = http_accept_language.user_preferred_languages + current_user.terms_agreed = Time.now.utc + current_user.tou_agreed = Time.now.utc + current_user.terms_seen = true + + if current_user.auth_uid.blank? + current_user.auth_provider = nil + current_user.auth_uid = nil + elsif email_hmac && ActiveSupport::SecurityUtils.secure_compare(email_hmac, UsersController.message_hmac(current_user.email)) + current_user.activate + end - if current_user.save - SIGNUP_IP_LIMITER&.update(request.remote_ip) - SIGNUP_EMAIL_LIMITER&.update(canonical_email(current_user.email)) + if current_user.save + SIGNUP_IP_LIMITER&.update(request.remote_ip) + SIGNUP_EMAIL_LIMITER&.update(canonical_email(current_user.email)) - flash[:matomo_goal] = Settings.matomo["goals"]["signup"] if defined?(Settings.matomo) + flash[:matomo_goal] = Settings.matomo["goals"]["signup"] if defined?(Settings.matomo) - referer = welcome_path(welcome_options(referer)) + referer = welcome_path(welcome_options(referer)) - if current_user.status == "active" - successful_login(current_user, referer) - else - session[:pending_user] = current_user.id - UserMailer.signup_confirm(current_user, current_user.generate_token_for(:new_user), referer).deliver_later - redirect_to :controller => :confirmations, :action => :confirm, :display_name => current_user.display_name - end + if current_user.status == "active" + successful_login(current_user, referer) else - render :action => "new", :referer => params[:referer] + session[:pending_user] = current_user.id + UserMailer.signup_confirm(current_user, current_user.generate_token_for(:new_user), referer).deliver_later + redirect_to :controller => :confirmations, :action => :confirm, :display_name => current_user.display_name end + else + render :action => "new", :referer => params[:referer] end end diff --git a/app/views/application/_auth_providers.html.erb b/app/views/application/_auth_providers.html.erb index be921ee9c..66417bca2 100644 --- a/app/views/application/_auth_providers.html.erb +++ b/app/views/application/_auth_providers.html.erb @@ -26,7 +26,7 @@ <% end %> <%= link_to image_tag("openid.svg", - :alt => t("application.auth_providers.openid.title"), + :alt => t("application.auth_providers.openid.alt"), :size => "36"), "#", :id => "openid_open_url", diff --git a/app/views/users/blocked.html.erb b/app/views/users/blocked.html.erb index 378d15fac..a3ef3429b 100644 --- a/app/views/users/blocked.html.erb +++ b/app/views/users/blocked.html.erb @@ -1,7 +1,7 @@ <% content_for :heading_class, "pb-0" %> <% content_for :heading do %>
-