* Patch from James Westby to add an actions option to inline; this

adds Edit and Discussion links at the end of blog entries.
master
joey 2006-08-28 19:43:07 +00:00
parent 4895955cea
commit 1aeb64e148
10 changed files with 48 additions and 7 deletions

View File

@ -46,6 +46,7 @@ sub preprocess_inline (@) { #{{{
} else {
$desc = $config{wikiname};
}
my $actions=yesno($params{actions});
my @list;
foreach my $page (keys %pagesources) {
@ -104,6 +105,18 @@ sub preprocess_inline (@) { #{{{
$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,);

View File

@ -19,14 +19,18 @@
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;
}

4
debian/changelog vendored
View File

@ -42,8 +42,10 @@ ikiwiki (1.22) UNRELEASED; urgency=low
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

View File

@ -1,3 +1,4 @@
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]]

View File

@ -29,3 +29,6 @@ directive:
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).

View File

@ -1,3 +1,4 @@
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]]

View File

@ -1,4 +1,3 @@
- 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
@ -123,3 +122,6 @@ that you have for the links at the top.
<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]]

View File

@ -28,4 +28,18 @@ Tags:
</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>

View File

@ -3,4 +3,5 @@
<i>
Posted <TMPL_VAR CTIME>
</i>
</p>

View File

@ -25,7 +25,7 @@
</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>