Module: ForemanVirtWhoConfigure::CompatibilityHelper

Extended by:
ActiveSupport::Concern
Defined in:
app/helpers/foreman_virt_who_configure/compatibility_helper.rb

Instance Method Summary collapse

Instance Method Details

#help_button_or_pathObject



13
14
15
16
17
18
19
20
# File 'app/helpers/foreman_virt_who_configure/compatibility_helper.rb', line 13

def help_button_or_path
  if ApplicationHelper.instance_methods.include?(:help_button)
    # help_button does not support plugins
    link_to(_("Help"), { :action => "welcome" }, { :class => 'btn btn-default' })
  else
    help_path
  end
end

#inline_help_popover(message) ⇒ Object



22
23
24
25
26
27
28
29
# File 'app/helpers/foreman_virt_who_configure/compatibility_helper.rb', line 22

def inline_help_popover(message)
  version = Foreman::Version.new
  if version.major.to_i >= 1 && version.minor.to_i >= 15
    { :label_help => message.html_safe }
  else
    { :help_inline => popover('', message).html_safe }
  end
end


5
6
7
8
9
10
11
# File 'app/helpers/foreman_virt_who_configure/compatibility_helper.rb', line 5

def new_config_link(options = {}, html_options = {})
  if ApplicationHelper.instance_methods.include?(:new_link)
    new_link(_("Create Config"), options.merge(:permission => 'create_virt_who_config'), html_options)
  else
    display_link_if_authorized(_("New Config"), hash_for_new_foreman_virt_who_configure_config_path.merge(:permission => 'create_virt_who_config'), html_options)
  end
end