Module: ForemanProxmox::HostsHelperExtensions
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/helpers/concerns/foreman_proxmox/hosts_helper_extensions.rb
Instance Method Summary collapse
- #display_proxmox_if_Authorized(name, options = {}, html_options = {}) ⇒ Object
- #host_title_actions_with_proxmox(*args) ⇒ Object
- #is_authorized(options) ⇒ Object
- #proxmox_url(options) ⇒ Object
Instance Method Details
#display_proxmox_if_Authorized(name, options = {}, html_options = {}) ⇒ Object
20 21 22 23 24 25 26 |
# File 'app/helpers/concerns/foreman_proxmox/hosts_helper_extensions.rb', line 20 def display_proxmox_if_Authorized(name, = {}, = {}) if () link_to(name, proxmox_url(), ) else "" end end |
#host_title_actions_with_proxmox(*args) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'app/helpers/concerns/foreman_proxmox/hosts_helper_extensions.rb', line 11 def host_title_actions_with_proxmox(*args) title_actions( ( display_proxmox_if_Authorized(_("Create VM"), {:controller => 'foreman_proxmox/proxmox', :action => 'create_vm',:id => @host}, :class => 'btn') ) ) host_title_actions_without_proxmox(*args) end |
#is_authorized(options) ⇒ Object
32 33 34 |
# File 'app/helpers/concerns/foreman_proxmox/hosts_helper_extensions.rb', line 32 def () User.current.allowed_to?() end |
#proxmox_url(options) ⇒ Object
28 29 30 |
# File 'app/helpers/concerns/foreman_proxmox/hosts_helper_extensions.rb', line 28 def proxmox_url() ForemanProxmox::Engine.routes.url_for(.merge(:only_path => true, :script_name => proxmox_create_path)) end |