From: Anton Khorev Date: Fri, 19 Jul 2024 15:34:04 +0000 (+0300) Subject: Move auth provider icons to auth_providers subdirectory X-Git-Tag: live~391^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/80d7fe4cce0b3562a1465b7c278283ef57bb8dcf Move auth provider icons to auth_providers subdirectory --- diff --git a/app/assets/images/facebook.svg b/app/assets/images/auth_providers/facebook.svg similarity index 100% rename from app/assets/images/facebook.svg rename to app/assets/images/auth_providers/facebook.svg diff --git a/app/assets/images/github.svg b/app/assets/images/auth_providers/github.svg similarity index 100% rename from app/assets/images/github.svg rename to app/assets/images/auth_providers/github.svg diff --git a/app/assets/images/google.svg b/app/assets/images/auth_providers/google.svg similarity index 100% rename from app/assets/images/google.svg rename to app/assets/images/auth_providers/google.svg diff --git a/app/assets/images/microsoft.svg b/app/assets/images/auth_providers/microsoft.svg similarity index 100% rename from app/assets/images/microsoft.svg rename to app/assets/images/auth_providers/microsoft.svg diff --git a/app/assets/images/openid.svg b/app/assets/images/auth_providers/openid.svg similarity index 100% rename from app/assets/images/openid.svg rename to app/assets/images/auth_providers/openid.svg diff --git a/app/assets/images/wikipedia.svg b/app/assets/images/auth_providers/wikipedia.svg similarity index 100% rename from app/assets/images/wikipedia.svg rename to app/assets/images/auth_providers/wikipedia.svg diff --git a/app/helpers/user_helper.rb b/app/helpers/user_helper.rb index 5863a9403..0831cde6e 100644 --- a/app/helpers/user_helper.rb +++ b/app/helpers/user_helper.rb @@ -54,7 +54,7 @@ module UserHelper def auth_button(provider, options = {}) link_to( - image_tag("#{provider}.svg", + image_tag("auth_providers/#{provider}.svg", :alt => t("application.auth_providers.#{provider}.alt"), :class => "rounded-1", :size => "36"), @@ -67,7 +67,7 @@ module UserHelper def auth_button_preferred(provider, options = {}) link_to( - image_tag("#{provider}.svg", + image_tag("auth_providers/#{provider}.svg", :alt => t("application.auth_providers.#{provider}.alt"), :class => "rounded-1 me-3", :size => "36") + t("application.auth_providers.#{provider}.title"), diff --git a/app/views/application/_auth_providers.html.erb b/app/views/application/_auth_providers.html.erb index 895a42eb0..487256cb0 100644 --- a/app/views/application/_auth_providers.html.erb +++ b/app/views/application/_auth_providers.html.erb @@ -13,7 +13,7 @@
<% Auth.providers.each_value do |provider| %> <% if provider == "openid" %> - <%= button_tag image_tag("openid.svg", + <%= button_tag image_tag("auth_providers/openid.svg", :alt => t(".openid.alt"), :size => "36"), :type => "button", @@ -31,7 +31,7 @@ <%= form_tag(auth_path(:provider => "openid"), :id => "openid_login_form") do %>
<%= hidden_field_tag("referer", params[:referer], :autocomplete => "off") %> diff --git a/test/helpers/user_helper_test.rb b/test/helpers/user_helper_test.rb index c4020dd7f..56f5776ad 100644 --- a/test/helpers/user_helper_test.rb +++ b/test/helpers/user_helper_test.rb @@ -111,7 +111,7 @@ class UserHelperTest < ActionView::TestCase def test_auth_button button = auth_button("google") - img_tag = "\"Google" + img_tag = "\"Google" assert_equal("#{img_tag}", button) end