/
browse.html
50 lines (48 loc) · 2.47 KB
/
browse.html
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
<%- title = "Browse " _ [author, release, undef].join('/') _ directory.join("/") %>
<strong><big>
<a href="/source/<% base = [author, release].join("/"); base %>"><% [author, release].join(" / ") %></a>
<% FOREACH part IN directory; base = base _ "/" _ part -%>
/ <% UNLESS loop.last %><a href="/source/<% base %>"><% part %></a><% ELSE %><% part %><% END %>
<% END %>
</big></strong><br><br>
<ul class="nav nav-list slidepanel">
<li class="visible-phone search">
<form action="<% IF req.uri.path == '/mirrors'; req.uri.path; ELSE; '/search'; END %>">
<input type="search" placeholder="Search" name="q"><input type="submit" class="hidden">
</form>
</li>
<li class="nav-header">Tools</li>
<li><div><a href="/release/<% author %>/<% release %>/">Release Info</a></div></li>
<li><div><a href="/author/<% author %>/">Author</a></div></li>
<li><div><a href="<% api %>/source/<% base %>">Raw browser</a></div></li>
<li class="nav-header">Info</li>
<li><% count = files.grep(->{this.directory == 'true'}).size; count %> folder<% count != 1 ? "s" : "" %></li>
<li><% count = files.grep(->{this.directory == 'false'}).size; count %> file<% count != 1 ? "s" : "" %></li>
</ul>
<div class="content">
<table class="table table-condensed table-striped file-table tablesorter">
<thead>
<tr>
<th class="name">Name</th>
<th class="documentation">Documentation</th>
<th class="size">Size</th>
<th class="mtime">Last Modified</th>
</tr>
</thead>
<tbody>
<% i = 0; FOREACH file IN files %>
<tr>
<td class="name"><strong sort="<% file.directory == 'true' ? "!" _ file.name : file.name %>"><a href="/source/<% [author, release, file.path].join("/") %>" class="<%
file.directory == 'true' ? 'silk-folder'
: file.mime.match("perl") ? 'silk-page-white-code'
: file.mime.match("x-c") ? 'silk-page-white-c'
: 'silk-page-white'
-%>" title="<% file.path %>"><% file.name %></a></strong></td>
<td class="documentation" class="ellipsis"><strong><a href="/pod/release/<% [author, release, file.path].join("/") %>" title="<% file.path %>"><% file.slop ? file.documentation ? file.documentation : file.name : "" %></a></strong></td>
<td class="size"><span sort="<% file.directory == "false" ? file.${"stat.size"} : 0 %>"><% file.directory == "false" ? file.${"stat.size"} | format_bytes : "" %></td>
<td class="mtime" nowrap="nowrap"><span class="relatize" sort="<% date = file.${"stat.mtime"}.dt_http; date %>"><% date %></span></td>
</tr>
<% END %>
</tbody>
</table>
</div>