mason/dhandler (.contact): Slightly reformat trailing-`/' redirect code.
[tgal] / mason / dhandler
index aca88bb..dded49c 100755 (executable)
@@ -67,9 +67,9 @@ Failed to find &lsquo;<% $path |h %>&rsquo;.
 %###-------------------------------------------------------------------------
 <%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;
@@ -110,7 +110,7 @@ Failed to find &lsquo;<% $path |h %>&rsquo;.
 %   for my $size (qw{medthumb}) {
 <div class="gallery <% $size %>">
 %     for my $d (@$dd) {
-  <& .thumbnail, target => $d->name . "/", comment => $d->comment,
+  <& .thumbnail, target => $d->name, comment => $d->comment,
                 img => $tn{$d}, size => $size,
                 caption => $m->interp->apply_escapes($d->name, "h") &>\
 %     }
@@ -146,6 +146,9 @@ Failed to find &lsquo;<% $path |h %>&rsquo;.
        my ($dir, $base, $ext) = split_path $path;
        my $real = join_paths $IMGROOT, $path;
        my $img = TrivGal::Image->new($path);
+
+       if (defined $scale) { $m->redirect($img->scale($scale)); }
+
        my $url = join_paths $IMGURL, $path;
        my $realdir = join_paths $IMGROOT, $dir;
        my $urldir = join_paths $SCRIPTURL, $dir;
@@ -215,6 +218,7 @@ Failed to find &lsquo;<% $path |h %>&rsquo;.
 %
 <%args>
        $path
+       $scale => undef
 </%args>
 </%def>
 %