$def with (torrent_list, label_filters)
$:render.header(_('Torrent list'), 'home')



<table class="torrent_list" border=0 id='torrent_table'>
    <tr>
        $:(sort_head('state', 'S'))
        $:(sort_head('queue', '#'))
        $:(sort_head('name', _('Name')))
        $:(sort_head('total_size', _('Size')))
        $:(sort_head('progress', _('Progress')))
        $:(sort_head('num_seeds', _('Seeders')))
        $:(sort_head('num_peers', _('Peers')))
        $:(sort_head('download_rate', _('Download')))
        $:(sort_head('upload_rate', _('Upload')))
        $:(sort_head('eta', _('Eta')))
        $:(sort_head('distributed_copies', _('Ava')))
        $:(sort_head('ratio', _('Ratio')))
    </tr>
$#4-space indentation is mandatory for for-loops in templetor!
$for torrent in torrent_list:
    <tr class="torrent_table" id="torrent_$torrent.id">
    <td>
        <form action="$base/torrent/$torrent.action/$torrent.id" method="POST" class="pause_resume">
            <input type="image"
            src="$base/pixmaps/$torrent.state.lower()"
            name="pauseresume" value="submit"
            title="$id_to_label(torrent.action)"
            /></form></td>
    <td>$torrent.queue</td>
    <td style="width:100px; overflow:hidden;white-space: nowrap">
        <a href="$base/torrent/info/$torrent.id" >
        $(crop(torrent.name, 40))</a></td>
    <td>$fsize(torrent.total_size)</td>
    <td class="progress_bar">
        <div class="progress_bar_outer">
            <div class="progress_bar" style="width:$(torrent.progress)%">
            $_(torrent.state) $int(torrent.progress) %
            </div>
        </div>
    </td>
    <td>$torrent.num_seeds ($torrent.total_seeds)</td>
    <td>$torrent.num_peers ($torrent.total_peers)</td>
    <td>$fspeed(torrent.download_payload_rate)</td>
    <td>$fspeed(torrent.upload_payload_rate)</td>
    <td>$ftime(torrent.eta)</td>
    <td>$("%.3f" % torrent.distributed_copies)</td>
    <td>$("%.3f" % torrent.ratio)</td\>
    </tr>
</table>



<div class="panel">
$:render.part_button('GET', '/torrent/add', _('Add torrent'), '16/list-add.png')
$:render.part_button('POST', '/pause_all', _('Pause all'), '16/pause.png')
$:render.part_button('POST', '/resume_all', _('Resume all'), '16/start.png')
<!--$:render.part_button('POST', '/logout', _('Logout'), '16/system-log-out.png')-->
</div>

$if label_filters:
    $:render.part_label_filters(label_filters)


$:part_stats()

$:render.footer()

