Sha256: 256710851f8276e8d0989c289698fa45ea4c4333541e50b03de15de4740142c5
Contents?: true
Size: 1.55 KB
Versions: 9
Compression:
Stored size: 1.55 KB
Contents
module Actions module Katello module ContentView module Presenters class IncrementalUpdatesPresenter < Helpers::Presenter::Base HUMANIZED_TYPES = { ::Katello::Erratum::CONTENT_TYPE => "Errata", ::Katello::Rpm::CONTENT_TYPE => "Packages", ::Katello::PuppetModule::CONTENT_TYPE => "Puppet Modules" } def humanized_output if action.output[:changed_content] humanized_content else _("Incremental Update incomplete.") end end def humanized_content humanized_lines = [] action.output[:changed_content].each do |output| cvv = ::Katello::ContentViewVersion.find_by(:id => output[:content_view_version][:id]) if cvv humanized_lines << "Content View: #{cvv.content_view.name} version #{cvv.version}" humanized_lines << _("Added Content:") [::Katello::Erratum, ::Katello::Rpm, ::Katello::PuppetModule].each do |content_type| unless output[:added_units][content_type::CONTENT_TYPE].blank? humanized_lines << " #{HUMANIZED_TYPES[content_type::CONTENT_TYPE]}:" humanized_lines += output[:added_units][content_type::CONTENT_TYPE].sort.map { |unit| " #{unit}" } end end humanized_lines << '' end end humanized_lines.join("\n") end end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems