Sha256: 75463ea2153fd4191b38ee5e8efbdbdf2449bea1fee52a417783dcd8f6bfaf4f

Contents?: true

Size: 1.05 KB

Versions: 16

Compression:

Stored size: 1.05 KB

Contents

module ForemanAnsible
  # Small convenience to list all roles in the UI
  module AnsibleRolesHelper
    def ansible_proxy_links(hash, classes = nil)
      links = SmartProxy.with_features('Ansible').map do |proxy|
        display_link_if_authorized(_('From %s') % proxy.name,
                                   hash.merge(:proxy => proxy),
                                   :class => classes)
      end.flatten
      host_text = if links.any?
                    _('From Foreman host')
                  else
                    _('Import from Foreman host')
                  end
      links.unshift display_link_if_authorized(host_text,
                                               hash,
                                               :class => classes)
    end

    def ansible_proxy_import(hash)
      select_action_button(_('Import'),
                           { :primary => true, :class => 'roles-import' },
                           ansible_proxy_links(hash))
    end

    def import_time(role)
      _('%s ago') % time_ago_in_words(role.updated_at)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
foreman_ansible-2.2.3 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.2.2 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.2.1 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.2.0 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.1.2 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.1.1 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.0.4 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.0.3 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.0.2 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-1.5.2 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-1.5.1 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-1.5.0 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.1.0 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.0.1 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.0.0 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-1.4.6 app/helpers/foreman_ansible/ansible_roles_helper.rb