| 
 | 1 | +%% cascade base {  | 
 | 2 | +%% title => 'Browse ' ~ [$author, $release].merge($directory).join('/'),  | 
 | 3 | +%% }  | 
 | 4 | +%% override breadcrumbs -> {  | 
 | 5 | +<div class="breadcrumbs">  | 
 | 6 | + <a href="/source/[% $author %]/[% $release %]">[% $author %] / [% $release %]</a>  | 
 | 7 | + %% for $directory -> $part {  | 
 | 8 | + %% my $link = $base ~ '/' ~ $directory.slice(0, $~part).join('/')  | 
 | 9 | + / [% if $~part.is_last { $part } else { %]<a href="/source/[% $link %]">[% $part %]</a>[% } %]  | 
 | 10 | + %% }  | 
 | 11 | +</div>  | 
 | 12 | +%% }  | 
 | 13 | +%% override left_nav_content -> {  | 
 | 14 | + %% include inc::release_status { maturity => $maturity, banner_class => 'release-banner-source' }  | 
 | 15 | + <li class="nav-header">Tools</li>  | 
 | 16 | + <li><a data-keyboard-shortcut="g d" href="/release/[% $author %]/[% $release %]"><i class="fa fa-fw fa-info-circle black"></i>Release Info</a></li>  | 
 | 17 | + <li><a data-keyboard-shortcut="g a" href="/author/[% $author %]"><i class="fa fa-user fa-fw black"></i>Author</a></li>  | 
 | 18 | + <li><a href="[% $source_host %]/source/[% [$author, $release].merge($directory).join('/') %]"><i class="fa fa-file-text-o fa-fw black"></i>Raw browser</a></li>  | 
 | 19 | + <li class="nav-header">Info</li>  | 
 | 20 | + %% my $folder_count = $files.map(-> $f { $f.directory ? 1 : 0 }).sum();  | 
 | 21 | + %% my $file_count = $files.size() - $folder_count;  | 
 | 22 | + <li>[% pluralize("%d folder(s)", $folder_count) %]</li>  | 
 | 23 | + <li>[% pluralize("%d file(s)", $file_count) %]</li>  | 
 | 24 | +%% }  | 
 | 25 | +%% override content -> {  | 
 | 26 | +<div class="content">  | 
 | 27 | +<table id="metacpan-file-browse" class="table table-condensed table-striped file-table tablesorter">  | 
 | 28 | +<thead>  | 
 | 29 | + <tr>  | 
 | 30 | + <th class="name">Name</th>  | 
 | 31 | + <th class="documentation">Documentation</th>  | 
 | 32 | + <th class="size">Size</th>  | 
 | 33 | + <th class="mtime">Last Modified</th>  | 
 | 34 | + </tr>  | 
 | 35 | +</thead>  | 
 | 36 | +<tbody>  | 
 | 37 | +%% for $files -> $file {  | 
 | 38 | +<tr>  | 
 | 39 | + <td class="name" sort="[% ( $file.directory == 1 ? "!" : '' ) ~ $file.name %]"><a href="/source/[% $author %]/[% $release %]/[% $file.path %]" class="[%  | 
 | 40 | + $file.directory ? 'silk-folder'  | 
 | 41 | + : $file.mime.match("perl") ? 'silk-page-white-code'  | 
 | 42 | + : $file.mime.match("x-c") ? 'silk-page-white-c'  | 
 | 43 | + : 'silk-page-white'  | 
 | 44 | +%]" title="[% $file.path %]">[% $file.name %]</a></td>  | 
 | 45 | + <td class="documentation"><strong><a href="/pod/release/[% $author %]/[% $release %]/[% $file.path %]" title="[% $file.path %]" class="ellipsis">[% $file.slop ? $file.documentation ? $file.documentation : $file.name : "" %]</a></strong></td>  | 
 | 46 | + <!-- [% $file | dump %] -->  | 
 | 47 | + <td class="size" sort="[% $file.directory ? 0 : $file['stat.size'] %]">[% $file.directory ? '' : format_bytes($file['stat.size']) %]</td>  | 
 | 48 | + %% my $date = datetime($file['stat.mtime']).to_http;  | 
 | 49 | + <td class="mtime relatize" nowrap="nowrap" sort="[% $date %]">[% $date %]</td>  | 
 | 50 | +</tr>  | 
 | 51 | +%% }  | 
 | 52 | +</tbody>  | 
 | 53 | +</table>  | 
 | 54 | +</div>  | 
 | 55 | +%% }  | 
0 commit comments