From: Anton Khorev Date: Tue, 9 Apr 2024 12:19:33 +0000 (+0300) Subject: Use avatar.svg on osm web pages X-Git-Tag: live~656^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/33ff4fbd06370033c183cba82f824936a413a001 Use avatar.svg on osm web pages --- diff --git a/app/helpers/user_helper.rb b/app/helpers/user_helper.rb index cf2d40da5..6884fba4d 100644 --- a/app/helpers/user_helper.rb +++ b/app/helpers/user_helper.rb @@ -10,7 +10,7 @@ module UserHelper elsif user.avatar.attached? user_avatar_variant_tag(user, { :resize_to_limit => [100, 100] }, options) else - image_tag "avatar_large.png", options.merge(:width => 100, :height => 100) + image_tag "avatar.svg", options.merge(:width => 100, :height => 100) end end @@ -23,7 +23,7 @@ module UserHelper elsif user.avatar.attached? user_avatar_variant_tag(user, { :resize_to_limit => [50, 50] }, options) else - image_tag "avatar_small.png", options.merge(:width => 50, :height => 50) + image_tag "avatar.svg", options.merge(:width => 50, :height => 50) end end @@ -36,7 +36,7 @@ module UserHelper elsif user.avatar.attached? user_avatar_variant_tag(user, { :resize_to_limit => [50, 50] }, options) else - image_tag "avatar_small.png", options.merge(:width => 50, :height => 50) + image_tag "avatar.svg", options.merge(:width => 50, :height => 50) end end @@ -46,7 +46,7 @@ module UserHelper elsif user.avatar.attached? polymorphic_url(user_avatar_variant(user, :resize_to_limit => [100, 100]), :host => Settings.server_url) else - image_url("avatar_large.png") + image_url("avatar.svg") end end diff --git a/test/helpers/user_helper_test.rb b/test/helpers/user_helper_test.rb index e72887798..0729ac7f6 100644 --- a/test/helpers/user_helper_test.rb +++ b/test/helpers/user_helper_test.rb @@ -8,10 +8,10 @@ class UserHelperTest < ActionView::TestCase gravatar_user = create(:user, :image_use_gravatar => true) image = user_image(user) - assert_match %r{^$}, image + assert_match %r{^$}, image image = user_image(user, :class => "foo") - assert_match %r{^$}, image + assert_match %r{^$}, image image = user_image(gravatar_user) assert_match %r{^$}, image @@ -24,10 +24,10 @@ class UserHelperTest < ActionView::TestCase gravatar_user = create(:user, :image_use_gravatar => true) image = user_thumbnail(user) - assert_match %r{^$}, image + assert_match %r{^$}, image image = user_thumbnail(user, :class => "foo") - assert_match %r{^$}, image + assert_match %r{^$}, image image = user_thumbnail(gravatar_user) assert_match %r{^$}, image @@ -41,10 +41,10 @@ class UserHelperTest < ActionView::TestCase gravatar_user = create(:user, :image_use_gravatar => true) image = user_thumbnail_tiny(user) - assert_match %r{^$}, image + assert_match %r{^$}, image image = user_thumbnail_tiny(user, :class => "foo") - assert_match %r{^$}, image + assert_match %r{^$}, image image = user_thumbnail_tiny(gravatar_user) assert_match %r{^$}, image