% items = [{ :caption => _('Job invocations'), :url => job_invocations_path },
{ :caption => @template_invocation.job_invocation.description,
:url => job_invocation_path(@template_invocation.job_invocation_id) }]
if @host
items << { :caption => _('Template Invocation for %s') % @host.name }
breadcrumbs(:resource_url => template_invocations_api_job_invocation_path(@template_invocation.job_invocation_id),
:name_field => 'host_name',
:switcher_item_url => template_invocation_path(':id'),
:items => items)
else
breadcrumbs(items: items, switchable: false)
end
%>
<% stylesheet 'foreman_remote_execution/foreman_remote_execution' %>
<% javascript 'foreman_remote_execution/template_invocation' %>
<%= button_group(link_to(_('Back to Job'), job_invocation_path(@template_invocation.job_invocation), :class => 'btn btn-default'),
(link_to(_('Rerun'), rerun_job_invocation_path(@template_invocation.job_invocation, :host_ids => [ @host.id ]), :class => 'btn btn-default') if authorized_for(:permission => :create_job_invocations))) %>
<%= button_group(link_to_function(_('Toggle command'), '$("div.preview").toggle()', :class => 'btn btn-default'),
link_to_function(_('Toggle STDERR'), '$("div.line.stderr").toggle()', :class => 'btn btn-default'),
link_to_function(_('Toggle STDOUT'), '$("div.line.stdout").toggle()', :class => 'btn btn-default'),
link_to_function(_('Toggle DEBUG'), '$("div.line.debug").toggle()', :class => 'btn btn-default')) if @host %>
<%= button_group(template_invocation_task_buttons(@template_invocation_task, @template_invocation.job_invocation)) %>
<% if @host %>
<%= _('Target: ') %><%= link_to(@host.name, host_path(@host)) %>
<%= preview_box(@template_invocation, @host) %>
<% if @error %>
<%= @error %>
<% else %>
<%= link_to_function(_('Scroll to bottom'), '$("html, body").animate({ scrollTop: $(document).height() }, "slow");', :class => 'pull-right scroll-link-bottom') %>
<%= render :partial => 'output_line_set', :collection => normalize_line_sets(@line_sets) %>
<%= link_to_function(_('Scroll to top'), '$("html, body").animate({ scrollTop: 0 }, "slow");', :class => 'pull-right scroll-link-top') %>
<% end %>
<% else %>
<%= _("Could not display data for job invocation.") %>
<% end %>