<!--!  Copyright (C) 2007-2014 Edgewall Software

  This software is licensed as described in the file COPYING, which
  you should have received as part of this distribution. The terms
  are also available at http://trac.edgewall.com/license.html.

  This software consists of voluntary contributions made by many
  individuals. For the exact contribution history, see the revision
  history and logs, available at http://trac.edgewall.org/.

Template for generating rows corresponding to directory entries
-->
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude" py:strip="">
  <py:for each="idx, entry in enumerate(dir.entries)"
          py:with="change = dir.changes[entry.created_rev];
                   chgset_context = change and context.child('changeset', change.rev, parent=repos.resource);
                   chgset_view = change and change.is_viewable(perm);
                   isdir = entry.kind == 'dir'">
    <tr class="${'odd' if idx % 2 else 'even'}">
      <td class="name">
        <a class="$entry.kind" title="${_('View Directory') if isdir else _('View File')}"
           href="${href.browser(reponame, entry.path, rev=stickyrev,
                                order=order if order != 'name' else None, desc=desc)}">$entry.name</a>
      </td>
      <td class="size">
        <span title="${_('%(size)s bytes', size=entry.content_length)}">${pretty_size(entry.content_length)}</span>
        <a py:if="entry.raw_href" href="$entry.raw_href" class="${'trac-ziplink' if isdir else 'trac-rawlink'}"
           title="${_('Download as Zip archive') if isdir else _('Download')}">&#8203;</a>
      </td>
      <td class="rev">
        <a title="View Revision Log" href="${href.log(reponame, entry.path, rev=rev)}">${display_rev(entry.created_rev)}</a>
        <a title="View Changeset" class="chgset" href="${href.changeset(change.rev, reponame)}">&nbsp;</a>
      </td>
      <td class="age" style="${chgset_view and dir.timerange and 'border-color: rgb(%s,%s,%s)' %
                               dir.colorize_age(dir.timerange.relative(change.date)) or None}">
        ${pretty_dateinfo(change.date, dateonly=True) if chgset_view else '&ndash;'}
      </td>
      <td class="author">${authorinfo_short(change.author) if chgset_view else '&ndash;'}</td>
      <td class="change" py:choose="">
        <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>
  </py:for>
</html>
