Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
j_platform / app / helpers / base_helper.rb
Size: Mime:
module BaseHelper
  def get_icon_class_from_social_account_type(type)
    if type.present?
      namespace_parts = type.split('::')

      case namespace_parts[1]
      when "Facebook"
        if namespace_parts[2] && namespace_parts[2] == "Page"
          "facebook-page"
        else
          "facebook"
        end
      when "Google"
        if namespace_parts[2] && namespace_parts[2] == "YoutubeChannel"
          "youtube"
        else
          "google"
        end
      when "TwitterAccount"
        "twitter"
      else
        namespace_parts[1].downcase
      end
    else
      ""
    end
  end

  def sa_css_class(sa)
    sa.type.gsub("SocialAccount::", "").underscore.dasherize.tr('/', '-')
  end

  def queue_is_available?
    (current_project.present? and current_project.project_ticket_list_ids.present?)
  end

  def is_dashboard?
    request.original_url.start_with?(J_FEEDS_HOST) && !(request.path =~ /^[^\?]\w+/)
  end
end