* Patch from James Westby to add an actions option to inline; this
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Mon, 28 Aug 2006 19:43:07 +0000 (19:43 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Mon, 28 Aug 2006 19:43:07 +0000 (19:43 +0000)
  adds Edit and Discussion links at the end of blog entries.

IkiWiki/Plugin/inline.pm
basewiki/style.css
debian/changelog
doc/bugs.mdwn
doc/plugins/inline.mdwn
doc/todo.mdwn
doc/todo/blogging.mdwn
templates/inlinepage.tmpl
templates/inlinepagetitle.tmpl
templates/page.tmpl

index 1cbde71045c51d761a30de8f4cdedb4bbb5f323f..6518be794f08f905a6bc154bc4e8080ac36143ac 100644 (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,);
index 67c8ab1d132cf95982b1cd045b8b1dc5d960b914..c03f39ea35856a73a078a36e8bcb4b9ff93e5e58 100644 (file)
        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;
 }
index f105582a4f926a87464a909296ebb1e84f1e0327..d4b496739d035fedd9a3b394df4b8863c257508a 100644 (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
 
index 303b34163aeffeab709732ccd3a5531558414073..5be9e25cc35e1873f55a5c3180576617fccf2653 100644 (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]]
index f4110fe45bbe5aacc3e17be229007f568c53cb3c..05dea3a705d167b971d6e9821281a44d3d31df30 100644 (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).
index 9b6f896769c4a04bae5917a4368e4d266db293fd..a3952324d1a8e04394553dd03cd909a750c4b8e2 100644 (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]]
index bb68a26da0ef4550a571490d83de05c56220c5e3..9573ce3d0b2f98366a63101f5bc05c9638f4f278 100644 (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]]
index eecb5a60ea78e9deaa80f8ad3c4703016d6c5817..8210874ef11716126dc0ca3e87f7e1cd1b9bb1ba 100644 (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>
index 3aa6a2415b9cff23b20ebca0a82edf547260e470..6bc789dfb29cfe241055ac51c4c392df6a6a50a4 100644 (file)
@@ -3,4 +3,5 @@
 <i>
 Posted <TMPL_VAR CTIME>
 </i>
+
 </p>
index e8b30d7070f2df916bd9133882171eb10babb4f3..650d90ed18099cd9747d6a0c7805f9e2efff32f0 100644 (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>