Sha256: 226503e5bd3bc78d5bb0870e095ab3cd32d8c66afe8d87f9824343c142a5c789

Contents?: true

Size: 929 Bytes

Versions: 22

Compression:

Stored size: 929 Bytes

Contents

module Katello
  module SubscriptionsHelper
    def subscriptions_product_helper(product_id)
      cp_product = Resources::Candlepin::Product.get(product_id).first
      product = OpenStruct.new cp_product
      product.cp_id = cp_product['id']
      product
    end

    def subscriptions_manifest_link_helper(status, label = nil)
      if status['webAppPrefix']
        if !status['webAppPrefix'].start_with? 'http'
          url = "http://#{status['webAppPrefix']}"
        else
          url = status['webAppPrefix']
        end

        url += '/' unless url.end_with? '/'
        url += status['upstreamId']
        link_to((label.nil? ? url : label), url, :target => '_blank')
      else
        label.nil? ? status['upstreamId'] : label
      end
    end

    def subscriptions_candlepin_status
      Resources::Candlepin::CandlepinPing.ping
    rescue
      {'rulesVersion' => '', 'rulesSource' => ''}
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
katello-3.1.0.1 app/helpers/katello/subscriptions_helper.rb
katello-3.1.0 app/helpers/katello/subscriptions_helper.rb
katello-3.1.0.rc2.1 app/helpers/katello/subscriptions_helper.rb
katello-3.0.2 app/helpers/katello/subscriptions_helper.rb
katello-2.4.5 app/helpers/katello/subscriptions_helper.rb
katello-3.1.0.rc1 app/helpers/katello/subscriptions_helper.rb
katello-3.0.1 app/helpers/katello/subscriptions_helper.rb
katello-2.4.4 app/helpers/katello/subscriptions_helper.rb
katello-3.0.0 app/helpers/katello/subscriptions_helper.rb
katello-2.4.3 app/helpers/katello/subscriptions_helper.rb
katello-3.0.0.rc7 app/helpers/katello/subscriptions_helper.rb
katello-3.0.0.rc5 app/helpers/katello/subscriptions_helper.rb
katello-2.4.2 app/helpers/katello/subscriptions_helper.rb
katello-3.0.0.rc4 app/helpers/katello/subscriptions_helper.rb
katello-3.0.0.rc3 app/helpers/katello/subscriptions_helper.rb
katello-3.0.0.rc2 app/helpers/katello/subscriptions_helper.rb
katello-3.0.0.rc1 app/helpers/katello/subscriptions_helper.rb
katello-2.4.1 app/helpers/katello/subscriptions_helper.rb
katello-2.4.0 app/helpers/katello/subscriptions_helper.rb
katello-2.4.0.rc3 app/helpers/katello/subscriptions_helper.rb