Module: Katello::SubscriptionsHelper

Defined in:
app/helpers/katello/subscriptions_helper.rb

Instance Method Summary collapse

Instance Method Details

#subscriptions_candlepin_statusObject



26
27
28
29
30
# File 'app/helpers/katello/subscriptions_helper.rb', line 26

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


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/helpers/katello/subscriptions_helper.rb', line 10

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

#subscriptions_product_helper(product_id) ⇒ Object



3
4
5
6
7
8
# File 'app/helpers/katello/subscriptions_helper.rb', line 3

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