% unless ($top) { % } % if ($search) { % }
<& gallery/m/crumbs, $path, 1 &>
(newer than a week marked with NEW)\ % if ($search) {
keyword search\ % }
% if (-e 'README') {

<& "${path}README" &>

% }

% if (@right) { % } else { % }
<& gallery/m/column, @left &>
 
<& gallery/m/column, @right &>
 

This page powered by Mason, mod_perl, Perl, the Image::Magick module for the Image Magick library, the Image::Size module, and, of course, Apache. Source is here.

<%init> my ($base, $path, @left, @right, @pics, @dirs, %comments, $dir, $o, $t, $top, $search); $base = $m->current_comp->dir_path; $path = $ENV{REQUEST_URI}; $top = ($base eq '/' || "$base/" eq $path); $dir = $r->lookup_uri($path)->filename; $m->cache->remove($dir) if ($o = $m->cache->get_object($dir)) && ($t = $o->get_created_at) && ($t < (stat($dir))[9] || $t < (stat("$dir/.comments"))[9] || $t < (stat("$dir/README"))[9] || $t < (stat($m->current_comp->source_file))[9]); return if $m->cache_self(key => $dir); %comments = %{$m->comp("gallery/m/comments", $path)}; chdir($dir); opendir(PICS, '.'); for (sort(grep(!/^\./, readdir(PICS)))) { if (-d) { next if $top && $_ eq 'gallery'; push(@dirs, { dir => "$path$_", comment => $comments{$_}, }); } elsif (/\.(gif|jpg|png)$/i) { push(@pics, { pic => "$path$_", comment => $comments{$_}, }); } } closedir(PICS); @right = (@dirs, @pics); @left = splice(@right, 0, @right/2 + 0.5); $search = $m->comp('gallery/m/config')->{search_dbi_args};