]> git.openstreetmap.org Git - rails.git/commitdiff
style auth buttons using .btn & .btn-light classes
authorEmin Kocan <kocanmn.dev@gmail.com>
Fri, 21 Jun 2024 12:14:54 +0000 (14:14 +0200)
committerEmin Kocan <kocanmn.dev@gmail.com>
Thu, 27 Jun 2024 12:55:28 +0000 (14:55 +0200)
app/helpers/user_helper.rb
app/views/application/_auth_providers.html.erb
test/helpers/user_helper_test.rb

index e2de9934f6a5131150debf676c89265902b13676..bf6b9988b0c9418b92205b09df072f9eb1f39c29 100644 (file)
@@ -64,7 +64,7 @@ module UserHelper
                 :size => "24"),
       auth_path(options.merge(:provider => provider)),
       :method => :post,
                 :size => "24"),
       auth_path(options.merge(:provider => provider)),
       :method => :post,
-      :class => "auth_button p-2 d-block",
+      :class => "auth_button btn btn-light mx-1 p-2 d-block",
       :title => t("application.auth_providers.#{name}.title")
     )
   end
       :title => t("application.auth_providers.#{name}.title")
     )
   end
index 0cbb529a500c70a34be6dc605dcfc3d469328fdc..c3fef47d9608b433dabfce8ac991a2ac240660ac 100644 (file)
@@ -31,7 +31,7 @@
                   "#",
                   :id => "openid_open_url",
                   :title => t("application.auth_providers.openid.title"),
                   "#",
                   :id => "openid_open_url",
                   :title => t("application.auth_providers.openid.title"),
-                  :class => "p-2 d-block" %>
+                  :class => "btn btn-light mx-1 p-2 d-block" %>
 
       <% %w[google facebook microsoft github wikipedia].each do |provider| %>
         <% unless @preferred_auth_provider == provider %>
 
       <% %w[google facebook microsoft github wikipedia].each do |provider| %>
         <% unless @preferred_auth_provider == provider %>
index 3cd53e16996a87bbe17d070d8de7c7908f2ddf22..7d9d558f2e806d4123f3823952b42054594355b8 100644 (file)
@@ -117,7 +117,7 @@ class UserHelperTest < ActionView::TestCase
   def test_auth_button
     button = auth_button("google", "google")
     img_tag = "<img alt=\"Log in with a Google OpenID\" class=\"rounded-1\" src=\"/images/google.svg\" width=\"24\" height=\"24\" />"
   def test_auth_button
     button = auth_button("google", "google")
     img_tag = "<img alt=\"Log in with a Google OpenID\" class=\"rounded-1\" src=\"/images/google.svg\" width=\"24\" height=\"24\" />"
-    assert_equal("<a class=\"auth_button p-2 d-block\" title=\"Log in with Google\" rel=\"nofollow\" data-method=\"post\" href=\"/auth/google\">#{img_tag}</a>", button)
+    assert_equal("<a class=\"auth_button btn btn-light mx-1 p-2 d-block\" title=\"Log in with Google\" rel=\"nofollow\" data-method=\"post\" href=\"/auth/google\">#{img_tag}</a>", button)
   end
 
   private
   end
 
   private