- foreach my $page (@list) {
- my $file = $pagesources{$page};
- my $type = pagetype($file);
- if (! $raw || ($raw && ! defined $type)) {
- unless ($archive && $quick) {
- # Get the content before populating the
- # template, since getting the content uses
- # the same template if inlines are nested.
- my $content=get_inline_content($page, $params{destpage});
- $template->param(content => $content);
- }
- $template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage}));
- $template->param(title => pagetitle(basename($page)));
- $template->param(ctime => displaytime($pagectime{$page}));
-
- if ($actions) {
- my $file = $pagesources{$page};
- my $type = pagetype($file);
- if ($config{discussion}) {
- my $discussionlink=gettext("discussion");
- if ($page !~ /.*\/\Q$discussionlink\E$/ &&
- (length $config{cgiurl} ||
- exists $links{$page."/".$discussionlink})) {
+ foreach my $page (@list) {
+ my $file = $pagesources{$page};
+ my $type = pagetype($file);
+ if (! $raw || ($raw && ! defined $type)) {
+ unless ($archive && $quick) {
+ # Get the content before populating the
+ # template, since getting the content uses
+ # the same template if inlines are nested.
+ my $content=get_inline_content($page, $params{destpage});
+ $template->param(content => $content);
+ }
+ $template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage}));
+ $template->param(title => pagetitle(basename($page)));
+ $template->param(ctime => displaytime($pagectime{$page}, $params{timeformat}));
+ $template->param(mtime => displaytime($pagemtime{$page}, $params{timeformat}));
+ $template->param(first => 1) if $page eq $list[0];
+ $template->param(last => 1) if $page eq $list[$#list];
+
+ if ($actions) {
+ my $file = $pagesources{$page};
+ my $type = pagetype($file);
+ if ($config{discussion}) {
+ my $discussionlink=gettext("discussion");
+ if ($page !~ /.*\/\Q$discussionlink\E$/ &&
+ (length $config{cgiurl} ||
+ exists $links{$page."/".$discussionlink})) {
+ $template->param(have_actions => 1);
+ $template->param(discussionlink =>
+ htmllink($page,
+ $params{destpage},
+ gettext("Discussion"),
+ noimageinline => 1,
+ forcesubpage => 1));
+ }
+ }
+ if (length $config{cgiurl} && defined $type) {