adds Edit and Discussion links at the end of blog entries.
} else {
$desc = $config{wikiname};
}
+ my $actions=yesno($params{actions});
my @list;
foreach my $page (keys %pagesources) {
$template->param(content => $content);
$template->param(ctime => displaytime($pagectime{$page}));
+ if ($actions) {
+ my $file = $pagesources{$page};
+ my $type = pagetype($file);
+ $template->param(have_actions => 1);
+ if ($config{discussion}) {
+ $template->param(discussionlink => htmllink($page, $page, "Discussion", 1, 1));
+ }
+ if (length $config{cgiurl} && defined $type) {
+ $template->param(editurl => cgiurl(do => "edit", page => $page));
+ }
+ }
+
run_hooks(pagetemplate => sub {
shift->(page => $page, destpage => $params{page},
template => $template,);
display: block;
}
-#actions ul {
+.actions ul {
margin: 0;
padding: 6px;
list-style-type: none;
border-bottom: 1px solid #000;
}
-#actions li {
+.inlinepage .actions ul {
+ border-bottom: 0;
+}
+
+.actions li {
display: inline;
padding: .2em .4em;
}
to the preferences page.
* Add toc (table of contents) plugin.
* Change htmlize, format, and sanitize hooks to use named parameters.
+ * Patch from James Westby to add an actions option to inline; this
+ adds Edit and Discussion links at the end of blog entries.
- -- Joey Hess <joeyh@debian.org> Mon, 28 Aug 2006 13:59:29 -0400
+ -- Joey Hess <joeyh@debian.org> Mon, 28 Aug 2006 15:29:14 -0400
ikiwiki (1.21) unstable; urgency=low
This is ikiwiki's bug list. Link bugs to [[bugs/done]] when done.
-[[inline pages="bugs/* and !bugs/done and !link(bugs/done) and !*/Discussion" rootpage="bugs" show="0"]]
+[[inline pages="bugs/* and !bugs/done and !link(bugs/done) and !*/Discussion"
+actions=yes rootpage="bugs" show=0]]
inlining page.
* `description` - Sets the description of the rss feed if one is generated.
Defaults to the name of the wiki.
+* `actions` - If set to "yes" add links to the bottom of the inlined pages
+ for editing and discussion (if they would be shown at the top of the page
+ itself).
Welcome to ikiwiki's todo list. Link items to [[todo/done]] when done.
-[[inline pages="todo/* and !todo/done and !link(todo/done) and !*/Discussion" rootpage="todo" show="0"]]
+[[inline pages="todo/* and !todo/done and !link(todo/done) and !*/Discussion"
+actions=yes rootpage="todo" show=0]]
-- Add Discussion and Edit links at the bottom of each inlined post.
- It would be possible to support rss enclosures for eg, podcasts, pretty easily.
Here is the last of those items. Using the meta plugin you can give the appropriate
<http://jameswestby.net/scratch/actions.diff>
-- JamesWestby
+
+> Thanks! I did tweak the css a bit. Not totally happy with it, but pretty
+> good I think. --[[Joey]]
</TMPL_LOOP>
</TMPL_IF>
</span>
+
+<TMPL_IF NAME="HAVE_ACTIONS">
+<span class="actions">
+<ul>
+<TMPL_IF NAME="EDITURL">
+<li><a href="<TMPL_VAR EDITURL>">Edit</a></li>
+</TMPL_IF>
+<TMPL_IF NAME="DISCUSSIONLINK">
+<li><TMPL_VAR DISCUSSIONLINK></li>
+</TMPL_IF>
+</ul>
+</span>
+</TMPL_IF>
+
</div>
<i>
Posted <TMPL_VAR CTIME>
</i>
+
</p>
</div>
<TMPL_IF NAME="HAVE_ACTIONS">
-<div id="actions">
+<div class="actions">
<ul>
<TMPL_IF NAME="EDITURL">
<li><a href="<TMPL_VAR EDITURL>">Edit</a></li>