# External authentication support
- def openid_logo
- image_tag "openid.svg", :size => "36", :alt => t("application.auth_providers.openid_logo_alt"), :class => "align-text-bottom"
- end
-
def auth_button(name, provider, options = {})
link_to(
image_tag("#{name}.svg",
<%# :tabindex starts high to allow rendering at the bottom of the template %>
<%= form_tag(auth_path(:provider => "openid"), :id => "openid_login_form") do %>
<div id="login_openid_url" class="mb-3">
- <label for="openid_url" class="form-label"><%= t ".openid_html", :logo => openid_logo %></label>
+ <label for="openid_url" class="form-label">
+ <%= image_tag "openid.svg", :size => "36", :alt => "", :class => "align-text-bottom" %>
+ <%= t ".openid_url" %>
+ </label>
<%= hidden_field_tag("referer", params[:referer], :autocomplete => "off") %>
<%= text_field_tag("openid_url", "", :tabindex => 20, :autocomplete => "on", :class => "form-control") %>
<span class="form-text text-body-secondary">(<a href="<%= t "accounts.edit.openid.link" %>" target="_new"><%= t "accounts.edit.openid.link text" %></a>)</span>
oauth2_authorizations: OAuth 2 authorizations
muted_users: Muted Users
auth_providers:
- openid_logo_alt: "Log in with an OpenID"
- openid_html: "%{logo} OpenID"
+ openid_url: "OpenID URL"
openid_login_button: "Continue"
openid:
title: Log in with OpenID
assert_match %r{^<img .* width="50" height="50" .* />$}, thumbnail
end
- def test_openid_logo
- logo = openid_logo
- assert_match %r{^<img .* src="/images/openid.svg" .* />$}, logo
- end
-
def test_auth_button
button = auth_button("google", "google")
img_tag = "<img alt=\"Google logo\" class=\"rounded-1\" src=\"/images/google.svg\" width=\"36\" height=\"36\" />"