<ul>
  <li>Version: {{hefur_version}}</li>
  <li>Uptime: {{hefur_uptime}}</li>
</ul>

<table class="table table-striped table-condensed" id="torrents-table">
  <thead>
    <tr>
      <th><!-- magnet, torrent, peers --></th>
      <th onClick="sortTbody(this, 'torrents-tbody', sortStr)">info hash</th>
      <th onClick="sortTbody(this, 'torrents-tbody', sortStr)">name</th>
      <th onClick="sortTbody(this, 'torrents-tbody', sortByte)">size</th>
      <th onClick="sortTbody(this, 'torrents-tbody', sortInt)">seeders</th>
      <th onClick="sortTbody(this, 'torrents-tbody', sortInt)">leechers</th>
      <th onClick="sortTbody(this, 'torrents-tbody', sortInt)">completed</th>
    </tr>
  </thead>

  <tbody id="torrents-tbody">

    {{*torrents}}
    <tr>
      <td>
        <a href="magnet:?xt=urn:btih:{{info_sha1|b16}}&amp;dn={{name|u}}{{*tracker_udp}}&amp;tr={{tracker_udp|u}}{{/tracker_udp}}&amp;tr={{tracker_http|u}}"
           title="Magnet link">
          <img src="/img/magnet-icon.gif"/>
        </a>
        {{*show_torrent}}
        <a href="/file/{{name|u}}.torrent?info_hash={{info_sha1|b16}}" title="Torrent">
          <img src="/img/torrent-icon.png"/>
        </a>
        {{/show_torrent}}
        {{*show_peers}}
        <a href="/peers?info_hash={{info_sha1|b16}}" title="List peers">
          <img src="/img/peers.png"/>
        </a>
        {{/show_peers}}
      </td>
      <td>{{info_sha1|b16}}</td>
      <td>{{name}}</td>
      <td>{{length}}</td>
      <td>{{seeders}}</td>
      <td>{{leechers}}</td>
      <td>{{completed}}</td>
    </tr>
    {{/torrents}}

  </tbody>

  <tfoot>
    <tr>
      <td colspan="3" style="text-align: right;"><strong>Total</strong></td>
      <td>{{total_length}}</td>
      <td>{{total_seeders}}</td>
      <td>{{total_leechers}}</td>
      <td>{{total_completed}}</td>
    </tr>
  </tfoot>
</table>

<!-- sort torrents by name -->
<script language="javascript">
  sortTbody2(document.getElementById('torrents-tbody'), 2, sortStr)
</script>
