X-Git-Url: https://git.distorted.org.uk/~mdw/tgal/blobdiff_plain/6ac5dde2c2826f066d96e167f6f1fcdc46d5fab4..784bdf8f1aab63a19724cb60026e78f8f7550ab8:/mason/dhandler diff --git a/mason/dhandler b/mason/dhandler index 4355b7a..de50cd8 100755 --- a/mason/dhandler +++ b/mason/dhandler @@ -67,9 +67,9 @@ Failed to find ‘<% $path |h %>’. %###------------------------------------------------------------------------- <%def .contact>\ <%perl> - unless ($r->path_info =~ m!/$!) { - $m->redirect(join_paths($SCRIPTURL, $path) . "/"); - } + unless ($r->path_info =~ m!/$!) + { $m->redirect(join_paths($SCRIPTURL, $path) . "/"); } + my $real = join_paths $IMGROOT, $path; my $url = join_paths $SCRIPTURL, $path; my ($dd, $ff, $ii) = listdir $real; @@ -82,9 +82,28 @@ Failed to find ‘<% $path |h %>’. urlencode "$SCRIPTURL/$uplink"; } (my $nosl = $path) =~ s!/$!!; + + my $size = "medthumb"; + my %tn; + for my $f (@$ff) + { $tn{$f} = TrivGal::Image->new($path . $f->name)->scale($size); } + for my $d (@$dd) { + my $p = join_paths $path, $d->name; + DIR: for (;;) { + my ($ddd, $fff, $iii) = listdir join_paths $IMGROOT, $p; + if (defined $iii) { + my $index = join_paths $p, $iii->name; + $tn{$d} = TrivGal::Image->new($index)->scale($size); + last DIR; + } + if (!@$ddd) { $tn{$d} = undef; last DIR; } + $p = join_paths $p, $ddd->[0]->name; + } + } % -<&| .html, title => "Folder " . $m->interp->apply_escapes($nosl || "[top]", "h"), +<&| .html, title => + "Folder " . $m->interp->apply_escapes($nosl || "[top]", "h"), head => $links &> <& .breadcrumbs, what => "Folder", path => $path &> % @@ -97,26 +116,22 @@ Failed to find ‘<% $path |h %>’. % % if (@$dd) {

Subfolders

-