mason/dhandler (.contact): Strip out the multiple-size machinery.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 11 Jun 2023 17:07:08 +0000 (18:07 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 12 Jun 2023 10:48:39 +0000 (11:48 +0100)
Also, use the same size consistently throughout.

mason/dhandler

index 38a460d..979419d 100755 (executable)
@@ -83,6 +83,7 @@ Failed to find &lsquo;<% $path |h %>&rsquo;.
        }
        (my $nosl = $path) =~ s!/$!!;
 
+       my $size = "medthumb";
        my %tn;
        for my $f (@$ff)
          { $tn{$f} = TrivGal::Image->new($path . $f->name); }
@@ -108,28 +109,24 @@ Failed to find &lsquo;<% $path |h %>&rsquo;.
 %
 % if (@$dd) {
 <h2>Subfolders</h2>
-%   for my $size (qw{medthumb}) {
 <div class="gallery <% $size %>">
-%     for my $d (@$dd) {
+%   for my $d (@$dd) {
   <& .thumbnail, target => $d->name, comment => $d->comment,
                 img => $tn{$d}, size => $size,
                 caption => $m->interp->apply_escapes($d->name, "h") &>\
-%     }
-</div>
 %   }
+</div>
 % }
 %
 % if (@$ff) {
 <h2>Images</h2>
-%   for my $size (qw{medthumb}) {
 <div class="gallery <% $size %>">
-%     for my $f (@$ff) {
+%   for my $f (@$ff) {
   <& .thumbnail, target => $f->name, comment => $f->comment,
-                img => $tn{$f}, size => "bigthumb",
+                img => $tn{$f}, size => $size,
                 caption => $m->interp->apply_escapes($f->name, "h") &>\
-%     }
-</div>
 %   }
+</div>
 % }
 %
 <div class=fill></div>