<%!
    from crab import CrabStatus
    from crab.util.web import abbr
%>
<%inherit file="base.html"/>

<%block name="links">
<a href="/host/${info['host'] | h}">${info['host'] | h}</a>
<a href="/user/${info['user'] | h}">${info['user'] | h}</a>
% if info['crabid'] is not None:
<a href="/job/${id | h}">${info['crabid'] | h}</a>
% else:
<a href="/job/${id | h}">${info['command'] | abbr}</a>
% endif
<span>output</span>
</%block>

<h2>Job Output</h2>

% if next or prev:
<p>
%     if prev:
    <a href="/job/${id | h}/output/${prev | h}"><span class="icon-backward"></span> Previous</a>
%     endif
%     if next:
    <a href="/job/${id | h}/output/${next | h}"><span class="icon-forward"></span> Next</a>
    <a href="/job/${id | h}/output"><span class="icon-fast-forward"></span> Last</a>
%     endif
</p>
% endif

<table>
    <tr>
        <th>Date and Time</th>
        <td>${finish['datetime'] | h}</td>
    </tr>
    <tr>
        <th>Command</th>
        <td>${finish['command'] | h}</td>
    </tr>
    <tr>
        <th>Status</th>
        <td>${CrabStatus.get_name(finish['status']) | h}</td>
    </tr>
    <tr>
        <th>Standard output</th>
        <td><pre>${stdout.strip() | h}</pre></td>
    </tr>
    <tr>
        <th>Standard error</th>
        <td><pre>${stderr.strip() | h}</pre></td>
    </tr>
</table>
