]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
add support for about_comments page 0.2
authorDavid Bremner <bremner@unb.ca>
Sun, 14 Sep 2008 19:23:39 +0000 (16:23 -0300)
committerDavid Bremner <bremner@unb.ca>
Sun, 14 Sep 2008 19:29:46 +0000 (16:29 -0300)
IkiWiki/Plugin/postal.pm
examples/page.tmpl
test-wiki/in/about_comments.mdwn [new file with mode: 0644]

index e1e00d72ea4b071d369d9b205b37b789a2524637..125d351117f7ee06acea49e081adaff0e1cd1e97 100644 (file)
@@ -49,21 +49,28 @@ sub pagetemplate (@)
     my $subpage_name=$config{postal_pagename} || "comments";
 
     my $comment_page=$destpage . "/" . $subpage_name;
-
     add_depends($params{page},$comment_page);
 
+
+    my $about_link=undef;
+    my $about_page=bestlink($page,"about_comments");
+
+    if ($about_page){
+       $about_link=htmllink($page,$destpage,$about_page,
+                              linktext=>gettext("About Comments"));
+    }  
+    
     my $comment_link=undef;
     if (exists $pagesources{$comment_page}){
        $comment_link=htmllink($page,$destpage,$comment_page,
                               linktext=>gettext("Read Comments"));
     }
 
-    debug("comment_link=".$comment_link) if (defined($comment_link));
-
     $template->param(POSTAL_DIV=>1,
                     POSTAL_PREFIX=>$config{postal_prefix},
                     POSTAL_KEY=>$key,
                     POSTAL_HOST=>$config{postal_host},
+                    defined($about_link) ? (POSTAL_ABOUT_LINK=>$about_link):(),
                     defined($comment_link) ? (POSTAL_COMMENT_LINK=>$comment_link) :());
 }
 
index 805f6ca4ac623b9e7d6e75e76d5ddbac0ccc5bf5..246a8778ad36f938ef3b19404b227d04ea317a1e 100644 (file)
@@ -89,6 +89,9 @@ Links:
 
 <TMPL_IF POSTAL_DIV>
 <div class="pagecomments">
+<TMPL_IF POSTAL_ABOUT_LINK>
+<TMPL_VAR NAME="POSTAL_ABOUT_LINK">
+</TMPL_IF>
 <a name="pagecomments"></a>
 <a href="mailto:<TMPL_VAR NAME="POSTAL_PREFIX"><TMPL_VAR NAME="POSTAL_KEY">@<TMPL_VAR NAME="POSTAL_HOST">">Send Comment</a>
 <TMPL_IF POSTAL_COMMENT_LINK>
diff --git a/test-wiki/in/about_comments.mdwn b/test-wiki/in/about_comments.mdwn
new file mode 100644 (file)
index 0000000..eb1e07d
--- /dev/null
@@ -0,0 +1,5 @@
+
+Comments on this wiki are sent by email, and will be read by a human
+before posting.  Your email address will not be displayed on the
+wiki. If you don't want your real name to be displayed either, don't
+put it in the From: header.