Sha256: 5c471eed255eaed3b183f1f5b78294f7abd555ce26f44b0bf0fb5b73891d2281

Contents?: true

Size: 1.21 KB

Versions: 28

Compression:

Stored size: 1.21 KB

Contents

# frozen_string_literal: true

module ForemanBootdisk
  module SubnetsHelperExt
    include BootdiskLinksHelper

    def display_bootdisk_for_subnet(subnet)
      if (proxy = subnet.tftp || subnet.httpboot) && proxy.has_feature?('Templates') && Setting::Bootdisk.allowed_types.include?('subnet')
        display_bootdisk_link_if_authorized(
            _("Subnet generic image"), {
            controller: 'foreman_bootdisk/subnet_disks',
            action: 'subnet',
            id: subnet.id
        },
            class: 'la'
        )
      else
        ''
      end
    end

    def display_bootdisk_title_buttons

      actions = []

      generic_image_link = display_bootdisk_link_if_authorized(
                             _('Generic image'),
                           {
                               controller: 'foreman_bootdisk/disks',
                               action: 'generic'
                             },
                             class: 'la'
                           )

      if Setting::Bootdisk.allowed_types&.include?('generic')
        actions << generic_image_link
        actions << divider
      end

      actions << bootdisk_help_link

      bootdisk_title_action_buttons(actions)
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
foreman_bootdisk-22.0.2 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-22.0.1 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-22.0.0 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-21.0.6 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-21.2.3 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-21.2.2 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-21.0.5 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-21.2.1 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-21.2.0 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-21.1.0 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-19.0.9 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-21.0.4 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-21.0.3 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-19.0.8 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-21.0.2 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-19.0.7 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-21.0.1 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-21.0.0 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-19.0.6 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
foreman_bootdisk-19.0.4.1 app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb