better fix for empty actions list issue
parent
2e95062df8
commit
526044e1da
|
@ -160,6 +160,7 @@ sub genpage ($$$) { #{{{
|
||||||
|
|
||||||
my $template=HTML::Template->new(blind_cache => 1,
|
my $template=HTML::Template->new(blind_cache => 1,
|
||||||
filename => "$config{templatedir}/page.tmpl");
|
filename => "$config{templatedir}/page.tmpl");
|
||||||
|
my $actions=0;
|
||||||
|
|
||||||
if (length $config{cgiurl}) {
|
if (length $config{cgiurl}) {
|
||||||
$template->param(editurl => cgiurl(do => "edit", page => $page));
|
$template->param(editurl => cgiurl(do => "edit", page => $page));
|
||||||
|
@ -167,15 +168,22 @@ sub genpage ($$$) { #{{{
|
||||||
if ($config{rcs}) {
|
if ($config{rcs}) {
|
||||||
$template->param(recentchangesurl => cgiurl(do => "recentchanges"));
|
$template->param(recentchangesurl => cgiurl(do => "recentchanges"));
|
||||||
}
|
}
|
||||||
|
$actions++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (length $config{historyurl}) {
|
if (length $config{historyurl}) {
|
||||||
my $u=$config{historyurl};
|
my $u=$config{historyurl};
|
||||||
$u=~s/\[\[file\]\]/$pagesources{$page}/g;
|
$u=~s/\[\[file\]\]/$pagesources{$page}/g;
|
||||||
$template->param(historyurl => $u);
|
$template->param(historyurl => $u);
|
||||||
|
$actions++;
|
||||||
}
|
}
|
||||||
if ($config{discussion}) {
|
if ($config{discussion}) {
|
||||||
$template->param(discussionlink => htmllink($page, "Discussion", 1, 1));
|
$template->param(discussionlink => htmllink($page, "Discussion", 1, 1));
|
||||||
|
$actions++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($actions) {
|
||||||
|
$template->param(have_actions => 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exists $hooks{pagetemplate}) {
|
if (exists $hooks{pagetemplate}) {
|
||||||
|
|
|
@ -20,31 +20,27 @@
|
||||||
</TMPL_IF>
|
</TMPL_IF>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<TMPL_IF NAME="HAVE_ACTIONS">
|
||||||
<div id="actions">
|
<div id="actions">
|
||||||
<ul>
|
<ul>
|
||||||
<TMPL_IF NAME="EDITURL">
|
<TMPL_IF NAME="EDITURL">
|
||||||
<li><a href="<TMPL_VAR EDITURL>">Edit</a></li>
|
<li><a href="<TMPL_VAR EDITURL>">Edit</a></li>
|
||||||
</TMPL_IF>
|
</TMPL_IF>
|
||||||
|
|
||||||
<TMPL_IF NAME="RECENTCHANGESURL">
|
<TMPL_IF NAME="RECENTCHANGESURL">
|
||||||
<li><a href="<TMPL_VAR RECENTCHANGESURL>">RecentChanges</a></li>
|
<li><a href="<TMPL_VAR RECENTCHANGESURL>">RecentChanges</a></li>
|
||||||
</TMPL_IF>
|
</TMPL_IF>
|
||||||
|
|
||||||
<TMPL_IF NAME="HISTORYURL">
|
<TMPL_IF NAME="HISTORYURL">
|
||||||
<li><a href="<TMPL_VAR HISTORYURL>">History</a></li>
|
<li><a href="<TMPL_VAR HISTORYURL>">History</a></li>
|
||||||
</TMPL_IF>
|
</TMPL_IF>
|
||||||
|
|
||||||
<TMPL_IF NAME="PREFSURL">
|
<TMPL_IF NAME="PREFSURL">
|
||||||
<li><a href="<TMPL_VAR PREFSURL>">Preferences</a></li>
|
<li><a href="<TMPL_VAR PREFSURL>">Preferences</a></li>
|
||||||
</TMPL_IF>
|
</TMPL_IF>
|
||||||
|
|
||||||
<TMPL_IF NAME="DISCUSSIONLINK">
|
<TMPL_IF NAME="DISCUSSIONLINK">
|
||||||
<li><TMPL_VAR DISCUSSIONLINK><br /></li>
|
<li><TMPL_VAR DISCUSSIONLINK><br /></li>
|
||||||
</TMPL_IF>
|
</TMPL_IF>
|
||||||
|
|
||||||
<li></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
</TMPL_IF>
|
||||||
|
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<TMPL_VAR CONTENT>
|
<TMPL_VAR CONTENT>
|
||||||
|
|
Loading…
Reference in New Issue