Sha256: 7bc919c8f6e50548a5c7d2007c4cb204fb7909537a8b750c1ee201cb2574cf35

Contents?: true

Size: 635 Bytes

Versions: 9

Compression:

Stored size: 635 Bytes

Contents

module ForemanInventoryUploadHostHelper
  def hits_counts
    @hits_counts ||= InsightsHit.where(host_id: @hosts).group(:host_id).count
  end

  def hits_counts_cell(host)
    host_hits = hits_counts[host.id]
    content = n_('One recommendation', '%{hits} recommendations', host_hits) % { hits: host_hits } if host_hits
    tag.td class: ['hidden-xs', 'ellipsis'] do
      if host_hits
        link_to(
          content,
          InsightsCloud::WebUi.system_url(InsightsCloud::WebUi::ADVISOR, host.insights.uuid),
          :rel => 'external noopener noreferrer',
          :target => '_blank'
        )
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
foreman_rh_cloud-0.9.12 app/helpers/foreman_inventory_upload_host_helper.rb
foreman_rh_cloud-1.0.12 app/helpers/foreman_inventory_upload_host_helper.rb
foreman_rh_cloud-2.0.12 app/helpers/foreman_inventory_upload_host_helper.rb
foreman_rh_cloud-0.9.11 app/helpers/foreman_inventory_upload_host_helper.rb
foreman_rh_cloud-1.0.11 app/helpers/foreman_inventory_upload_host_helper.rb
foreman_rh_cloud-2.0.11 app/helpers/foreman_inventory_upload_host_helper.rb
foreman_rh_cloud-0.9.10 app/helpers/foreman_inventory_upload_host_helper.rb
foreman_rh_cloud-1.0.10 app/helpers/foreman_inventory_upload_host_helper.rb
foreman_rh_cloud-2.0.10 app/helpers/foreman_inventory_upload_host_helper.rb