Sha256: 131299c788177ad89810eedf7af3c93bf71ed36182c25bc5657ab832f294cdb4

Contents?: true

Size: 725 Bytes

Versions: 11

Compression:

Stored size: 725 Bytes

Contents

module ForemanAnsible
  # Small convenience to list all roles in the UI
  module AnsibleRolesHelper
    def ansible_proxy_links(hash, classes = nil)
      SmartProxy.with_features('Ansible').map do |proxy|
        display_link_if_authorized(_('From %s') % proxy.name,
                                   hash.merge(:proxy => proxy),
                                   :class => classes)
      end.flatten
    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

11 entries across 11 versions & 1 rubygems

Version Path
foreman_ansible-2.2.14 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.2.13 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.2.12 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.2.11 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.2.10 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.2.9 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.2.8 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.2.7 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.2.6 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.2.5 app/helpers/foreman_ansible/ansible_roles_helper.rb
foreman_ansible-2.2.4 app/helpers/foreman_ansible/ansible_roles_helper.rb