<%= job_invocation_chart(job_invocation) %>

<%= _('Target hosts') %>

<% if job_invocation.bookmark.present? %> <%= _('Bookmark') %> <%= job_invocation.bookmark.name %>
<% else %> <%= _('Manual selection') %> <% end %> <%= 'using ' + _(Targeting::TYPES[job_invocation.targeting.targeting_type]) %>
<%= job_invocation.targeting.search_query %>
<%= _('Evaluated at:') %> <%= job_invocation.targeting.resolved_at %>
<% if job_invocation.template_invocations.size > 1 %> <% job_invocation.template_invocations.each do |template_invocation| %> <%= host_counter _(RemoteExecutionProvider.provider_for(template_invocation.template.provider_type)), ForemanTasks::Task::DynflowTask.for_action(Actions::RemoteExecution::RunHostJob).for_resource(template_invocation).uniq.size %> <% end %> <% end %> <%= host_counter(_('Total hosts'), job_invocation.last_task.output['total_count']) if job_invocation.last_task %>

<%= _('Providers and templates') %>

<% job_invocation.template_invocations.each do |template_invocation| %>
<%= template_invocation.template.name %> <%= 'through' %> <%= _(RemoteExecutionProvider.provider_for(template_invocation.template.provider_type)) %>
<% target = template_invocation.targeting.hosts.with_os.first || template_invocation.targeting.hosts.first %> <%= _('Preview for target %s') % target.try(:name) || 'N/A' %> <% renderer = InputTemplateRenderer.new(template_invocation.template, target, template_invocation) %> <% if (preview = renderer.preview) %>
<%= preview %>
<% else %> <%= alert :class => "alert-block alert-danger base in fade has-error", :text => renderer.error_message.html_safe %> <% end %> <% if template_invocation.input_values.present? %> <%= _('following user inputs were provided') %> <% end %> <% end %>