ManageIQ/manageiq-ui-classic

View on GitHub
app/presenters/tree_node/vm_or_template.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
module TreeNode
  class VmOrTemplate < Node
    set_attributes(:icon, :icon_background) do
      QuadiconHelper.machine_state(@object.normalized_state).values_at(:fonticon, :background)
    end

    set_attribute(:color, '#fff')

    set_attribute(:tooltip) do
      unless @object.template?
        _("VM: %{name} (Click to view)") % {:name => @object.name}
      end
    end
  end
end