File: browse

package info (click to toggle)
libsvn-web-perl 0.63-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 668 kB
  • ctags: 105
  • sloc: perl: 1,958; sh: 73; makefile: 4
file content (88 lines) | stat: -rw-r--r-- 2,769 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
[% PROCESS header %]
[% USE Number.Format %]

<div id="jumprev">
  <form action="[% c.self_uri | 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>

[% PROCESS _action_menu %]

[% 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="[% c.script %]/[% c.repos | uri %]/browse[% c.path | url %]/[% name | uri | html %][% revstr %]">[% name %]</a>
      [% ELSE %]
        <a class="file" href="[% c.script %]/[% c.repos | uri %]/view[% c.path | url %]/[% name | uri | html %][% revstr %]">[% name %]</a>
      [% END %]
      </td>
      <td class="rev"><a href="[% c.script %]/[% c.repos | uri %]/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 | round(0) %]
    [% 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 %]