<commit_before>module Multiauth
  module ViewsHelper
    def multiauth_box(url = nil)
      url = session_path(resource_name) if !url

      form_for(resource, :as => resource_name, :url => url, :html => {:id => "openid"}) do |f|
        %@<div id="nojsopenid">#{f.text_field(:identity_url, :id => "identity_url")}#{f.submit('Sign in')}</div>@+
        render(:partial => "multiauth/box")
      end
    end

    def multiauth_assets
      javascript_include_tag('multiauth')+
      stylesheet_link_tag('multiauth')
    end

    def multiauth_providers
      providers = Multiauth::PROVIDERS
      if !devise_mapping.oauthable?
        providers.delete("Facebook")
        providers.delete("Github")
      else
        providers.delete("Facebook") if !resource_class.oauth_providers.include?(:facebook)
        providers.delete("Github") if !resource_class.oauth_providers.include?(:github)
      end

      providers
    end
  end
end

::ActionView::Base.send :include, Multiauth::ViewsHelper
<commit_msg>adding support for connecting account<commit_after>module Multiauth
  module ViewsHelper
    def multiauth_box(resource_name, url = nil)
      url = session_path(resource_name) if !url

      form_for(resource_name, :url => url, :html => {:id => "openid"}) do |f|
        %@<div id="nojsopenid">#{f.text_field(:identity_url, :id => "identity_url")}#{f.submit('Sign in')}</div>@+
        render(:partial => "multiauth/box")
      end
    end

    def multiauth_assets
      javascript_include_tag('multiauth')+
      stylesheet_link_tag('multiauth')
    end

    def multiauth_providers
      mapping = request.env["devise.mapping"]
      providers = Multiauth::PROVIDERS
      if mapping && mapping.oauthable?
        providers.delete("Facebook") if !resource_class.oauth_providers.include?(:facebook)
        providers.delete("Github") if !resource_class.oauth_providers.include?(:github)
      else
        providers.delete("Facebook")
        providers.delete("Github")
      end

      if user_signed_in?
        providers["Twitter"][:url] = '/users/connect/twitter'
      end

      providers
    end
  end
end

::ActionView::Base.send :include, Multiauth::ViewsHelper

{'fraction_non_alphanumeric': 0.12987608994951813, 'fraction_numerical': 0.0, 'mean_word_length': 3.4489795918367347, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4095958', 'n_tokens_mistral': 702, 'n_tokens_neox': 697, 'n_words': 127}