<!--! Template snippet for a table of repositories -->
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:py="http://genshi.edgewall.org/"
    xmlns:xi="http://www.w3.org/2001/XInclude" py:strip="">
  <table class="listing dirlist" id="${repoindex or None}">
    <xi:include href="dirlist_thead.html" />
    <tbody>
      <py:for each="idx, (reponame, repoinfo, change, err) in enumerate(repo.repositories)">
        <tr class="${idx % 2 and 'even' or 'odd'}">
          <td class="name">
            <em py:strip="not err">
              <b py:strip="repoinfo.alias != ''">
                <a class="dir" title="View Root Directory"
                  href="${href.browser(reponame, order=(order != 'name' and order or None), desc=desc)}">$reponame</a>
              </b>
            </em>
          </td>
          <td class="size" />
          <td class="rev">
            <py:if test="not err">
              <a title="View Revision Log" href="${href.log(reponame)}">$change.rev</a>
              <a title="View Changeset" class="chgset" href="${href.changeset(change.rev, reponame)}">&nbsp;</a>
            </py:if>
          </td>
          <td class="age" style="${change and repo.timerange and 'border-color: rgb(%s,%s,%s)' %
            repo.colorize_age(repo.timerange.relative(change.date)) or None}">
            ${change and dateinfo(change.date) or '-'}
          </td>
          <td class="change">
            <span class="author" py:if="change">${authorinfo(change.author)}:</span>
            <span class="change" py:choose="" py:with="chgset_context = context('changeset', (reponame, change.rev))">
              <em py:when="err" py:content="err" />
              <py:when test="not change or 'CHANGESET_VIEW' not in perm(chgset_context.resource)">-</py:when>
              <py:when test="wiki_format_messages">
                ${change and wiki_to_oneliner(chgset_context, change.message, shorten=True)}
              </py:when>
              <py:otherwise>${change and shorten_line(change.message)}</py:otherwise>
            </span>
          </td>
        </tr>
        <tr class="${idx % 2 and 'even' or 'odd'}" py:if="repoinfo.description">
          <td class="description" colspan="4">$repoinfo.description</td>
        </tr>
      </py:for>
    </tbody>
  </table>
</html>
