{if $courseCount > 0}
{if $actionInfo != ""}
  <div class="note">
    {$actionInfo}
  </div>
{/if}
<div class="note">
  Zoznam predmetov môžete utriediť podľa <b>Názvu</b>, <b>Kódu</b> alebo <b>Učiteľa</b>.
</div>
<table class="default spacy" width="100%">
  <tr class="head">
    <td>
      <a href="index.php?site=course&amp;action=list&amp;order=name{if $order == "name"}D{/if}">Názov</a>
    </td>
    <td>
      <a href="index.php?site=course&amp;action=list&amp;order=code{if $order == "code"}D{/if}">Kód predmetu</a>
    </td>
    <td>
      <a href="index.php?site=course&amp;action=list&amp;order=teacher{if $order == "teacher"}D{/if}">Učiteľ</a>
    </td>
    <td colspan="3">Akcia</td>
  </tr>
  {foreach from=$courses item=course name=row}  
  <tr id="item{$smarty.foreach.row.index}" class="{if $smarty.foreach.row.index%2 == 0}row1{else}row2{/if}" 
      onmouseover="document.getElementById('item{$smarty.foreach.row.index}').style.background='#feda87'"
      onmouseout="document.getElementById('item{$smarty.foreach.row.index}').style.background='{if $smarty.foreach.row.index%2 == 0}#f8f8f8{else}#e8e8e8{/if}'">  
    <td><b>{$course.name}</b></td>
    <td align="center">{$course.code}</td>
    <td>
      <a href="index.php?site=teacher&amp;action=info&amp;id={$course.teacher.id}">{$course.teacher.namePrefix} 
        {$course.teacher.surname} {$course.teacher.name} {$course.teacher.nameSuffix}</a>
    </td>
    <td class="action">
      <a href="index.php?site=course&amp;action=info&amp;id={$course.id}">[detaily]</a>
    </td>
    <td class="action">
      <a href="index.php?site=course&amp;action=edit&amp;id={$course.id}">[editovať]</a>
    </td>
    <td class="action">
      <a href="index.php?site=course&amp;action=delete&amp;id={$course.id}">[zmazať]</a>
    </td>
  </tr>
  {/foreach}
  <tr class="head">
    <td colspan="6">&nbsp;</td>
  </tr>
</table>
{else}
  <div class="note">
    V databáze zatiaľ nie sú vytvorené žiadne predmety.<br/>
    <br/>
    Nové predmety môžete pridať <a href="index.php?site=course&amp;action=add">manuálne</a>, alebo ich získať 
    <a href="index.php?site=import&amp;action=import_q">importovaním</a>.
  </div>
{/if}
