%
% if (@$dd) {
<h2>Subfolders</h2>
-% for my $size (qw{bigthumb}) {
+% for my $size (qw{medthumb}) {
<div class="gallery <% $size %>">
% for my $d (@$dd) {
<& .thumbnail, target => $d->name . "/", comment => $d->comment,
%
% if (@$ff) {
<h2>Images</h2>
-% for my $size (qw{bigthumb}) {
+% for my $size (qw{medthumb}) {
<div class="gallery <% $size %>">
% for my $f (@$ff) {
<& .thumbnail, target => $f->name, comment => $f->comment,
<%perl>
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;
my ($dd, $ff, $ii) = listdir $realdir;
- my $vw = TrivGal::Image->new($path)->scale("view");
+ my $vw = $img->scale("view");
my $fi = undef;
FILE: for (my $i = 0; $i < @$ff; $i++)
</div>
%
% my %img = map { $_ => TrivGal::Image->new($dir . "/" . $_->name) } @$ff;
-% for my $size (qw{bigthumb}) {
+% for my $size (qw{smallthumb medthumb bigthumb}) {
<div class="thumbstrip <% $size %>">
% for my $f (@$ff) {
<& .thumbnail, target => $f->name, img => $img{$f}, size => $size,
%
<%args>
$path
+ $scale => undef
</%args>
</%def>
%
% if (defined $img) { $tn = $img->scale($size); }
% else { $tn = "$STATICURL/folder.svg"; }
% if ($focus) {
- <figure class="thumb <% $size %>" id=focusthumb>
+ <figure class="thumb focusthumb <% $size %>">
<img class="thumb <% $size %>" load=lazy src="<% $tn |u %>">
<figcaption><span class=name><% $caption %></span></figcaption>
% } else {
Trivial Gallery, copyright © 2021 Mark Wooding.
Free software: you can modify it and/or redistribute it under the
terms of the
- <a href="https://www.gnu.org/licenses/agpl-3.0.en.html">GNU Affero
+ <a rel=license href="https://www.gnu.org/licenses/agpl-3.0.en.html">GNU Affero
General Public License version 3</a>.
- Browse or download
- the <a href="https://git.distorted.org.uk/~mdw/tgal/">source code</a>.
+ Browse or download the <a href="<% $SRCURL %>">source code</a>.
</div>
% my $user =
% find_covering_file $IMGROOT, $path, ".tgal-footer.html";
%###-------------------------------------------------------------------------
<%once>
use autodie;
-use Data::Dumper;
use File::stat;
use TrivGal;
elsif (-d $st) { $comp = ".contact"; }
elsif (-f $st) { $comp = ".image"; }
else { $comp = ".not-found"; }
- $m->comp($comp, path => $path);
+ $r->header_out("X-AGPL-Source" => $SRCURL);
+ $m->comp($comp, path => $path, %ARGS);
</%init>
%
%###----- That's all, folks -------------------------------------------------