diff options
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_helper.rb | 6 | ||||
-rw-r--r-- | app/helpers/oauth_helper.rb | 11 | ||||
-rw-r--r-- | app/helpers/profile_helper.rb | 6 |
3 files changed, 10 insertions, 13 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8ed6d59c20d..38b5fc4a011 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -174,16 +174,10 @@ module ApplicationHelper Digest::SHA1.hexdigest string end - def authbutton(provider, size = 64) - file_name = "#{provider.to_s.split('_').first}_#{size}.png" - image_tag(image_path("authbuttons/#{file_name}"), alt: "Sign in with #{provider.to_s.titleize}") - end - def simple_sanitize(str) sanitize(str, tags: %w(a span)) end - def body_data_page path = controller.controller_path.split('/') namespace = path.first if path.second diff --git a/app/helpers/oauth_helper.rb b/app/helpers/oauth_helper.rb index 1a0ad17b607..997b91de077 100644 --- a/app/helpers/oauth_helper.rb +++ b/app/helpers/oauth_helper.rb @@ -20,6 +20,15 @@ module OauthHelper def additional_providers enabled_oauth_providers.reject{|provider| provider.to_s.starts_with?('ldap')} end - + + def oauth_image_tag(provider, size = 64) + file_name = "#{provider.to_s.split('_').first}_#{size}.png" + image_tag(image_path("authbuttons/#{file_name}"), alt: "Sign in with #{provider.to_s.titleize}") + end + + def oauth_active?(provider) + current_user.identities.exists?(provider: provider.to_s) + end + extend self end diff --git a/app/helpers/profile_helper.rb b/app/helpers/profile_helper.rb index 9e37e44732a..780c7cd5133 100644 --- a/app/helpers/profile_helper.rb +++ b/app/helpers/profile_helper.rb @@ -1,10 +1,4 @@ module ProfileHelper - def oauth_active_class(provider) - if current_user.identities.exists?(provider: provider.to_s) - 'active' - end - end - def show_profile_username_tab? current_user.can_change_username? end |