<tal:def 
  xmlns:i18n="http://xml.zope.org/namespaces/i18n"
  i18n:domain="silva"
  define="
    model request/model;
    view here;
    title model/get_title;
">
<h2 tal:content="python:title or default"
  i18n:translate="">
  Index
</h2>

<table class="silvatable indexer"
  tal:define="indexTitles model/getIndexNames">
  <thead>
    <tr>
      <th class="align-left"
        i18n:translate="">
        Terms
      </th>
      <th class="align-left"
        i18n:translate="">
        Links
      </th>
    </tr>
  </thead>
  <tbody tal:condition="python: len(indexTitles) > 0">
  <tal:loop repeat="indexTitle indexTitles">
  <tal:def define="
    iterate repeat/indexTitle/odd;
    indexEntry python: model.getIndexEntry(indexTitle);
  ">
    <tr tal:attributes="class python: iterate and 'even' or 'odd'">
      <td tal:content="indexTitle">
        Term
      </td>
      <td tal:content="structure python:view.render_links(indexTitle, indexEntry)">
        Link
      </td>
    </tr>
  </tal:def>
  </tal:loop>
  </tbody>
  <tbody tal:condition="python: len(indexTitles) == 0">
    <tr>
      <td colspan="2"
        i18n:translate="">
        No index items listed or found. 
      </td>
    </tr>
  </tbody>
</table>
</tal:def>
