summaryrefslogtreecommitdiff
path: root/ikiwiki
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-03-12 03:29:09 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-03-12 03:29:09 +0000
commitbbabbca9d1943421117a6625fc81c02d5b66def4 (patch)
treea89b0aa695e99726db3079440aaeb5dc69604ef3 /ikiwiki
parent94eab28a86d518c39d8a71accee7b25818e38e63 (diff)
template for recentchanges
Diffstat (limited to 'ikiwiki')
-rwxr-xr-xikiwiki42
1 files changed, 16 insertions, 26 deletions
diff --git a/ikiwiki b/ikiwiki
index 2815a8e1d..5228c45d6 100755
--- a/ikiwiki
+++ b/ikiwiki
@@ -242,7 +242,7 @@ sub backlinks ($) { #{{{
return @links;
} #}}}
-sub parentlinks ($) {
+sub parentlinks ($) { #{{{
my $page=shift;
my @ret;
@@ -259,7 +259,7 @@ sub parentlinks ($) {
$path.="../";
}
return @ret;
-}
+} #}}}
sub indexlink () { #{{{
return "<a href=\"$url\">$wikiname</a>/ ";
@@ -418,7 +418,8 @@ sub rcs_recentchanges ($) { #{{{
$when=concise(ago(time - str2time($3)));
}
elsif ($state eq 'header' && /^\s+[A-Z]\s+\Q$svn_base\E\/(.+)$/) {
- push @pages, pagename($1) if length $1;
+ push @pages, htmllink("", pagename($1), 1)
+ if length $1;
}
elsif ($state eq 'header' && /^$/) {
$state='body';
@@ -588,7 +589,7 @@ sub gen_wrapper ($$) { #{{{
error("$this doesn't seem to be executable");
}
- my @params=($srcdir, $destdir, "--wikiname=$wikiname");
+ my @params=($srcdir, $templatedir, $destdir, "--wikiname=$wikiname");
push @params, "--verbose" if $verbose;
push @params, "--rebuild" if $rebuild;
push @params, "--nosvn" if !$svn;
@@ -655,29 +656,18 @@ EOF
exit 0;
} #}}}
-sub cgi_recentchanges ($) { #{{{
+sub cgi_recentchanges () { #{{{
my $q=shift;
-
-
- my $list="<ul>\n";
- foreach my $change (rcs_recentchanges(100)) {
- $list.="<li>";
- $list.=join(", ", map { htmllink("", $_, 1) } @{$change->{pages}});
- $list.="<br>\n";
- $list.="changed ".$change->{when}." by ".
- htmllink("", $change->{user}, 1).
- ": <i>".$change->{message}."</i>\n";
- $list.="</li>\n";
- }
- $list.="</ul>\n";
-
- print $q->header,
- $q->start_html("RecentChanges"),
- $q->h1(indexlink()." RecentChanges"),
- $list,
- $q->end_form,
- $q->end_html;
+ my $template=HTML::Template->new(
+ filename => "$templatedir/recentchanges.tmpl");
+ $template->param(
+ title => "RecentChanges",
+ indexlink => $url,
+ wikiname => $wikiname,
+ changelog => [rcs_recentchanges(100)],
+ );
+ return $template->output;
} #}}}
sub cgi_signin ($$) { #{{{
@@ -798,7 +788,7 @@ sub cgi () { #{{{
}
if ($do eq 'recentchanges') {
- cgi_recentchanges($q);
+ cgi_recentchanges();
return;
}