<!--#set global $topmenu="history"#-->
<!--#set global $statpath=".."#-->
<!--#set global $helpsubject="GUI+History"#-->
<!--#include $webdir + "/inc_top.tmpl"#-->

<span class="SubMenu">
	<a href="./purge?session=$session" onclick="return confirm('$T('purgeHistConf').replace("'","`") ');">$T('purgeHist')</a> |
    <!--#if $isverbose#-->
        <a href="./tog_verbose?session=$session">$T('hideDetails')</a>
    <!--#else#-->
        <a href="./tog_verbose?session=$session">$T('showDetails')</a>
    <!--#end if#-->
</span>

<br>
<p>
<strong>$T('sizeHist'): $total_size</strong>
</p>
<% import datetime %>
<!--#if $lines#-->
<table id="historyTable">
    <tr><th></th><th>$T('completed')</th><th>$T('name')</th><th>$T('size')</th><th>$T('status')</th><th></th></tr>
    <!--#set $odd = False#-->
    <!--#for $line in $lines #-->
<%
compl = datetime.datetime.fromtimestamp(float(line['completed'])).strftime('%Y-%m-%d %H:%M:%S')
%>
        <!--#set $odd = not $odd#-->
        <tr class="<!--#if $odd then "odd" else "even"#-->">
        <td><a class="verbosity_link" href="./tog_verbose?session=$session&jobs=$line.nzo_id">
        <!--#if $line.show_details then '-' else '+'#-->
        </a></td>
        <td>$compl</td>
        <td>$line.name<!--#if $line.action_line#--> - $line.action_line<!--#else if $line.fail_message#--> - <span class="fail_message">$line.fail_message</span><!--#end if#--></td>
        <td>$line.size</td><td>$T('post-'+$line.status)</td>
        <td>
			<!--#if not $line.loaded#-->
				<form action="delete" method="get">
				<input type="hidden" value="$line.nzo_id" name="job">
                <input type="hidden" name="session" value="$session">
				<input type="submit" value="$T('button-del')"></form>
			<!--#end if#-->
        </td>
        </tr>
        <!--#if $line.show_details#-->
            <!--#set $oddLine = not False#-->
            <tr class="<!--#if $oddLine then "oddLine" else "evenLine"#-->"><td></td><td></td>
            <td colspan="3"><dl>
            <!--#for $stage in $line.stage_log#-->
                <!--#set $oddLine = not $oddLine#-->
                <dt><b>$T('stage-'+$stage.name.title.lower())</b></dt>
                <!--#for $action in $stage.actions#-->
                     <dd>$action</dd>
                            <!--#end for#-->
                     <br />
            <!--#end for#-->
            <!--#if $line.category#-->
                <dt><b>$T('category')</b></dt>
                <dd>$line.category</dd>
                <br />
            <!--#end if#-->
            <!--#if $line.storage#-->
                <dt><b>$T('msg-path')</b></dt>
                <dd>$line.storage</dd>
                <br />
            <!--#end if#-->
                    </dl>
                    </td>
                    <td></td>
                </tr>
        <!--#end if#-->
    <!--#end for#-->
</table>
<!--#end if#-->

<!--#include $webdir + "/inc_bottom.tmpl"#-->
