diff options
-rw-r--r-- | IkiWiki/Render.pm | 10 | ||||
-rw-r--r-- | templates/page.tmpl | 8 |
2 files changed, 11 insertions, 7 deletions
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 51e7a194f..f33d6e66e 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -160,22 +160,30 @@ sub genpage ($$$) { #{{{ my $template=HTML::Template->new(blind_cache => 1, filename => "$config{templatedir}/page.tmpl"); - + my $actions=0; + if (length $config{cgiurl}) { $template->param(editurl => cgiurl(do => "edit", page => $page)); $template->param(prefsurl => cgiurl(do => "prefs")); if ($config{rcs}) { $template->param(recentchangesurl => cgiurl(do => "recentchanges")); } + $actions++; } if (length $config{historyurl}) { my $u=$config{historyurl}; $u=~s/\[\[file\]\]/$pagesources{$page}/g; $template->param(historyurl => $u); + $actions++; } if ($config{discussion}) { $template->param(discussionlink => htmllink($page, "Discussion", 1, 1)); + $actions++; + } + + if ($actions) { + $template->param(have_actions => 1); } if (exists $hooks{pagetemplate}) { diff --git a/templates/page.tmpl b/templates/page.tmpl index 930d173c2..c2430f044 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -20,31 +20,27 @@ </TMPL_IF> </div> +<TMPL_IF NAME="HAVE_ACTIONS"> <div id="actions"> <ul> <TMPL_IF NAME="EDITURL"> <li><a href="<TMPL_VAR EDITURL>">Edit</a></li> </TMPL_IF> - <TMPL_IF NAME="RECENTCHANGESURL"> <li><a href="<TMPL_VAR RECENTCHANGESURL>">RecentChanges</a></li> </TMPL_IF> - <TMPL_IF NAME="HISTORYURL"> <li><a href="<TMPL_VAR HISTORYURL>">History</a></li> </TMPL_IF> - <TMPL_IF NAME="PREFSURL"> <li><a href="<TMPL_VAR PREFSURL>">Preferences</a></li> </TMPL_IF> - <TMPL_IF NAME="DISCUSSIONLINK"> <li><TMPL_VAR DISCUSSIONLINK><br /></li> </TMPL_IF> - -<li></li> </ul> </div> +</TMPL_IF> <div id="content"> <TMPL_VAR CONTENT> |