From 9d5075ab521a24d718a2b663e11856c8cc80eb03 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Dec 2008 14:52:05 -0500 Subject: first pass through comments documentation Moved documentation out of contrib. Mostly tweaked some wording. Moved documentation of various bits to other pages (pagespec, etc), and linked to those. Documented the new templates in wikitemplates. Small quantities of documentation were removed. Particularly the list of template variables, which I think is fairly obvious when editing the template. --- doc/wikitemplates.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/wikitemplates.mdwn') diff --git a/doc/wikitemplates.mdwn b/doc/wikitemplates.mdwn index babd70211..6fb4d5f49 100644 --- a/doc/wikitemplates.mdwn +++ b/doc/wikitemplates.mdwn @@ -29,6 +29,10 @@ located in /usr/share/ikiwiki/templates by default. form to wiki pages. * `searchquery.tmpl` - This is an omega template, used by the [[plugins/search]] plugin. +* `comments_display.tmpl` - This template is used to display a comment + by the [[plugins/comments]] plugin. +* `comments_form.tmpl` - This template is the comment post form for the + [[plugins/comments]] plugin. The [[plugins/pagetemplate]] plugin can allow individual pages to use a different template than `page.tmpl`. -- cgit v1.2.3 From ddabb010b2c45556046fd1ba982893395c7a46f6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Dec 2008 14:03:26 -0500 Subject: rename comments_display to comment --- IkiWiki/Plugin/comments.pm | 4 ++-- doc/tips/comments_feed.mdwn | 2 +- doc/todo/comments.mdwn | 2 +- doc/wikitemplates.mdwn | 2 +- templates/comment.tmpl | 36 ++++++++++++++++++++++++++++++++++++ templates/comments_display.tmpl | 36 ------------------------------------ 6 files changed, 41 insertions(+), 41 deletions(-) create mode 100644 templates/comment.tmpl delete mode 100644 templates/comments_display.tmpl (limited to 'doc/wikitemplates.mdwn') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index fd9f0acb4..705ba340b 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -447,7 +447,7 @@ sub sessioncgi ($$) { content => $preview); }); - my $template = template("comments_display.tmpl"); + my $template = template("comment.tmpl"); $template->param(content => $preview); $template->param(title => $form->field('subject')); $template->param(ctime => displaytime(time)); @@ -538,7 +538,7 @@ sub pagetemplate (@) { if ($shown) { $comments = IkiWiki::preprocess_inline( pages => "internal($page/$config{comments_pagename}*)", - template => 'comments_display', + template => 'comment', show => 0, reverse => 'yes', page => $page, diff --git a/doc/tips/comments_feed.mdwn b/doc/tips/comments_feed.mdwn index 68513901e..6f8137256 100644 --- a/doc/tips/comments_feed.mdwn +++ b/doc/tips/comments_feed.mdwn @@ -3,7 +3,7 @@ blog can have comments added to them. Pages with comments even have special feeds that can be used to subscribe to those comments. But you'd like to add a feed that contains all the comments posted to any page. Here's how: - \[[!inline pages="internal(*/comment_*)" template=comments_display]] + \[[!inline pages="internal(*/comment_*)" template=comment]] The special [[ikiwiki/PageSpec]] matches all comments. The [[template|wikitemplates]] causes the comments to be displayed formatted diff --git a/doc/todo/comments.mdwn b/doc/todo/comments.mdwn index 2bcec69ba..ee2ba7ea0 100644 --- a/doc/todo/comments.mdwn +++ b/doc/todo/comments.mdwn @@ -46,7 +46,7 @@ Known issues with the [[plugins/comments]] plugin: > a good feature to have, though. --[[smcv]] * One can use inline to set up a feed of all comments posted to any page. - Using template=comments_display they are displayed right. Only problem + Using template=comment they are displayed right. Only problem is there is no indication in that template of what page each comment in the feed is a comment on. So, if a comment is inlined into a different page, I think it should show a link back to the page commented on. diff --git a/doc/wikitemplates.mdwn b/doc/wikitemplates.mdwn index 6fb4d5f49..63735193b 100644 --- a/doc/wikitemplates.mdwn +++ b/doc/wikitemplates.mdwn @@ -29,7 +29,7 @@ located in /usr/share/ikiwiki/templates by default. form to wiki pages. * `searchquery.tmpl` - This is an omega template, used by the [[plugins/search]] plugin. -* `comments_display.tmpl` - This template is used to display a comment +* `comment.tmpl` - This template is used to display a comment by the [[plugins/comments]] plugin. * `comments_form.tmpl` - This template is the comment post form for the [[plugins/comments]] plugin. diff --git a/templates/comment.tmpl b/templates/comment.tmpl new file mode 100644 index 000000000..e7e283bbf --- /dev/null +++ b/templates/comment.tmpl @@ -0,0 +1,36 @@ +
+ +
+Posted by + + + + + + + + + + + + + + +unknown IP address + + + +() + + + +() +
+ +
+ +
+ +
+ +
diff --git a/templates/comments_display.tmpl b/templates/comments_display.tmpl deleted file mode 100644 index e7e283bbf..000000000 --- a/templates/comments_display.tmpl +++ /dev/null @@ -1,36 +0,0 @@ -
- -
-Posted by - - - - - - - - - - - - - - -unknown IP address - - - -() - - - -() -
- -
- -
- -
- -
-- cgit v1.2.3 From 79a787a4668caf043862197de2b5ba7e41d37102 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Dec 2008 14:07:22 -0500 Subject: rename comments_form to editcomment --- IkiWiki/Plugin/comments.pm | 2 +- doc/wikitemplates.mdwn | 2 +- templates/comments_form.tmpl | 34 ---------------------------------- templates/editcomment.tmpl | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 templates/comments_form.tmpl create mode 100644 templates/editcomment.tmpl (limited to 'doc/wikitemplates.mdwn') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 705ba340b..a155712fb 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -281,7 +281,7 @@ sub sessioncgi ($$) { action => $config{cgiurl}, header => 0, table => 0, - template => scalar IkiWiki::template_params('comments_form.tmpl'), + template => scalar IkiWiki::template_params('editcomment.tmpl'), # wtf does this do in editpage? wikiname => $config{wikiname}, ); diff --git a/doc/wikitemplates.mdwn b/doc/wikitemplates.mdwn index 63735193b..dc217cd30 100644 --- a/doc/wikitemplates.mdwn +++ b/doc/wikitemplates.mdwn @@ -31,7 +31,7 @@ located in /usr/share/ikiwiki/templates by default. [[plugins/search]] plugin. * `comment.tmpl` - This template is used to display a comment by the [[plugins/comments]] plugin. -* `comments_form.tmpl` - This template is the comment post form for the +* `editcomment.tmpl` - This template is the comment post form for the [[plugins/comments]] plugin. The [[plugins/pagetemplate]] plugin can allow individual pages to use a diff --git a/templates/comments_form.tmpl b/templates/comments_form.tmpl deleted file mode 100644 index 9a9455f99..000000000 --- a/templates/comments_form.tmpl +++ /dev/null @@ -1,34 +0,0 @@ -
- - - - - - -Signed in as
- - -Name: (optional)
-Website: (optional)
-
-
-Subject:
-
-Page type:
-
-
-A subset of HTML is allowed.
-IkiWiki directives ([[!directive]]) are not allowed in comments on this wiki.
- - - -
-
-Comment preview: -
-
- -
-
- -
diff --git a/templates/editcomment.tmpl b/templates/editcomment.tmpl new file mode 100644 index 000000000..a08b8964c --- /dev/null +++ b/templates/editcomment.tmpl @@ -0,0 +1,34 @@ +
+ + + + + + +Signed in as
+ + +Name: (optional)
+Website: (optional)
+
+
+Subject:
+
+Page type:
+
+
+A subset of HTML is allowed.
+IkiWiki directives ([[!directive]]) are not allowed in comments on this wiki.
+ + + +
+
+Comment preview: +
+
+ +
+
+ +
-- cgit v1.2.3 From 7a7e28c55f1ffa64eedbaf36ee1729c6bbd27762 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 25 Jan 2009 19:04:45 -0500 Subject: add a button to prefs page for comment moderation --- IkiWiki/Plugin/comments.pm | 13 +++++++++++++ doc/plugins/comments.mdwn | 8 +++++--- doc/wikitemplates.mdwn | 2 ++ 3 files changed, 20 insertions(+), 3 deletions(-) (limited to 'doc/wikitemplates.mdwn') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index ad5395a82..c95f77a42 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -26,6 +26,7 @@ sub import { hook(type => "htmlize", id => "_comment", call => \&htmlize); hook(type => "pagetemplate", id => "comments", call => \&pagetemplate); hook(type => "cgi", id => "comments", call => \&linkcgi); + hook(type => "formbuilder_setup", id => "comments", call => \&formbuilder_setup); IkiWiki::loadplugin("inline"); } @@ -618,6 +619,18 @@ sub commentmoderation ($$) { exit; } +sub formbuilder_setup (@) { + my %params=@_; + + my $form=$params{form}; + if ($form->title eq "preferences") { + push @{$params{buttons}}, "Comment Moderation"; + if ($form->submitted && $form->submitted eq "Comment Moderation") { + commentmoderation($params{cgi}, $params{session}); + } + } +} + sub comments_pending () { my $dir="$config{wikistatedir}/comments_pending/"; return unless -d $dir; diff --git a/doc/plugins/comments.mdwn b/doc/plugins/comments.mdwn index 4cee3b9ad..c13a6daa6 100644 --- a/doc/plugins/comments.mdwn +++ b/doc/plugins/comments.mdwn @@ -45,6 +45,8 @@ There are some global options for the setup file: ## comment moderation If you enable the [[blogspam]] plugin, comments that appear spammy will be -held for moderation. These comments are stored in -`.ikiwiki/comments_pending/`, and can be deleted, or moved into the -wiki's srcdir to be posted. +held for moderation. Wiki admins can access the comment moderation queue +via a button on their Preferences page. + +The comments are stored in `.ikiwiki/comments_pending/`, and can be +deleted, or moved into the wiki's srcdir to be posted. diff --git a/doc/wikitemplates.mdwn b/doc/wikitemplates.mdwn index dc217cd30..fc5893677 100644 --- a/doc/wikitemplates.mdwn +++ b/doc/wikitemplates.mdwn @@ -33,6 +33,8 @@ located in /usr/share/ikiwiki/templates by default. by the [[plugins/comments]] plugin. * `editcomment.tmpl` - This template is the comment post form for the [[plugins/comments]] plugin. +* `commentmoderation.tmpl` - This template is used to produce the comment + moderation form. The [[plugins/pagetemplate]] plugin can allow individual pages to use a different template than `page.tmpl`. -- cgit v1.2.3