Rather than saving the raw statistics and determining the presentation
later, just work out the presentation early.
We're going to have multiple sizes of thumbnails in contact pages soon,
and determining the presentation for each thumbnail size would be
pointless.
my $size = "medthumb";
my %tn;
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;
my ($ddd, $fff, $iii);
($ddd, $fff, $iii) = listdir join_paths $IMGROOT, $p;
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;
my ($ddd, $fff, $iii);
($ddd, $fff, $iii) = listdir join_paths $IMGROOT, $p;
- $nd{$d} = @$ddd; $nf{$d} = @$fff;
+
+ my $count = "";
+ $count .= scalar(@$ddd) . "/" if @$ddd;
+ $count .= scalar(@$fff) if @$fff;
+ $count{$d} = $count;
+
DIR: for (;;) {
if (defined $iii) {
my $index = join_paths $p, $iii->name;
DIR: for (;;) {
if (defined $iii) {
my $index = join_paths $p, $iii->name;
% if (@$dd) {
<h2>Subfolders</h2>
<div class="gallery <% $size %>">
% if (@$dd) {
<h2>Subfolders</h2>
<div class="gallery <% $size %>">
-% for my $d (@$dd) {
-% my $count = "";
-% $count .= "$nd{$d}/" if $nd{$d};
-% $count .= "$nf{$d}" if $nf{$d};
<& .thumbnail, target => $d->name, comment => $d->comment,
tn => $tn{$d}, size => $size,
caption =>
<& .thumbnail, target => $d->name, comment => $d->comment,
tn => $tn{$d}, size => $size,
caption =>
- $m->interp->apply_escapes($d->name, "h") . " [$count]" &>\
+ $m->interp->apply_escapes($d->name, "h") .
+ " [$count{$d}]" &>\