[% PROCESS header %]
[% USE Number.Format %]
[% USE cgi = CGI %]

<div id="jumprev">
  <form action="[% cgi.self_url %]" method="get">
   <div>
    <label for="rev">[%|l%](goto revision)[%END%]</label>
    <input type="text" id="rev" name="rev" value="[% rev %]" size="4" />
   </div>
  </form>
</div>

<div class="title"><a href="[% script %]/[% repos %]/log[% path | uri | html %][% revstr %]">[%|l%](view revision log)[%END%]</a>[% IF at_head %] | <a href="[% script %]/[% repos %]/rss[% path | uri | html %]"><img src="[% base_uri %]/css/trac/feed-icon-16x16.png" width="16" height="16" alt="" align="absmiddle" /> [%|l%](rss)[%END%]</a>[% END %]</div>

[% IF entries.size == 0 %]
<p>[%|l%](no directory entries)[%END%]</p>
[% ELSE %]
<table class="listing" id="dirlist" summary="[%|l%](browse listing)[%END%]">
  <thead>
    <tr>
      <th class="name">[%|l%](name)[%END%]</th>
      <th class="rev">[%|l%](revision)[%END%]</th>
      <th class="size">[%|l%](size)[%END%]</th>
      <th class="age">[%|l%](age)[%END%]</th>
      <th class="change">[%|l%](last change)[%END%]</th>
    </tr>
  </thead>
  <tbody>
  [% FOREACH entries %]
    <tr class="[% loop.count % 2 ? "even" : "odd" %]">
      <td class="name">
      [% IF isdir %]
        <a class="dir" href="[% script %]/[% repos %]/browse[% path | uri | html %][% name | uri | html%]/[% revstr %]">[% name %]/</a>
      [% ELSE %]
        <a class="file" href="[% script %]/[% repos %]/view[% path | uri | html%][% name | uri | html %][% revstr %]">[% name %]</a>
      [% END %]
      </td>
      <td class="rev"><a href="[% script %]/[% repos %]/revision?rev=[% rev %]">[% rev %]</a></td>
      <td class="size">[% IF ! isdir; size | format_bytes; END %]</td>
[% quanta = { '60'         => 'second',
              '3600'       => 'minute',
              '86400'      => 'hour',
              '604800'     => 'day',
              '2592000'    => 'week',
              '31536000'    => 'month',
	      '4294967295' => 'year'
 } %]
      <td class="age">
[% FOREACH quantum = quanta.keys.nsort %]
  [% IF loop.last %]
    [% quant_age = age / loop.prev | round(0) %]
    [% LAST %]
  [% END %]
  [% IF age < quantum %]
    [% IF loop.index == 0 %]
      [% quant_age = age %]
    [% ELSE %]
      [% quant_age = age / loop.prev | round(0) %]
    [% END %]
    [% LAST %]
  [% END %]
[% END %][%|l(quant_age)%](%1 [% quanta.$quantum %])[%END%]</td>
      <td class="change"><span class="author">[% author %]:</span> <span class="change">[% msg | truncate(100) | html %]</span></td>
    </tr>
  [% END %]
  </tbody>
</table>
[% END %]

[% IF props.size != 0 %]
<table class="listing" id="proplist">
  <thead>
    <tr>
      <th class="name">[%|l%](prop-name)[%END%]</th>
      <th class="change">[%|l%](prop-value)[%END%]</th>
    </tr>
  </thead>
  <tbody>
  [% FOREACH props %]
    <tr class="[% loop.count % 2 ? "even" : "odd" %]">
      <td class="propname">[% name %]</td>
      <td class="propvalue">[% value | html | html_line_break %]</td>
    </tr>
  [% END %]
  </tbody>
</table>
[% END %]
[% PROCESS footer %]
