Sha256: ada34b33d25be58a653c08f99fa6a01c77a1f1cb9972dad7d4a4580eb0a38834

Contents?: true

Size: 1.42 KB

Versions: 171

Compression:

Stored size: 1.42 KB

Contents

module Katello
  module ErrataMailerHelper
    def content_host_errata_path(host)
      "#{Setting[:foreman_url]}/content_hosts/#{host.id}/errata"
    end

    def content_view_environment_errata_path(content_view, environment)
      version = Katello::ContentViewEnvironment.find_by(:content_view_id => content_view.id, :environment_id => environment.id).content_view_version_id
      "#{Setting[:foreman_url]}/content_views/#{content_view.id}/versions/#{version}/errata"
    end

    def content_view_path(content_view)
      "#{Setting[:foreman_url]}/content_views/#{content_view.id}/versions"
    end

    def erratum_path(erratum)
      "#{Setting[:foreman_url]}/errata/#{erratum.id}"
    end

    def repository_erratum_path(repository, type = nil)
      url = "#{Setting[:foreman_url]}/errata?repositoryId=#{repository.id}"
      url += "&search=type%3D#{type}" if type
      url
    end

    def errata_count(host, errata_type)
      available = host.content_facet.installable_errata.send(errata_type.to_sym).count
      applicable = host.content_facet.applicable_errata.send(errata_type.to_sym).count - available
      "#{available} (#{applicable})"
    end

    def format_summary(summary)
      summary.blank? ? summary : summary.gsub(/\n\n/, '<p>').gsub(/\n/, ' ').html_safe
    end

    def host_count(hosts, errata_type)
      hosts.to_a.count { |host| host.content_facet.installable_errata.send(errata_type.to_sym).any? }
    end
  end
end

Version data entries

171 entries across 171 versions & 1 rubygems

Version Path
katello-4.14.2 app/helpers/katello/errata_mailer_helper.rb
katello-4.15.0 app/helpers/katello/errata_mailer_helper.rb
katello-4.15.0.rc2 app/helpers/katello/errata_mailer_helper.rb
katello-4.15.0.rc1 app/helpers/katello/errata_mailer_helper.rb
katello-4.14.1 app/helpers/katello/errata_mailer_helper.rb
katello-4.14.0 app/helpers/katello/errata_mailer_helper.rb
katello-4.14.0.rc3 app/helpers/katello/errata_mailer_helper.rb
katello-4.14.0.rc2 app/helpers/katello/errata_mailer_helper.rb
katello-4.14.0.rc1.1 app/helpers/katello/errata_mailer_helper.rb
katello-4.14.0.rc1 app/helpers/katello/errata_mailer_helper.rb
katello-4.13.1 app/helpers/katello/errata_mailer_helper.rb
katello-4.13.0 app/helpers/katello/errata_mailer_helper.rb
katello-4.12.1 app/helpers/katello/errata_mailer_helper.rb
katello-4.13.0.rc1 app/helpers/katello/errata_mailer_helper.rb
katello-4.12.0 app/helpers/katello/errata_mailer_helper.rb
katello-4.12.0.rc3 app/helpers/katello/errata_mailer_helper.rb
katello-4.12.0.rc2 app/helpers/katello/errata_mailer_helper.rb
katello-4.12.0.rc1 app/helpers/katello/errata_mailer_helper.rb
katello-4.11.1 app/helpers/katello/errata_mailer_helper.rb
katello-4.11.0 app/helpers/katello/errata_mailer_helper.rb