From 1aeb64e14858dc7dbce6ac553fc6dc43efb29fae Mon Sep 17 00:00:00 2001
From: joey
Date: Mon, 28 Aug 2006 19:43:07 +0000
Subject: * Patch from James Westby to add an actions option to inline; this
adds Edit and Discussion links at the end of blog entries.
---
IkiWiki/Plugin/inline.pm | 13 +++++++++++++
basewiki/style.css | 8 ++++++--
debian/changelog | 4 +++-
doc/bugs.mdwn | 3 ++-
doc/plugins/inline.mdwn | 3 +++
doc/todo.mdwn | 3 ++-
doc/todo/blogging.mdwn | 4 +++-
templates/inlinepage.tmpl | 14 ++++++++++++++
templates/inlinepagetitle.tmpl | 1 +
templates/page.tmpl | 2 +-
10 files changed, 48 insertions(+), 7 deletions(-)
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 1cbde7104..6518be794 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -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,);
diff --git a/basewiki/style.css b/basewiki/style.css
index 67c8ab1d1..c03f39ea3 100644
--- a/basewiki/style.css
+++ b/basewiki/style.css
@@ -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;
}
diff --git a/debian/changelog b/debian/changelog
index f105582a4..d4b496739 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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 Mon, 28 Aug 2006 13:59:29 -0400
+ -- Joey Hess Mon, 28 Aug 2006 15:29:14 -0400
ikiwiki (1.21) unstable; urgency=low
diff --git a/doc/bugs.mdwn b/doc/bugs.mdwn
index 303b34163..5be9e25cc 100644
--- a/doc/bugs.mdwn
+++ b/doc/bugs.mdwn
@@ -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]]
diff --git a/doc/plugins/inline.mdwn b/doc/plugins/inline.mdwn
index f4110fe45..05dea3a70 100644
--- a/doc/plugins/inline.mdwn
+++ b/doc/plugins/inline.mdwn
@@ -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).
diff --git a/doc/todo.mdwn b/doc/todo.mdwn
index 9b6f89676..a3952324d 100644
--- a/doc/todo.mdwn
+++ b/doc/todo.mdwn
@@ -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]]
diff --git a/doc/todo/blogging.mdwn b/doc/todo/blogging.mdwn
index bb68a26da..9573ce3d0 100644
--- a/doc/todo/blogging.mdwn
+++ b/doc/todo/blogging.mdwn
@@ -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.
-- JamesWestby
+
+> Thanks! I did tweak the css a bit. Not totally happy with it, but pretty
+> good I think. --[[Joey]]
diff --git a/templates/inlinepage.tmpl b/templates/inlinepage.tmpl
index eecb5a60e..8210874ef 100644
--- a/templates/inlinepage.tmpl
+++ b/templates/inlinepage.tmpl
@@ -28,4 +28,18 @@ Tags:
+
+
+
+
+
+
+
diff --git a/templates/inlinepagetitle.tmpl b/templates/inlinepagetitle.tmpl
index 3aa6a2415..6bc789dfb 100644
--- a/templates/inlinepagetitle.tmpl
+++ b/templates/inlinepagetitle.tmpl
@@ -3,4 +3,5 @@
Posted
+
diff --git a/templates/page.tmpl b/templates/page.tmpl
index e8b30d707..650d90ed1 100644
--- a/templates/page.tmpl
+++ b/templates/page.tmpl
@@ -25,7 +25,7 @@
-