Files
nairobi/app/views/devise/_omniauth_form.html.erb
Javi Martín ed2b217a08 Remove duplication in oauth actions
We were writing the same code twice, with the only difference being the
text "Sign up" in the sign_up action, and "Sign in" in the sign_in
action.

Note we're renaming the `omniauth.info_*` I18n keys so we don't need to
add new exceptions to the `ignore_unused` list, and so it's consistent
with all the other keys under the `omniauth` key.
2020-07-27 14:46:20 +02:00

50 lines
1.9 KiB
Plaintext

<% if feature?(:twitter_login) || feature?(:facebook_login) || feature?(:google_login) %>
<div class="row">
<div class="small-12 column">
<div class="margin-bottom">
<strong><%= t("omniauth.info.#{action}") %></strong>
</div>
</div>
<% if feature? :twitter_login %>
<div class="small-12 medium-6 large-4 column end">
<%= link_to t("omniauth.twitter.name"), user_twitter_omniauth_authorize_path,
title: t("omniauth.twitter.#{action}"),
class: "button-twitter button expanded",
method: :post %>
</div>
<% end %>
<% if feature? :facebook_login %>
<div class="small-12 medium-6 large-4 column end">
<%= link_to t("omniauth.facebook.name"), user_facebook_omniauth_authorize_path,
title: t("omniauth.facebook.#{action}"),
class: "button-facebook button expanded",
method: :post %>
</div>
<% end %>
<% if feature? :google_login %>
<div class="small-12 medium-6 large-4 column end">
<%= link_to t("omniauth.google_oauth2.name"), user_google_oauth2_omniauth_authorize_path,
title: t("omniauth.google_oauth2.#{action}"),
class: "button-google button expanded",
method: :post %>
</div>
<% end %>
<% if feature? :wordpress_login %>
<div class="small-12 medium-6 large-4 column end">
<%= link_to t("omniauth.wordpress_oauth2.name"), user_wordpress_oauth2_omniauth_authorize_path,
title: t("omniauth.wordpress_oauth2.#{action}"),
class: "button-wordpress button expanded",
method: :post %>
</div>
<% end %>
<div class="small-12 column auth-divider">
<span><%= t("omniauth.or_fill") %></span>
</div>
</div>
<% end %>