{if $playlist}
{include file='playlist.tpl'}
{/if}
<table width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td style="text-align: right;"><form method="post" action="" style="display: inline;"><button title="Export" type="submit" name="exportdemos" class="link"><img src="images/export.gif" alt="export"></button><button title="Refresh" type="submit" name="reloaddemos" class="link"><img src="images/refresh.gif" alt="Refresh"></button></form></td>
  </tr>
</table>
<br />
<table class="content" width="100%" cellspacing="1" cellpadding="1">
  <tr class="cella" style="font-weight: bold;">
    <td width="6%">ID</td>
    <td width="22%">Date / Time</td>
    <td width="61%">Match</td>
    <td width="6%">Maps</td>
    <td width="5%">&nbsp;</td>
  </tr>
  {foreach from=$demos item=demo}
  <tr class="cellb" onmouseover="this.className='cellc'" onmouseout="this.className='cellb'">
    <td><a name="{$demo.id}" href="#{$demo.id}">{$demo.id}</a></td>
    <td>{$demo.time} <span class="grey">({$demo.rec})</span></td>
    <td>{$demo.name}</td>
    <td>{$demo.maps}</td>
    <td style="text-align: center;" nowrap="nowrap">
      {if $player}
        <a href="play.php?demo={$demo.id}&amp;player={$player}"><img src="images/play.gif" alt="play" title="Play this demo on replayer {$player}" /></a>
      {else}
        <a href="play.php?demo={$demo.id}"><img src="images/play.gif" alt="play" title="Play this demo" /></a>
      {/if}
      {if $playlistrep}
        <form method="post" action="" style="display: inline;">
          <input type="hidden" name="replayer" value="{$smarty.get.playlist}" />
          <input type="hidden" name="demo" value="{$demo.id}" />
          <button type="submit" name="addqueue" title="Add to playlist" class="link"><img src="images/playlist_plus.gif" alt="playlist" /></button>
        </form>
      {/if}
    </td>
  </tr>
  {/foreach}
</table>