Sha256: b95fb89e6b696a5f1924ac723790251ccd89fb290b570211e93e5b3658bf1192

Contents?: true

Size: 1.05 KB

Versions: 42

Compression:

Stored size: 1.05 KB

Contents

module ForemanVirtWhoConfigure
  module CompatibilityHelper
    extend ActiveSupport::Concern

    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

    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

    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
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
foreman_virt_who_configure-0.5.25 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.24 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.23 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.21 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.20 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.19 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.18 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.17 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.16 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.15 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.14 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.13 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.12 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.11 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.10 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.9 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.8 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.7 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.6 app/helpers/foreman_virt_who_configure/compatibility_helper.rb
foreman_virt_who_configure-0.5.5 app/helpers/foreman_virt_who_configure/compatibility_helper.rb