<!--! 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, repos, change, err) in enumerate(repo.repositories)"
              py:with="chgset_context = change and context('changeset', change.rev, parent=repos.resource);
                       chgset_view = change and change.can_view(perm)">
        <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((repos and (repos.reponame,) or (reponame,))[0],
                                       order=(order != 'name' and order or None), desc=desc)}">$reponame</a>
              </b>
            </em>
          </td>
          <td class="size" />
          <td class="rev">
            <py:if test="change and not err">
              <a title="View Revision Log" href="${href.log(repos.reponame)}">${repos.display_rev(change.rev)}</a>
              <a title="View Changeset" class="chgset" href="${href.changeset(change.rev, repos.reponame)}">&nbsp;</a>
            </py:if>
          </td>
          <td class="age" style="${chgset_view and change and repo.timerange and 'border-color: rgb(%s,%s,%s)' %
                                   repo.colorize_age(repo.timerange.relative(change.date)) or None}">
            ${chgset_view and dateinfo(change.date) or '&ndash;'}
          </td>
          <td class="author">${chgset_view and authorinfo_short(change.author) or '&ndash;'}</td>
          <td class="change" py:choose="">
            <py:when test="err"><em py:content="err"></em></py:when>
            <py:when test="chgset_view" py:choose="">
              <py:when test="wiki_format_messages">${wiki_to_oneliner(chgset_context, change.message, shorten=True)}</py:when>
              <py:otherwise>${shorten_line(change.message)}</py:otherwise>
            </py:when>
            <py:otherwise>&ndash;</py:otherwise>
          </td>
        </tr>
        <tr class="${idx % 2 and 'even' or 'odd'}" py:if="repoinfo.description">
          <td class="description" colspan="6">${wiki_to_html(context('source', '/', parent=repos.resource), repoinfo.description)}</td>
        </tr>
      </py:for>
    </tbody>
  </table>
</html>
