Module: ForemanRemoteExecution::JobTemplatesExtensions

Extended by:
ActiveSupport::Concern
Defined in:
app/helpers/concerns/foreman_remote_execution/job_templates_extensions.rb

Instance Method Summary collapse

Instance Method Details

#permitted_actions_with_run_button(template) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'app/helpers/concerns/foreman_remote_execution/job_templates_extensions.rb', line 9

def permitted_actions_with_run_button(template)
  original = permitted_actions_without_run_button(template)

  if template.is_a?(JobTemplate)
    original.unshift(display_link_if_authorized(_('Export'), hash_for_export_job_template_path(:id => template.id), 'data-no-turbolink' => true))
    original.unshift(display_link_if_authorized(_('Run'), hash_for_new_job_invocation_path(:template_id => template.id))) unless template.snippet
  end

  original
end