]> git.openstreetmap.org Git - rails.git/commitdiff
Use official "Log in to Microsoft" icon
authorMilan Cvetkovic <mcvetkovic@microsoft.com>
Fri, 15 Mar 2024 11:06:24 +0000 (11:06 +0000)
committerMilan Cvetkovic <mcvetkovic@microsoft.com>
Fri, 15 Mar 2024 15:34:51 +0000 (15:34 +0000)
Downloaded from https://learn.microsoft.com/en-us/entra/identity-platform/howto-add-branding-in-apps
on 2024-03-15.

app/assets/images/microsoft.svg
app/helpers/user_helper.rb
app/views/sessions/new.html.erb
test/helpers/user_helper_test.rb

index fdc0cbd76383cb999464247d3ce78ca2a3d8b22a..1f739764834586f6940428a24b87510d29425deb 100644 (file)
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><defs><style>.a{fill:#575352;}.b{fill:#f25022;}.c{fill:#7fba00;}.d{fill:#00a4ef;}.e{fill:#ffb900;}</style></defs><rect class="a" width="36" height="36"/><rect class="b" x="4" y="3.99" width="13.31" height="13.31"/><rect class="c" x="18.69" y="3.99" width="13.31" height="13.31"/><rect class="d" x="4" y="18.69" width="13.31" height="13.3"/><rect class="e" x="18.69" y="18.69" width="13.31" height="13.3"/></svg>
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" width="21" height="21" viewBox="0 0 21 21"><title>MS-SymbolLockup</title><rect x="1" y="1" width="9" height="9" fill="#f25022"/><rect x="1" y="11" width="9" height="9" fill="#00a4ef"/><rect x="11" y="1" width="9" height="9" fill="#7fba00"/><rect x="11" y="11" width="9" height="9" fill="#ffb900"/></svg>
\ No newline at end of file
index 3554980b84fc37fa53e7f23f797c2a401f364455..e1ab423a1e4b567b57f6a83c4e5ff072ed6d0d8d 100644 (file)
@@ -58,7 +58,10 @@ module UserHelper
 
   def auth_button(name, provider, options = {})
     link_to(
-      image_tag("#{name}.svg", :alt => t("sessions.new.auth_providers.#{name}.alt"), :class => "rounded-3"),
+      image_tag("#{name}.svg",
+                :alt => t("sessions.new.auth_providers.#{name}.alt"),
+                :class => "rounded-3",
+                :size => "36"),
       auth_path(options.merge(:provider => provider)),
       :method => :post,
       :class => "auth_button",
index f15430efa554627f3b9a9dcf708818a40b6ee656..ffaad054af63f4b89f731415627b08a35e4ad03a 100644 (file)
       <label class="form-label"><%= t ".with external" %></label>
 
       <ul class='list-inline' id="login_auth_buttons">
-        <li class="list-inline-item me-3"><%= link_to image_tag("openid.png", :alt => t(".auth_providers.openid.title")), "#", :id => "openid_open_url", :title => t(".auth_providers.openid.title") %></li>
+        <li class="list-inline-item me-3">
+          <%= link_to image_tag("openid.png",
+                                :alt => t(".auth_providers.openid.title"),
+                                :size => "36"),
+                      "#",
+                      :id => "openid_open_url",
+                      :title => t(".auth_providers.openid.title") %>
+        </li>
+
         <% %w[google facebook microsoft github wikipedia].each do |provider| %>
           <% if Settings.key?("#{provider}_auth_id".to_sym) -%>
             <li class="list-inline-item me-3"><%= auth_button provider, provider %></li>
index 52d3090d02b392220508d28a6c9aab27dbd9f83e..0767dea56c777b135d66666a2a183e1e4bcd9638 100644 (file)
@@ -116,7 +116,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-3\" src=\"/images/google.svg\" />"
+    img_tag = "<img alt=\"Log in with a Google OpenID\" class=\"rounded-3\" src=\"/images/google.svg\" width=\"36\" height=\"36\" />"
     assert_equal("<a class=\"auth_button\" title=\"Log in with Google\" rel=\"nofollow\" data-method=\"post\" href=\"/auth/google\">#{img_tag}</a>", button)
   end