Module: ForemanTasks::TasksHelper

Defined in:
app/helpers/foreman_tasks/tasks_helper.rb

Instance Method Summary collapse

Instance Method Details

#format_recurring_logic_limit(thing) ⇒ Object



17
18
19
20
21
22
23
# File 'app/helpers/foreman_tasks/tasks_helper.rb', line 17

def format_recurring_logic_limit(thing)
  if thing.nil?
    (:i, N_('Unlimited'))
  else
    thing
  end
end

#format_task_input(task, include_action = false) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/helpers/foreman_tasks/tasks_helper.rb', line 3

def format_task_input(task, include_action = false)
  return '-' unless task
  parts = []
  parts << task.get_humanized(:name) if include_action
  parts << Array(task.get_humanized(:input)).map do |part|
    if part.is_a? Array
      part[1][:text]
    else
      part.to_s
    end
  end.join('; ')
  parts.join(" ")
end