Sha256: 7ca3b776cae403f2163bfd6a3f3ad3d9df9d90ba5d7b8abb9e352a1a9b13ee2d
Contents?: true
Size: 1.27 KB
Versions: 3
Compression:
Stored size: 1.27 KB
Contents
module MuckAuthHelper def auth_list(include_icons, services_to_exclude = nil) list = '' remaining_services(services_to_exclude).each do |auth| list << %Q{<li class="#{auth_css_class(auth)} auth_service service-link" #{auth_icon_back(auth, include_icons)} title="#{auth_title(auth)}">#{auth_link(auth)}</li>} end list.html_safe end def remaining_services(services_to_exclude = nil) services = Secrets.auth_credentials.keys services = services - services_to_exclude.map(&:provider) if services_to_exclude services end def signin_services(services_to_exclude = nil) services = Secrets.auth_credentials services = services.keys.find_all{|key| services[key]['valid_signin']} services = services - services_to_exclude.map(&:provider) if services_to_exclude services end def auth_icon_back(auth, include_icons = true) if include_icons icon = service_icon_background(auth) else icon = '' end end def auth_link(auth) link_to(auth.titleize, "/auth/#{auth}") end def auth_name(auth) auth.titleize end def auth_title(auth) translate('muck.auth.connect_to_account_title', :service => auth.to_s.humanize) end def auth_css_class(auth) auth.parameterize end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
muck-auth-3.5.1 | app/helpers/muck_auth_helper.rb |
muck-auth-3.5.0 | app/helpers/muck_auth_helper.rb |
muck-auth-3.4.0 | app/helpers/muck_auth_helper.rb |