From 5f80ac3202e61440d3a0fbcc486e13c16309d5ad Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Sun, 18 Jan 2009 09:52:51 -0500 Subject: underlay plugin, a command-line interface for add_underlay() --- doc/plugins/contrib/underlay.mdwn | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 doc/plugins/contrib/underlay.mdwn diff --git a/doc/plugins/contrib/underlay.mdwn b/doc/plugins/contrib/underlay.mdwn new file mode 100644 index 000000000..94651f1d3 --- /dev/null +++ b/doc/plugins/contrib/underlay.mdwn @@ -0,0 +1,55 @@ +[[!template id=plugin name=underlay author="[[Simon_McVittie|smcv]]"]] +[[!tag type/useful]] + +This plugin adds an `add_underlays` option to the `.setup` file. +Its value is a list of underlay directories whose content is added to the wiki. + +Multiple underlays are normally set up automatically by other plugins (for +instance, the smiley images used by [[plugins/smileys]]), but they can also be +used as a way to pull in external files that you don't want in revision control, +like photos or software releases. + +Directories in `add_underlays` should usually be absolute. If relative, they're +interpreted as relative to the parent directory of the basewiki underlay, which +is probably not particularly useful in this context. + + #!/usr/bin/perl + package IkiWiki::Plugin::underlay; + # Copyright © 2008 Simon McVittie + # Licensed under the GNU GPL, version 2, or any later version published by the + # Free Software Foundation + + use warnings; + use strict; + use IkiWiki 2.00; + + sub import { + hook(type => "getsetup", id => "underlay", call => \&getsetup); + hook(type => "checkconfig", id => "underlay", call => \&checkconfig); + } + + sub getsetup () { + return + plugin => { + safe => 0, + rebuild => undef, + }, + add_underlays => { + type => "string", + default => [], + description => "extra underlay directories to add", + advanced => 1, + safe => 0, + rebuild => 1, + }, + } + + sub checkconfig () { + return unless exists $config{add_underlays}; + + foreach my $dir (@{$config{add_underlays}}) { + add_underlay($dir); + } + } + + 1; -- cgit v1.2.3 From e98f1b246a91f499d332f2d6e42d45a88d368681 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Sun, 18 Jan 2009 11:40:57 -0500 Subject: fix typo, mention git branch --- doc/plugins/contrib/underlay.mdwn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/plugins/contrib/underlay.mdwn b/doc/plugins/contrib/underlay.mdwn index 94651f1d3..72893c992 100644 --- a/doc/plugins/contrib/underlay.mdwn +++ b/doc/plugins/contrib/underlay.mdwn @@ -5,7 +5,7 @@ This plugin adds an `add_underlays` option to the `.setup` file. Its value is a list of underlay directories whose content is added to the wiki. Multiple underlays are normally set up automatically by other plugins (for -instance, the smiley images used by [[plugins/smileys]]), but they can also be +instance, the images used by the [[plugins/smiley]] plugin), but they can also be used as a way to pull in external files that you don't want in revision control, like photos or software releases. @@ -13,6 +13,9 @@ Directories in `add_underlays` should usually be absolute. If relative, they're interpreted as relative to the parent directory of the basewiki underlay, which is probably not particularly useful in this context. +Please feel free to add this plugin to ikiwiki if it seems like a good +thing to have. See the 'underlay' branch in my git repository. + #!/usr/bin/perl package IkiWiki::Plugin::underlay; # Copyright © 2008 Simon McVittie -- cgit v1.2.3 From 58fb0a372b0a2f56e611519285b7fe5345536b20 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 18 Jan 2009 16:49:53 +0000 Subject: Add myself to ikiwikiusers --- doc/ikiwikiusers.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/ikiwikiusers.mdwn b/doc/ikiwikiusers.mdwn index 2a51dfd9d..989a425c6 100644 --- a/doc/ikiwikiusers.mdwn +++ b/doc/ikiwikiusers.mdwn @@ -105,6 +105,8 @@ Personal sites and blogs * [[xma]] is using ikiwiki () * [[JanWalzer|jwalzer]]'s [homepage](http://wa.lzer.net/) -- Work in Progress * [[Adam_Trickett|ajt]]'s home intranet/sanbox system ([Internet site & blog](http://www.iredale.net/) -- not ikiwiki yet) +* [[Simon_McVittie|smcv]]'s [website](http://www.pseudorandom.co.uk/) and + [blog](http://smcv.pseudorandom.co.uk/) Schools ======= -- cgit v1.2.3 From 1e6dd2fc3761e071a4c3b65ea99022ac006e7a6d Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 18 Jan 2009 17:30:52 +0000 Subject: Some more thoughts about a gallery plugin --- doc/users/smcv.mdwn | 2 +- doc/users/smcv/gallery.mdwn | 119 +++++++++++++++++++++++++++++++++----------- 2 files changed, 92 insertions(+), 29 deletions(-) diff --git a/doc/users/smcv.mdwn b/doc/users/smcv.mdwn index c52aa8f0f..59d1affba 100644 --- a/doc/users/smcv.mdwn +++ b/doc/users/smcv.mdwn @@ -7,4 +7,4 @@ My repository containing ikiwiki branches: * gitweb: http://git.pseudorandom.co.uk/smcv/ikiwiki.git * anongit: git://git.pseudorandom.co.uk/git/smcv/ikiwiki.git -Currently working on the [[plugins/contrib/comments]] plugin. +Currently thinking about a [[users/smcv/gallery]] plugin. diff --git a/doc/users/smcv/gallery.mdwn b/doc/users/smcv/gallery.mdwn index 40e9f6279..5b4c6fe00 100644 --- a/doc/users/smcv/gallery.mdwn +++ b/doc/users/smcv/gallery.mdwn @@ -13,10 +13,10 @@ and Facebook's Photos "application". The web UI I'm trying to achieve consists of one [HTML page of thumbnails](http://www.pseudorandom.co.uk/2008/2008-03-08-panic-cell-gig/) -as an entry point to the gallery, where each thumbnail -links to +as an entry point to the gallery, where each thumbnail links to [a "viewer" HTML page](http://www.pseudorandom.co.uk/2008/2008-03-08-panic-cell-gig/img_0068/) -with a full size image, next/previous thumbnail links, and [[plugins/comments]]. +with a full size image, next/previous thumbnail links, and +[[plugins/comments]]. (The Summer of Code [[plugins/contrib/gallery]] plugin does the next/previous UI in Javascript using Lightbox, which means that @@ -44,13 +44,14 @@ Other features that would be good to have: * rendering an `/` arrangement to display videos, and possibly thumbnailing them in the same way as totem-video-thumbnailer - (my camera can record short videos, so some of my web photo galleries contain - them) + (my camera can record short videos, so some of my web photo galleries + contain them) My plan is to have these directives: -* \[[!gallery]] registers the page it's on as a gallery, and displays all photos - that are part of this gallery but not part of a \[[!gallerysection]] (below). +* \[[!gallery]] registers the page it's on as a gallery, and displays all + photos that are part of this gallery but not part of a \[[!gallerysection]] + (below). All images (i.e. `*.png *.jpg *.gif`) that are attachments to the gallery page or its subpages are considered to be part of the gallery. @@ -65,7 +66,8 @@ My plan is to have these directives: * \[[!gallerysection filter="[[ikiwiki/PageSpec]]"]] displays all photos in the gallery that match the filter -So, [the gallery I'm using as an example](http://www.pseudorandom.co.uk/2008/2008-03-08-panic-cell-gig/) +So, +[the gallery I'm using as an example](http://www.pseudorandom.co.uk/2008/2008-03-08-panic-cell-gig/) could look something like this: \[[!gallery]] @@ -85,13 +87,6 @@ could look something like this: ## Implementation ideas -The photo galleries I have at the moment, like the Panic Cell example above, -are made by using an external script to parse XML gallery descriptions (lists -of image filenames, with metadata such as titles), and using this to write IkiWiki -markup into a directory which is then used as an underlay. This is a hack, but it -works. The use of XML is left over from a previous attempt at solving the same -problem using Django. - The next/previous part this plugin overlaps with [[todo/wikitrails]]. A \[[!galleryimg]] directive to assign metadata to images is probably necessary, so @@ -100,15 +95,21 @@ the gallery page can contain something like: \[[!galleryimg p1010001.jpg title="..." caption="..." tags="foo"]] \[[!galleryimg p1010002.jpg title="..." caption="..." tags="foo bar"]] -Making the viewer pages could be rather tricky. +Making the viewer pages could be rather tricky. Here are some options: +"synthesize source pages for viewers" is the one I'm leaning towards at the +moment. + +### Viewers' source page is the gallery -One possibility is to write out the viewer pages as a side-effect of preprocessing -the \[[!gallery]] directive. The proof-of-concept implementation below does this. -However, this does mean the viewer pages can't have tags or metadata of their own -and can't be matched by [[pagespecs|ikiwiki/pagespec]] or +One possibility is to write out the viewer pages as a side-effect of +preprocessing the \[[!gallery]] directive. The proof-of-concept implementation +below does this. However, this does mean the viewer pages can't have tags or +metadata of their own and can't be matched by [[pagespecs|ikiwiki/pagespec]] or [[wikilinks|ikiwiki/wikilink]]. It might be possible to implement tagging by using \[[!galleryimg]] to assign the metadata to the *images* instead of their -viewers, +viewers. + +### Synthesize source pages for viewers Another is to synthesize source pages for the viewers. This means they can have tags and metadata, but trying to arrange for them to be scanned etc. correctly @@ -117,13 +118,75 @@ without needing another refresh run is somewhat terrifying. the refresh hook, but I don't really like the idea of a refresh hook that scans all source pages to see if they contain \[[!gallery]]... -Making the image be the source page (and generate HTML itself) would be possible, -but I wouldn't want to generate a HTML viewer for every `.jpg` on a site, so -either the images would have to have a special extension (awkward for uploads from -Windows users) or the plugin would have to be able to change whether HTML was -generated in some way (not currently possible). - -## Proof-of-concept +The photo galleries I have at the moment, like the Panic Cell example above, +are made by using an external script to parse XML gallery descriptions (lists +of image filenames, with metadata such as titles), and using this to write +IkiWiki markup into a directory which is then used as an underlay. This is a +hack, but it works. The use of XML is left over from a previous attempt at +solving the same problem using Django. + +Perhaps a better approach would be to have a setupfile option that names a +particular underlay directory (meeting the objective of not having large +photos under source code control) and generates a source page for each file +in that directory during the refresh hook. The source pages could be in the +underlay until they are edited (e.g. tagged), at which point they would be +copied into the source-code-controlled version in the usual way. + +The synthetic source pages can be very simple, using the same trick as my +[[plugins/comments]] plugin (a dedicated [[directive|ikiwiki/directives]] +encapsulating everything the plugin needs). If the plugin automatically +gathers information like file size, pixel size, date etc. from the images, then +only the human-edited information and a filename reference need to be present +in the source page; with some clever lookup rules based on the filename of +the source page, not even the photo's filename is necessarily needed. + + \[[!meta title="..."]] + \[[!meta date="..."]] + \[[!meta copyright="..."]] + \[[!tag ...]] + + \[[!galleryimageviewer p1010001.jpg]] + +However, this would mean that editing tags and other metadata would require +editing pages individually. Rather than trying to "fix" that, perhaps it would +be better to have a special CGI interface for bulk tagging/metadata editing. +This could even be combined with a bulk upload form (a reasonable number of +file upload controls - maybe 20 - with metadata alongside each). + +Uploading multiple images is necessarily awkward due to restrictions placed on +file upload controls by browsers for security reasons - sites like Facebook +allow whole directories to be uploaded at the same time, but they achieve this +by using a signed Java applet with privileged access to the user's filesystem. + +I've found that it's often useful to be able to force the creation time of +photos (my camera's battery isn't very reliable, and it frequently decides that +the date is 0000-00-00 00:00:00), so treating the \[[!meta date]] of the source +page and the creation date of the photo as synonymous would be useful. + +### Images are the viewer's source - special filename extension + +Making the image be the source page (and generate HTML itself) would be +possible, but I wouldn't want to generate a HTML viewer for every `.jpg` on a +site, so either the images would have to have a special extension (awkward for +uploads from Windows users) or the plugin would have to be able to change +whether HTML was generated in some way (not currently possible). + +### Images are the viewer's source - alter `ispage()` + +It might be possible to hack up `ispage()` so some, but not all, images are +considered to "be a page": + +* srcdir/not-a-photo.jpg → destdir/not-a-photo.jpg +* srcdir/gallery/photo.jpg → destdir/gallery/photo/index.html + +Perhaps one way to do this would be for the photos to appear in a particular +underlay directory, which would also fulfil the objective of having photos not +be version-controlled: + +* srcdir/not-a-photo.jpg → destdir/not-a-photo.jpg +* underlay/gallery/photo.jpg → destdir/gallery/photo/index.html + +## Proof-of-concept implementation of "viewers' source page is the gallery" #!/usr/bin/perl package IkiWiki::Plugin::gallery; -- cgit v1.2.3 From 1802503af1816106ba15d1101081e72c36eeb8bc Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Sun, 18 Jan 2009 13:36:22 -0500 Subject: overriding visible modification time (to avoid insignificant edits flooding planets) --- doc/todo/overriding_displayed_modification_time.mdwn | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/todo/overriding_displayed_modification_time.mdwn diff --git a/doc/todo/overriding_displayed_modification_time.mdwn b/doc/todo/overriding_displayed_modification_time.mdwn new file mode 100644 index 000000000..b015b3730 --- /dev/null +++ b/doc/todo/overriding_displayed_modification_time.mdwn @@ -0,0 +1,17 @@ +Some aggregators, like Planet, sort by mtime rather than ctime. This +means that posts with modified content come to the top (which seems odd +to me, but is presumably what the aggregator's author or operator +wants), but it also means that posts with insignificant edits (like +adding tags) come to the top too. Atom defines `` to be the date +of the last *significant* change, so it's fine that ikiwiki defaults to +using the mtime, but it would be good to have a way for the author to +say "that edit was insignificant, don't use that mtime". + +See smcv's 'updated' branch for a basic implementation, which only affects +the Atom `` field or the RSS equivalent. + +Other places the updated metadata item could be used (opinions on whether +each should use it or not, please): + +* sorting by mtime in the inline directive +* displaying "last edited" on ordinary pages -- cgit v1.2.3 From 639f464cb3c703697db2a8887ab32d7a8233508f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 18 Jan 2009 14:52:49 -0500 Subject: Avoid feeding decoded unicode to Term::ReadLine That resulted in double encoded display when using perl's stub readline module. Apparently that module unconditionally upgrades text to utf8, in a quite braindead way. (Term::ReadLine::Gnu::Perl worked ok.) --- IkiWiki/Setup/Automator.pm | 3 ++- debian/changelog | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index b7798fcec..42caf3039 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -9,12 +9,13 @@ use IkiWiki; use IkiWiki::UserInfo; use Term::ReadLine; use File::Path; +use Encode; sub ask ($$) { my ($question, $default)=@_; my $r=Term::ReadLine->new("ikiwiki"); - $r->readline($question." ", $default); + $r->readline(encode_utf8($question)." ", $default); } sub prettydir ($) { diff --git a/debian/changelog b/debian/changelog index 013dc1884..6e8a54d9d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ikiwiki (3.03) UNRELEASED; urgency=low + + * Avoid feeding decoded unicode to Term::ReadLine. + Closes: 512169 + + -- Joey Hess Sun, 18 Jan 2009 14:50:57 -0500 + ikiwiki (3.02) unstable; urgency=low * blogspam: New plugin, adding spam filtering for page editing / comment -- cgit v1.2.3 From dc20d709066b344de9e622e0ec8601c4939ec1f7 Mon Sep 17 00:00:00 2001 From: kent Date: Mon, 19 Jan 2009 03:06:36 -0500 Subject: --- doc/install/discussion.mdwn | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/doc/install/discussion.mdwn b/doc/install/discussion.mdwn index b5757070f..e77844de9 100644 --- a/doc/install/discussion.mdwn +++ b/doc/install/discussion.mdwn @@ -178,3 +178,28 @@ I've tried a couple of times and my cpan has never recognised Bundle::IkiWiki. I > Can you show how it fails to find the bundle? --[[Joey]] >> I was not. Next time I build I will have to try that (I'll need to tweak it as I already override PERL5LIB; also I need to specify http proxies). Thanks for your help! -- [[users/Jon]] + +--- + +##Further problems with Bundle::IkiWiki +I'm also having trouble with finding Bundle::IkiWiki. I've tried it with the environment settings and without them, and also using the interactive +form of the cpan command. I've also gone to cpan.org and searched -- eg + + http://search.cpan.org/search?query=ikiwiki&mode=all + +and no Bundle for IkiWiki comes up at all. + +The error I get from the various cpan attempts is basically always the same: + + Warning: Cannot install Bundle::IkiWiki, don't know what it is. + Try the command + + i /Bundle::IkiWiki/ + + to find objects with matching identifiers. + +When I try that command, BTW, it basically seems to find the same stuff I get when searching on the cpan web site. + +This happens both on Ubuntu 8.04 and CentOS 5.1 + +Any help would be greatly appreciated... --kent -- cgit v1.2.3 From e20c116e9354e4ac5b5c3668a635f64a9a4c44e7 Mon Sep 17 00:00:00 2001 From: "http://zms.myopenid.com/" Date: Mon, 19 Jan 2009 13:43:00 -0500 Subject: --- doc/sandbox.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/sandbox.mdwn b/doc/sandbox.mdwn index d39b59715..b716a1374 100644 --- a/doc/sandbox.mdwn +++ b/doc/sandbox.mdwn @@ -62,7 +62,9 @@ Bulleted list * a new list * with sub heads * like this +----- +## a level 2 heading ---- [[!template id=note text="this is generated by the [[plugins/haiku]] plugin"]] -- cgit v1.2.3 From aaef4408002b1d2b252351f75ce89d7ae7e11814 Mon Sep 17 00:00:00 2001 From: "http://zms.myopenid.com/" Date: Mon, 19 Jan 2009 13:45:29 -0500 Subject: --- doc/sandbox.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/sandbox.mdwn b/doc/sandbox.mdwn index b716a1374..f1a27f819 100644 --- a/doc/sandbox.mdwn +++ b/doc/sandbox.mdwn @@ -65,6 +65,8 @@ Bulleted list ----- ## a level 2 heading +huh? + ---- [[!template id=note text="this is generated by the [[plugins/haiku]] plugin"]] -- cgit v1.2.3 From d79b8f809abc89d954240b2299e4613a8272fc5e Mon Sep 17 00:00:00 2001 From: Víctor Moral Date: Mon, 19 Jan 2009 09:02:21 +0100 Subject: Updated spanish translation --- po/es.po | 92 +++++++++++----------------------------------------------------- 1 file changed, 16 insertions(+), 76 deletions(-) diff --git a/po/es.po b/po/es.po index 1b2a9dd15..db8fce8da 100644 --- a/po/es.po +++ b/po/es.po @@ -1,19 +1,21 @@ +# translation of es.po to spanish # ikiwiki spanish translation -# Copyright (C) 2007 The Free Software Foundation, Inc +# Copyright (C) 2007, 2009 The Free Software Foundation, Inc # This file is distributed under the same license as the ikiwiki package. # -# Víctor Moral , 2007. +# Víctor Moral , 2007, 2009. msgid "" msgstr "" "Project-Id-Version: es\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-01-17 18:19-0500\n" -"PO-Revision-Date: 2008-12-19 08:10+0100\n" -"Last-Translator: Víctor Moral \n" -"Language-Team: Spanish \n" +"PO-Revision-Date: 2009-01-19 08:58+0100\n" +"Language-Team: spanish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Last-Translator: Víctor Moral \n" +"X-Generator: KBabel 1.11.4\n" #: ../IkiWiki/CGI.pm:113 msgid "You need to log in first." @@ -21,8 +23,7 @@ msgstr "Antes es necesario identificarse." #: ../IkiWiki/CGI.pm:145 msgid "login failed, perhaps you need to turn on cookies?" -msgstr "" -"registro fallido, ¿ tal vez necesita activar las cookies en el navegador ?" +msgstr "registro fallido, ¿ tal vez necesita activar las cookies en el navegador ?" #: ../IkiWiki/CGI.pm:163 ../IkiWiki/CGI.pm:280 msgid "Your login session has expired." @@ -58,8 +59,7 @@ msgstr "Contenido añadido activado vía web." #: ../IkiWiki/Plugin/aggregate.pm:93 msgid "Nothing to do right now, all feeds are up-to-date!" -msgstr "" -"¡ No hay nada que hacer, todas las fuentes de noticias están actualizadas !" +msgstr "¡ No hay nada que hacer, todas las fuentes de noticias están actualizadas !" #: ../IkiWiki/Plugin/aggregate.pm:220 #, perl-format @@ -176,11 +176,11 @@ msgstr "creación de índice automática" msgid "" "Sorry, but that looks like spam to blogspam: " -msgstr "" +msgstr "Lo siento, pero el analizador blogspam dice que el texto puede ser spam." #: ../IkiWiki/Plugin/blogspam.pm:105 msgid "blogspam server failure: " -msgstr "" +msgstr "fallo del servidor blogspam: " #: ../IkiWiki/Plugin/brokenlinks.pm:33 ../IkiWiki/Plugin/editpage.pm:296 #: ../IkiWiki/Plugin/inline.pm:354 ../IkiWiki/Plugin/opendiscussion.pm:26 @@ -339,8 +339,7 @@ msgstr "" #: ../IkiWiki/Plugin/google.pm:31 msgid "Failed to parse url, cannot determine domain name" -msgstr "" -"Error en el análisis del URL, no puedo determinar el nombre del dominio" +msgstr "Error en el análisis del URL, no puedo determinar el nombre del dominio" #: ../IkiWiki/Plugin/graphviz.pm:67 msgid "failed to run graphviz" @@ -422,8 +421,7 @@ msgstr "La página %s está bloqueada y no puede modificarse" #: ../IkiWiki/Plugin/mdwn.pm:44 msgid "multimarkdown is enabled, but Text::MultiMarkdown is not installed" -msgstr "" -"el modo multimarkdown está activo, pero no está instalado Text::MultiMarkdown" +msgstr "el modo multimarkdown está activo, pero no está instalado Text::MultiMarkdown" #: ../IkiWiki/Plugin/mdwn.pm:67 #, perl-format @@ -848,8 +846,7 @@ msgid "plugins" msgstr "complementos" #: ../IkiWiki/Plugin/websetup.pm:395 -msgid "" -"The configuration changes shown below require a wiki rebuild to take effect." +msgid "The configuration changes shown below require a wiki rebuild to take effect." msgstr "" "Los cambios en la configuración que se muestran más abajo precisan una " "reconstrucción del wiki para tener efecto." @@ -965,8 +962,7 @@ msgstr "el programa %s no parece ser ejecutable" #: ../IkiWiki/Wrapper.pm:20 msgid "cannot create a wrapper that uses a setup file" -msgstr "" -"no puedo crear un programa envoltorio que utiliza un archivo de configuración" +msgstr "no puedo crear un programa envoltorio que utiliza un archivo de configuración" #: ../IkiWiki/Wrapper.pm:24 msgid "wrapper filename not specified" @@ -1054,66 +1050,10 @@ msgid "What revision control system to use?" msgstr "¿ Qué sistema de control de versiones empleará ?" #: ../auto.setup:20 -#, fuzzy msgid "What wiki user (or openid) will be admin?" -msgstr "" -"¿ Qué usuario del wiki (ó identificador openid) será el administrador del " -"wiki ? " +msgstr "¿ Qué usuario del wiki (ó qué identificador openid) será el empleado como administrador ? " #: ../auto.setup:23 msgid "What is the domain name of the web server?" msgstr "¿ Cuál es el dominio para el servidor web ?" -#~ msgid "failed to find url in html" -#~ msgstr "" -#~ "El complemento googlecalendar no ha encontrado un URL en el código html " - -#~ msgid "processed ok at %s" -#~ msgstr "proceso completado con éxito a %s" - -#~ msgid "Your password has been emailed to you." -#~ msgstr "Se le ha enviado su contraseña por correo electrónico." - -#~ msgid "polygen failed" -#~ msgstr "El programa polygen ha fallado" - -#~ msgid "cleaning hyperestraier search index" -#~ msgstr "limpiando el índice de búsquedas de hyperestraier" - -#~ msgid "updating hyperestraier search index" -#~ msgstr "actualizando el índice de búsquedas de hyperstraier" - -#~ msgid "(not toggleable in preview mode)" -#~ msgstr "(no se puede cambiar en el modo de previsualización)" - -#~ msgid "" -#~ "REV is not set, not running from mtn post-commit hook, cannot send " -#~ "notifications" -#~ msgstr "" -#~ "La variable de entorno REV no está definida, por lo que no puede " -#~ "funcionar svn post-commit desde monotone; no puedo enviar ninguna " -#~ "notificación" - -#~ msgid "REV is not a valid revision identifier, cannot send notifications" -#~ msgstr "" -#~ "REV no es un identificador de revisión válido, por lo que no puedo enviar " -#~ "ninguna notificación" - -#~ msgid "" -#~ "REV is not set, not running from svn post-commit hook, cannot send " -#~ "notifications" -#~ msgstr "" -#~ "La variable de entorno REV no está definida, por lo que no puede " -#~ "funcionar svn post-commit; no puedo enviar ninguna notificación" - -#~ msgid "link is no longer supported" -#~ msgstr "el metadato link ya no puede usarse" - -#~ msgid "%s not found" -#~ msgstr "no he encontrado la plantilla %s " - -#~ msgid "What's this?" -#~ msgstr "¿ Qué es esto ?" - -#~ msgid "(use FirstnameLastName)" -#~ msgstr "(utilice la forma NombreApellidos)" -- cgit v1.2.3 From 8360e96a8661d3cc0532f377db81a3f37babd126 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 19 Jan 2009 14:11:15 -0500 Subject: blogspam: Log spam info on failure. --- IkiWiki/Plugin/blogspam.pm | 9 ++++++--- debian/changelog | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/IkiWiki/Plugin/blogspam.pm b/IkiWiki/Plugin/blogspam.pm index cc6e840f0..8462a6d1d 100644 --- a/IkiWiki/Plugin/blogspam.pm +++ b/IkiWiki/Plugin/blogspam.pm @@ -83,7 +83,7 @@ sub checkcontent (@) { # and "buy". push @options, "exclude=stopwords"; - my $res = $client->send_request('testComment', { + my %req={ ip => $ENV{REMOTE_ADDR}, comment => $params{content}, subject => defined $params{subject} ? $params{subject} : "", @@ -92,17 +92,20 @@ sub checkcontent (@) { options => join(",", @options), site => $config{url}, version => "ikiwiki ".$IkiWiki::version, - }); + }; + my $res = $client->send_request('testComment', %req); if (! ref $res || ! defined $res->value) { debug("failed to get response from blogspam server ($url)"); return undef; } elsif ($res->value =~ /^SPAM:(.*)/) { + eval q{use Data::Dumper}; + debug("blogspam server reports ".$res->value.": ".Dumper(\%req)); return gettext("Sorry, but that looks like spam to blogspam: ").$1; } elsif ($res->value ne 'OK') { - debug(gettext("blogspam server failure: ").$res->value); + debug("blogspam server failure: ".$res->value); return undef; } else { diff --git a/debian/changelog b/debian/changelog index 6e8a54d9d..8bf45c30a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ ikiwiki (3.03) UNRELEASED; urgency=low * Avoid feeding decoded unicode to Term::ReadLine. Closes: 512169 + * blogspam: Log spam info on failure. -- Joey Hess Sun, 18 Jan 2009 14:50:57 -0500 -- cgit v1.2.3 From daaf4885384568822c9a134f28cee667b6940d66 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 20 Jan 2009 00:53:46 +0100 Subject: po: let's walk the last steps needed before merge! Signed-off-by: intrigeri --- doc/plugins/contrib/po.mdwn | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/doc/plugins/contrib/po.mdwn b/doc/plugins/contrib/po.mdwn index edd665185..af748a8d3 100644 --- a/doc/plugins/contrib/po.mdwn +++ b/doc/plugins/contrib/po.mdwn @@ -171,3 +171,30 @@ Any thoughts on this? I've set this plugin development aside for a while. I will be back and finish it at some point in the first quarter of 2009. --[[intrigeri]] + +> Abstract: Joey, please have a look at my po and meta branches. +> +> Detailed progress report: +> +> * it seems the po branch in your repository has not been tracking my +> own po branch for two months. any config issue? +> * all the plugin's todo items have been completed, robustness tests +> done +> * I've finished the detailed security audit, and the fix for po4a +> bugs has entered upstream CVS last week +> * I've merged your new `checkcontent` hook with the `cansave` hook +> I previously introduced in my own branch; blogspam plugin updated +> accordingly +> * the rename hook changes we discussed elsewhere are also part of my +> branch +> * I've introduced two new hooks (`canremove` and `canrename`), not +> a big deal; IMHO, they extend quite logically the plugin interface +> * as highlighted on [[bugs/pagetitle_function_does_not_respect_meta_titles]], +> my `meta` branch contains a new feature that is really useful in a +> translatable wiki +> +> As a conclusion, I'm feeling that my branches are ready to be +> merged; only thing missing, I guess, are a bit of discussion and +> subsequent adjustments. +> +> --[[intrigeri]] -- cgit v1.2.3 From 4cae94b9fa4892e558160c5d55779064ff4a7add Mon Sep 17 00:00:00 2001 From: "http://taozhyn.myopenid.com/" Date: Mon, 19 Jan 2009 23:33:34 -0500 Subject: --- doc/ikiwiki/directive/pagestats/discussion.mdwn | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 doc/ikiwiki/directive/pagestats/discussion.mdwn diff --git a/doc/ikiwiki/directive/pagestats/discussion.mdwn b/doc/ikiwiki/directive/pagestats/discussion.mdwn new file mode 100644 index 000000000..3c9dc7104 --- /dev/null +++ b/doc/ikiwiki/directive/pagestats/discussion.mdwn @@ -0,0 +1,10 @@ +I am trying to create a tag cloud using: + + \[[!pagestats pages="tags/*"]] + +Nothing shows up when I first used this directive. I found that I had to create a page for the tag for it to show up in pagestats. +I would rather not find and create a page for every tag I have created or will create. Is there an easier way to create a list of tags? + +Thanks + +---- -- cgit v1.2.3 From 3547a2a3474b2d5a97c4bc16ea29e81a013b1185 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Jan 2009 11:12:49 -0500 Subject: fix removal form display The form was misdisplayed when displayed via comment removal. --- IkiWiki/Plugin/remove.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm index 21989aff3..ee5784f20 100644 --- a/IkiWiki/Plugin/remove.pm +++ b/IkiWiki/Plugin/remove.pm @@ -218,7 +218,7 @@ sub sessioncgi ($$) { } } else { - IkiWiki::showform($form, $buttons, $session, $q); + removal_confirm($q, $session, 0, $q->param("page")); } exit 0; -- cgit v1.2.3 From b5309d2dd759872cc7db846a32c5f6bb61614669 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Jan 2009 11:20:13 -0500 Subject: Remove nonstandard css. Closes: #512378 --- debian/changelog | 1 + doc/style.css | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8bf45c30a..7f6605fbf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ ikiwiki (3.03) UNRELEASED; urgency=low * Avoid feeding decoded unicode to Term::ReadLine. Closes: 512169 * blogspam: Log spam info on failure. + * Remove nonstandard css. Closes: #512378 -- Joey Hess Sun, 18 Jan 2009 14:50:57 -0500 diff --git a/doc/style.css b/doc/style.css index 81a260afd..c61015890 100644 --- a/doc/style.css +++ b/doc/style.css @@ -339,11 +339,6 @@ input#searchbox { border: 2px solid; background-color: #dee; color: black; - - /* Nonstandard, but very nice. */ - opacity: 0.95; - -moz-opacity: 0.95; - filter: alpha(opacity=95); } /* Formbuilder styling */ -- cgit v1.2.3 From c174c955ec201485870ea49f0dd7f3615c573796 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Jan 2009 11:32:48 -0500 Subject: response --- doc/install/discussion.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/install/discussion.mdwn b/doc/install/discussion.mdwn index e77844de9..0e1a7f7af 100644 --- a/doc/install/discussion.mdwn +++ b/doc/install/discussion.mdwn @@ -203,3 +203,14 @@ When I try that command, BTW, it basically seems to find the same stuff I get wh This happens both on Ubuntu 8.04 and CentOS 5.1 Any help would be greatly appreciated... --kent + +> Bundle::IkiWiki is included in ikiwiki itself, so of course cpan.org +> does not know about it. +> +> If you can show me exactly what command you ran (the tested, working +> commands on the parent page?) and how it failed, I can try to debug +> your problem. +> +> The real question in my mind is why you'd want to do this at all when +> using Ubuntu, which incldues packages of ikiwiki and all its +> dependencies. --[[Joey]] -- cgit v1.2.3 From afc1f1d63f76bfcfea51ed4c6107d68566c3876e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Jan 2009 11:33:47 -0500 Subject: cleanup --- doc/sandbox.mdwn | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/doc/sandbox.mdwn b/doc/sandbox.mdwn index f1a27f819..7b8425843 100644 --- a/doc/sandbox.mdwn +++ b/doc/sandbox.mdwn @@ -1,13 +1,5 @@ This is the [[SandBox]], a page anyone can edit to try out ikiwiki. -hello - -testing 1..2..3!! - ----- - -I am testing the edit box provided through ikiwiki.cgi. - ---- Here's a paragraph. @@ -59,14 +51,6 @@ Bulleted list * four * five -* a new list - * with sub heads - * like this ------ - -## a level 2 heading -huh? - ---- [[!template id=note text="this is generated by the [[plugins/haiku]] plugin"]] @@ -86,7 +70,6 @@ The haiku will change after every save, mind you. * [![ikiwiki logo](http://ikiwiki.info/logo/ikiwiki.png)](http://ikiwiki.info) * plain old html link * [[foo]] -* WikiLink ----- -- cgit v1.2.3 From b4bbddbf3e3d8f188f161098166fb4a27207ad2b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Jan 2009 16:30:59 -0500 Subject: add human-readable error when unknown pagespec function is called It used to replace unknown functions with "0" when translating a pagespec. Instead, replace it with a FailReason object. This way, the pagespec will still evaluate as before (possibly successfully if other terminals exist), but a human-readable error will be shown if the result is displayed. Also, an empty pagespec used to be replaced with "0", to avoid a eval error. Also use a FailReason here. --- IkiWiki.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IkiWiki.pm b/IkiWiki.pm index ca483a111..4d8415ffd 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1729,7 +1729,7 @@ sub pagespec_translate ($) { $code.="IkiWiki::PageSpec::match_$1(\$page, ".safequote($2).", \@_)"; } else { - $code.=' 0'; + $code.="IkiWiki::FailReason->new(".safequote(qq{unknown function in pagespec "$word"}).")"; } } else { @@ -1738,7 +1738,7 @@ sub pagespec_translate ($) { } if (! length $code) { - $code=0; + $code="IkiWiki::FailReason->new('empty pagespec')"; } no warnings; -- cgit v1.2.3 From 7ceddcd067b72042e8fc9729498c1337657aeb67 Mon Sep 17 00:00:00 2001 From: kent Date: Tue, 20 Jan 2009 21:04:25 -0500 Subject: --- doc/install/discussion.mdwn | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/install/discussion.mdwn b/doc/install/discussion.mdwn index 0e1a7f7af..c1129a435 100644 --- a/doc/install/discussion.mdwn +++ b/doc/install/discussion.mdwn @@ -210,7 +210,21 @@ Any help would be greatly appreciated... --kent > If you can show me exactly what command you ran (the tested, working > commands on the parent page?) and how it failed, I can try to debug > your problem. -> + +Just today I noticed the "Bundle" subdirectory. What a moron I am! :-) Also, I misunderstood the PERL5LIB=`pwd` part -- +I glibly thought it indicated the sink for the installation of the modules, rather than the source, and I was running +the cpan command from another window in a different directory, and just spiraled down into error... + > The real question in my mind is why you'd want to do this at all when > using Ubuntu, which incldues packages of ikiwiki and all its -> dependencies. --[[Joey]] +> dependencies. --[[Joey]] + +For ubuntu 8.04: + + $ ikiwiki --version + ikiwiki version 2.32.3ubuntu2.1 + $ + +I was just trying to get the latest version. + +In any case, thanks for the help, and thanks for the superb software. I really like it a lot. -- cgit v1.2.3 From c88f823e4c43a22a16558d10f2db214483422960 Mon Sep 17 00:00:00 2001 From: kgjenkins Date: Wed, 21 Jan 2009 17:52:10 -0500 Subject: added version --- doc/sandbox.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sandbox.mdwn b/doc/sandbox.mdwn index 7b8425843..f160ad1d5 100644 --- a/doc/sandbox.mdwn +++ b/doc/sandbox.mdwn @@ -1,4 +1,4 @@ -This is the [[SandBox]], a page anyone can edit to try out ikiwiki. +This is the [[SandBox]], a page anyone can edit to try out ikiwiki (version [[!version ]]). ---- -- cgit v1.2.3 From 950137eb6c4b5a75a01724736423e41ab3896e45 Mon Sep 17 00:00:00 2001 From: Gabriel McManus Date: Mon, 7 Jul 2008 21:33:01 +1000 Subject: img: only provide alt text if it was specified if suitable alternate text is unknown, then it should not be given. empty alt text is suitable mainly for purely decorative images. (cherry picked from commit 3cd7f67f0cf894f4fd5ba16f68e82e4f7bdbfdc5) --- IkiWiki/Plugin/img.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index 5c580c03c..d295b833b 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -119,9 +119,9 @@ sub preprocess (@) { } my $imgtag=''.(exists $params{alt} ? $params{alt} : '').
 		' Date: Wed, 21 Jan 2009 23:01:37 -0500 Subject: add --- doc/todo/avatar.mdwn | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 doc/todo/avatar.mdwn diff --git a/doc/todo/avatar.mdwn b/doc/todo/avatar.mdwn new file mode 100644 index 000000000..3c2c712bb --- /dev/null +++ b/doc/todo/avatar.mdwn @@ -0,0 +1,43 @@ +[[!tag wishlist]] + +It would be nice if ikiwiki, particularly [[plugins/comments]] +supported user avatar icons. I was considering adding a directive for this, +as designed below. + +However, there is no *good* service for mapping openids to avatars -- +openavatar has many issues, including not supporting delegated openids, and +after trying it, I don't trust it to push users toward. +Perhaps instead ikiwiki could get the email address from the openid +provider, though I think the perl openid modules don't support the openid +2.x feature that allows that. + +At the moment, working on this doesn't feel like a good use of my time. +--[[Joey]] + +---- + +The directive displays a small avatar image for a user. Pass it the +email address, openid, or wiki username of the user. + + \[[!avatar user@example.com]] + \[[!avatar http://joey.kitenet.net/]] + \[[!avatar user]] + +The avatars are provided by various sites. For email addresses, it uses a +[gravatar](http://gravatar.com/). For openid, +[openavatar](http://www.openvatar.com/) is used. For a wiki username, the +user's email address is looked up and the gravatar for that user is +displayed. (Of course, the user has to have filled in their email address +on their Preferences page for that to work.) + +An optional second parameter can be included, containing additional +options to pass in the +[gravatar url](http://en.gravatar.com/site/implement/url). +For example, this asks for a smaller gravatar, and if a user does +not have a gravatar, uses a cute auto-generated "wavatar" avatar. + + \[[!gravatar user@example.com "size=40&default=wavatar"]] + +The `gravitar_options` setting in the setup file can be used to +specify additional options to pass. So for example if you want +to use wavatars everywhere, set it to "default=wavatar". -- cgit v1.2.3 From a2738b949a31228ee33e954cfa96b93ddc35f11c Mon Sep 17 00:00:00 2001 From: justin Date: Wed, 21 Jan 2009 23:03:08 -0500 Subject: Question about user tests --- doc/ikiwiki/directive/testpagespec/discussion.mdwn | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/ikiwiki/directive/testpagespec/discussion.mdwn diff --git a/doc/ikiwiki/directive/testpagespec/discussion.mdwn b/doc/ikiwiki/directive/testpagespec/discussion.mdwn new file mode 100644 index 000000000..572e4b183 --- /dev/null +++ b/doc/ikiwiki/directive/testpagespec/discussion.mdwn @@ -0,0 +1 @@ +How does one test a user identity? I tried "pagename and user(username) for the match, and had a "no user specified" error. -- cgit v1.2.3 From 7c67348882d78cffe7e573df6553d3cb1d356779 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Jan 2009 23:09:16 -0500 Subject: response --- doc/ikiwiki/directive/testpagespec/discussion.mdwn | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/ikiwiki/directive/testpagespec/discussion.mdwn b/doc/ikiwiki/directive/testpagespec/discussion.mdwn index 572e4b183..66c9a9ca9 100644 --- a/doc/ikiwiki/directive/testpagespec/discussion.mdwn +++ b/doc/ikiwiki/directive/testpagespec/discussion.mdwn @@ -1 +1,6 @@ How does one test a user identity? I tried "pagename and user(username) for the match, and had a "no user specified" error. + +> You can't test them with this directive, because such pagespecs test to +> see if logged in user, who is performing some action, matches. When the +> page with the directive is built, the concept of a user being logged in +> doesn't really apply. --[[Joey]] -- cgit v1.2.3 From d2579c0c12df0c6a8c11310ea64ad40bc9da6b8b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Jan 2009 23:12:44 -0500 Subject: one fleeting second thought --- doc/todo/avatar.mdwn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/todo/avatar.mdwn b/doc/todo/avatar.mdwn index 3c2c712bb..b8aa2327f 100644 --- a/doc/todo/avatar.mdwn +++ b/doc/todo/avatar.mdwn @@ -14,6 +14,10 @@ provider, though I think the perl openid modules don't support the openid At the moment, working on this doesn't feel like a good use of my time. --[[Joey]] +Hmm.. unless is just always used a single provider (gravatar) and hashed +the openid. Then wavatars could be used to get a unique avatar per openid +at least. --[[Joey]] + ---- The directive displays a small avatar image for a user. Pass it the -- cgit v1.2.3 From 89587a07f42626ef74853f95d039cf3857694210 Mon Sep 17 00:00:00 2001 From: justin Date: Wed, 21 Jan 2009 23:37:55 -0500 Subject: question on locked_pages and users() in pagespec --- doc/ikiwiki/pagespec/discussion.mdwn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/ikiwiki/pagespec/discussion.mdwn b/doc/ikiwiki/pagespec/discussion.mdwn index 0733c90c8..835546a6b 100644 --- a/doc/ikiwiki/pagespec/discussion.mdwn +++ b/doc/ikiwiki/pagespec/discussion.mdwn @@ -65,3 +65,7 @@ How can I fix this? --[[sabr]] > I don't see why that wouldn't work. Can I download the source to your > wiki from somewhere to investigate? --[[Joey]] + +---- + +Should negation work with user(), with locked_pages in setup? I experimented with setting locked_pages => 'user(someuser)' and was able to edit as a different user. However, setting locked_pages => '!user(someuser)' doesn't seem to allow edits for only 'someuser' - it locks out all users. -- cgit v1.2.3 From ede3962a540108aa055004bb3d7d5a673c500c89 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 22 Jan 2009 15:30:14 -0500 Subject: response --- doc/ikiwiki/pagespec/discussion.mdwn | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/ikiwiki/pagespec/discussion.mdwn b/doc/ikiwiki/pagespec/discussion.mdwn index 835546a6b..c8bdea3a0 100644 --- a/doc/ikiwiki/pagespec/discussion.mdwn +++ b/doc/ikiwiki/pagespec/discussion.mdwn @@ -68,4 +68,13 @@ How can I fix this? --[[sabr]] ---- -Should negation work with user(), with locked_pages in setup? I experimented with setting locked_pages => 'user(someuser)' and was able to edit as a different user. However, setting locked_pages => '!user(someuser)' doesn't seem to allow edits for only 'someuser' - it locks out all users. +Should negation work with user(), with locked_pages in setup? I +experimented with setting locked_pages => 'user(someuser)' and was able to +edit as a different user. However, setting locked_pages => +'!user(someuser)' doesn't seem to allow edits for only 'someuser' - it +locks out all users. + +> Negation works with anything in any PageSpec. I tested the case you +> describe, and a negated pagespec worked for me; all users except the +> listed user (and except wiki admins of course) were locked out. +> --[[Joey]] -- cgit v1.2.3 From 6fb0ab580eab0149288c1ab1e7b67f3b2c69ecce Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 22 Jan 2009 20:53:47 -0500 Subject: fix typo --- IkiWiki/Plugin/blogspam.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/blogspam.pm b/IkiWiki/Plugin/blogspam.pm index 8462a6d1d..c482a5ae1 100644 --- a/IkiWiki/Plugin/blogspam.pm +++ b/IkiWiki/Plugin/blogspam.pm @@ -93,7 +93,7 @@ sub checkcontent (@) { site => $config{url}, version => "ikiwiki ".$IkiWiki::version, }; - my $res = $client->send_request('testComment', %req); + my $res = $client->send_request('testComment', \%req); if (! ref $res || ! defined $res->value) { debug("failed to get response from blogspam server ($url)"); -- cgit v1.2.3 From e1ff06b634afe790fe7661898bb20d7077d93588 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 22 Jan 2009 20:58:49 -0500 Subject: fix uninitialized value warnings I suspect these are only triggered by spammers. --- IkiWiki/Plugin/comments.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 833bedf25..6d0e45a97 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -406,19 +406,19 @@ sub sessioncgi ($$) { if ($config{comments_allowauthor}) { my $author = $form->field('author'); - if (length $author) { + if (defined $author && length $author) { $author =~ s/"/"/g; $content .= " claimedauthor=\"$author\"\n"; } my $url = $form->field('url'); - if (length $url) { + if (defined $url && length $url) { $url =~ s/"/"/g; $content .= " url=\"$url\"\n"; } } my $subject = $form->field('subject'); - if (length $subject) { + if (defined $subject && length $subject) { $subject =~ s/"/"/g; $content .= " subject=\"$subject\"\n"; } -- cgit v1.2.3 From ef856a5f7a4c893dde5a893971e4686d4c30c8f4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 22 Jan 2009 21:10:05 -0500 Subject: typo --- IkiWiki/Plugin/blogspam.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IkiWiki/Plugin/blogspam.pm b/IkiWiki/Plugin/blogspam.pm index c482a5ae1..8552f3a1b 100644 --- a/IkiWiki/Plugin/blogspam.pm +++ b/IkiWiki/Plugin/blogspam.pm @@ -83,7 +83,7 @@ sub checkcontent (@) { # and "buy". push @options, "exclude=stopwords"; - my %req={ + my %req=( ip => $ENV{REMOTE_ADDR}, comment => $params{content}, subject => defined $params{subject} ? $params{subject} : "", @@ -92,7 +92,7 @@ sub checkcontent (@) { options => join(",", @options), site => $config{url}, version => "ikiwiki ".$IkiWiki::version, - }; + ); my $res = $client->send_request('testComment', \%req); if (! ref $res || ! defined $res->value) { -- cgit v1.2.3 From 65af0cceaaa5c23e6b3f9c204c540ccd00a456c6 Mon Sep 17 00:00:00 2001 From: justin Date: Thu, 22 Jan 2009 21:29:53 -0500 Subject: followup on pagespec negation --- doc/ikiwiki/pagespec/discussion.mdwn | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/ikiwiki/pagespec/discussion.mdwn b/doc/ikiwiki/pagespec/discussion.mdwn index c8bdea3a0..5788d4aed 100644 --- a/doc/ikiwiki/pagespec/discussion.mdwn +++ b/doc/ikiwiki/pagespec/discussion.mdwn @@ -78,3 +78,8 @@ locks out all users. > describe, and a negated pagespec worked for me; all users except the > listed user (and except wiki admins of course) were locked out. > --[[Joey]] + +>> It must be a local problem, then, cause I've tried it with two separate +>> machines. Both are running the most recent release of ikiwiki in +>> pkgsrc - 2.66. Perhaps an update to a newer version would solve the issue. + -- cgit v1.2.3 From 4a74d70ff5a864abe2d69b828f1faa0af08ef75f Mon Sep 17 00:00:00 2001 From: qiang Date: Fri, 23 Jan 2009 04:44:24 -0500 Subject: --- doc/sandbox.mdwn | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/sandbox.mdwn b/doc/sandbox.mdwn index f160ad1d5..f67fd6bb6 100644 --- a/doc/sandbox.mdwn +++ b/doc/sandbox.mdwn @@ -1,6 +1,7 @@ This is the [[SandBox]], a page anyone can edit to try out ikiwiki (version [[!version ]]). ---- +[[中文显示]] Here's a paragraph. -- cgit v1.2.3 From 54265c655c4ac3ef0899668827a8f757381087bd Mon Sep 17 00:00:00 2001 From: qiang Date: Fri, 23 Jan 2009 04:50:07 -0500 Subject: --- doc/sandbox.mdwn | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/sandbox.mdwn b/doc/sandbox.mdwn index f67fd6bb6..3fff2f0c5 100644 --- a/doc/sandbox.mdwn +++ b/doc/sandbox.mdwn @@ -1,6 +1,7 @@ This is the [[SandBox]], a page anyone can edit to try out ikiwiki (version [[!version ]]). ---- + [[中文显示]] Here's a paragraph. -- cgit v1.2.3 From 1c369f144098be90a63033237d75b3e7c9656ea9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Jan 2009 16:46:49 -0500 Subject: mention identica group --- doc/contact.mdwn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/contact.mdwn b/doc/contact.mdwn index 37fb59071..8eb8ce7ac 100644 --- a/doc/contact.mdwn +++ b/doc/contact.mdwn @@ -7,4 +7,5 @@ developers monitor [[RecentChanges]] closely, via the webpage, email, [CIA](http://cia.navi.cx), and IRC, and respond in a timely fashion. You could also drop by the IRC channel `#ikiwiki` on -[OFTC](http://www.oftc.net/) (`irc.oftc.net`). +[OFTC](http://www.oftc.net/) (`irc.oftc.net`), or use the +[identi.ca ikiwiki grouo](http://identi.ca/group/ikiwiki). -- cgit v1.2.3 From 7bdc8896df065e34e624f847d4629d4b7850a92e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Jan 2009 20:08:52 -0500 Subject: typo --- doc/contact.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/contact.mdwn b/doc/contact.mdwn index 8eb8ce7ac..486a4d186 100644 --- a/doc/contact.mdwn +++ b/doc/contact.mdwn @@ -8,4 +8,4 @@ developers monitor [[RecentChanges]] closely, via the webpage, email, You could also drop by the IRC channel `#ikiwiki` on [OFTC](http://www.oftc.net/) (`irc.oftc.net`), or use the -[identi.ca ikiwiki grouo](http://identi.ca/group/ikiwiki). +[identi.ca ikiwiki group](http://identi.ca/group/ikiwiki). -- cgit v1.2.3 From 1f87dd2c7d3a2c8171725e55341a91b45ca054ba Mon Sep 17 00:00:00 2001 From: qiang Date: Sat, 24 Jan 2009 12:37:53 -0500 Subject: --- doc/forum/chinese_character_problem.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/forum/chinese_character_problem.mdwn diff --git a/doc/forum/chinese_character_problem.mdwn b/doc/forum/chinese_character_problem.mdwn new file mode 100644 index 000000000..950383348 --- /dev/null +++ b/doc/forum/chinese_character_problem.mdwn @@ -0,0 +1,9 @@ +just finished setting up ikiwiki.. + +I can type chinese, save and display it correctly in ikiwiki for the first time. However, when i try to edit the page again, the chinese character in the form is unrecognizable. you can see it here + +I am using the latest ikiwiki(manually installed as non-root user) and CGI::FormBuilder(3.0501) on Debian 4.0 + +这个没问题 it is not a problem on ikiwiki website though. + +Thanks. -- cgit v1.2.3 From a6eb921b9dfdfe8b1299b354885a0ee1dbe90a9c Mon Sep 17 00:00:00 2001 From: "http://joey.kitenet.net/" Date: Sat, 24 Jan 2009 12:43:32 -0500 Subject: --- doc/forum/chinese_character_problem.mdwn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/forum/chinese_character_problem.mdwn b/doc/forum/chinese_character_problem.mdwn index 950383348..fed1fcd82 100644 --- a/doc/forum/chinese_character_problem.mdwn +++ b/doc/forum/chinese_character_problem.mdwn @@ -7,3 +7,7 @@ I am using the latest ikiwiki(manually installed as non-root user) and CGI::Form 这个没问题 it is not a problem on ikiwiki website though. Thanks. + + +> Is your system perhaps not configured with a utf-8 default locale? Or ikiwiki not configured to use it? +> Make sure that some utf-8 locale is enabled (in /etc/locale.gen on Debian for example) and try setting `locale` in your > ikiwiki setup file. --[[Joey]] -- cgit v1.2.3 From caa6a784b06078105944ff143efdf2e2829a161a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Jan 2009 13:04:59 -0500 Subject: clarify description of verbose It enables debug prints, so not just during building, but at runtime. --- IkiWiki.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IkiWiki.pm b/IkiWiki.pm index 4d8415ffd..66fea4369 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -174,7 +174,7 @@ sub getsetup () { verbose => { type => "boolean", example => 1, - description => "display verbose messages when building?", + description => "display verbose messages?", safe => 1, rebuild => 0, }, -- cgit v1.2.3 From 31a6f1735cf98a565a82b7cc720d6b2e8e49ad13 Mon Sep 17 00:00:00 2001 From: Rocco Date: Sun, 25 Jan 2009 03:39:52 -0500 Subject: vote for Template::Toolkit --- doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn b/doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn index 3b9f6c0fd..c4e78ca0b 100644 --- a/doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn +++ b/doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn @@ -56,3 +56,5 @@ the templates. I'd prefer not having to touch Perl though... Yes, Template::Toolkit is very powerful. But I think it's somehow overkill for a wiki. HTML::Template can keep things simple, though. --[weakish](http://weakish.int.eu.org/blog/) I'd have to agree that Template::Toolkit is overkill and personally I'm not a fan, but it is very popular (there is even a book) and the new version (3) is alleged to be much more nimble than current version. --[[ajt]] + +HTML::Template's HTML-like markup prevents me from editing templates in KompoZer or other WYSIWYG HTML editors. The editor tries to render the template markup rather than display it verbatim, and large parts of the template become invisible. A markup syntax that doesn't confuse editors (such as Template::Toolkit's "[% FOO %]") may promote template customization. The ability to replace the template engine would be within the spirit of ikiwiki's extensibility. --Rocco -- cgit v1.2.3 From ee74e61ffc6fa589361a080a2c1476b0fe5afaa3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 25 Jan 2009 14:37:04 -0500 Subject: blogspam: Fix use of blogspam_options and blogspam_server config settings. --- IkiWiki/Plugin/blogspam.pm | 6 +++--- debian/changelog | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/IkiWiki/Plugin/blogspam.pm b/IkiWiki/Plugin/blogspam.pm index 8552f3a1b..cbd9859a5 100644 --- a/IkiWiki/Plugin/blogspam.pm +++ b/IkiWiki/Plugin/blogspam.pm @@ -62,11 +62,11 @@ sub checkcontent (@) { } my $url=$defaulturl; - $url = $params{blogspam_server} if exists $params{blogspam_server}; + $url = $config{blogspam_server} if exists $config{blogspam_server}; my $client = RPC::XML::Client->new($url); - my @options = split(",", $params{blogspam_options}) - if exists $params{blogspam_options}; + my @options = split(",", $config{blogspam_options}) + if exists $config{blogspam_options}; # Allow short comments and whitespace-only edits, unless the user # has overridden min-words themselves. diff --git a/debian/changelog b/debian/changelog index 7f6605fbf..96089c101 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,10 @@ ikiwiki (3.03) UNRELEASED; urgency=low * Avoid feeding decoded unicode to Term::ReadLine. Closes: 512169 - * blogspam: Log spam info on failure. + * blogspam: Log spam info on failure in debug mode. * Remove nonstandard css. Closes: #512378 + * blogspam: Fix use of blogspam_options and blogspam_server + config settings. -- Joey Hess Sun, 18 Jan 2009 14:50:57 -0500 -- cgit v1.2.3 From c154fa5d6cd1620be7b139b08040740a1bdfafbc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 25 Jan 2009 15:42:13 -0500 Subject: comments: If comment content checks fail, store the comment (in .ikiwiki/comments_pending) for moderator review. --- IkiWiki/Plugin/comments.pm | 43 +++++++++++++++++++++++++++++++------------ IkiWiki/Plugin/editpage.pm | 5 +++-- debian/changelog | 2 ++ doc/plugins/comments.mdwn | 7 +++++++ 4 files changed, 43 insertions(+), 14 deletions(-) diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 6d0e45a97..4d225b90a 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -380,14 +380,7 @@ sub sessioncgi ($$) { IkiWiki::check_canedit($page, $cgi, $session); $postcomment=0; - # FIXME: rather a simplistic way to make the comments... - my $i = 0; - my $file; - my $location; - do { - $i++; - $location = "$page/$config{comments_pagename}$i"; - } while (-e "$config{srcdir}/$location._comment"); + my $location=unique_comment_location($page, $config{srcdir}); my $content = "[[!_comment format=$type\n"; @@ -470,21 +463,33 @@ sub sessioncgi ($$) { IkiWiki::checksessionexpiry($cgi, $session); $postcomment=1; - IkiWiki::check_content(content => $form->field('editcontent'), + my $ok=IkiWiki::check_content(content => $form->field('editcontent'), subject => $form->field('subject'), $config{comments_allowauthor} ? ( author => $form->field('author'), url => $form->field('url'), ) : (), page => $location, - cgi => $cgi, session => $session + cgi => $cgi, + session => $session, + nonfatal => 1, ); $postcomment=0; - - my $file = "$location._comment"; + + if (! $ok) { + my $penddir=$config{wikistatedir}."/comments_pending"; + $location=unique_comment_location($page, $penddir); + writefile("$location._comment", $penddir, $content); + print IkiWiki::misctemplate(gettext(gettext("comment stored for moderation")), + "

". + gettext("Your comment will be posted after moderator review"), + "

"); + exit; + } # FIXME: could probably do some sort of graceful retry # on error? Would require significant unwinding though + my $file = "$location._comment"; writefile($file, $config{srcdir}, $content); my $conflict; @@ -654,6 +659,20 @@ sub pagetemplate (@) { } } +sub unique_comment_location ($) { + my $page=shift; + my $dir=shift; + + my $location; + my $i = 0; + do { + $i++; + $location = "$page/$config{comments_pagename}$i"; + } while (-e "$dir/$location._comment"); + + return $location; +} + package IkiWiki::PageSpec; sub match_postcomment ($$;@) { diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index bba52e4fd..c206d96a4 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -105,11 +105,12 @@ sub check_content (@) { $ok=1; } elsif (ref $ret eq 'CODE') { - $ret->(); + $ret->() unless $params{nonfatal}; $ok=0; } elsif (defined $ret) { - error($ret); + error($ret) unless $params{nonfatal}; + $ok=0; } } diff --git a/debian/changelog b/debian/changelog index 96089c101..002ae12c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ ikiwiki (3.03) UNRELEASED; urgency=low * Remove nonstandard css. Closes: #512378 * blogspam: Fix use of blogspam_options and blogspam_server config settings. + * comments: If comment content checks fail, store the comment + (in .ikiwiki/comments_pending) for moderator review. -- Joey Hess Sun, 18 Jan 2009 14:50:57 -0500 diff --git a/doc/plugins/comments.mdwn b/doc/plugins/comments.mdwn index 72b11af64..4cee3b9ad 100644 --- a/doc/plugins/comments.mdwn +++ b/doc/plugins/comments.mdwn @@ -41,3 +41,10 @@ There are some global options for the setup file: specify a name for themselves, and the \[[!meta author]] and \[[!meta authorurl]] directives will not be overridden by the comments plugin + +## 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. -- cgit v1.2.3 From fe8dc7fa4228caa0fdd377d4bb9d733a81de7b5b Mon Sep 17 00:00:00 2001 From: GünterLadwig Date: Sun, 25 Jan 2009 16:34:27 -0500 Subject: --- doc/ikiwiki/pagespec/discussion.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/ikiwiki/pagespec/discussion.mdwn b/doc/ikiwiki/pagespec/discussion.mdwn index 5788d4aed..4eed3722c 100644 --- a/doc/ikiwiki/pagespec/discussion.mdwn +++ b/doc/ikiwiki/pagespec/discussion.mdwn @@ -83,3 +83,12 @@ locks out all users. >> machines. Both are running the most recent release of ikiwiki in >> pkgsrc - 2.66. Perhaps an update to a newer version would solve the issue. +---- + +Is there a way to refer to all subpages of the current page, if the name of the +current page is not known (i.e. the pagespec is used in a template)? The ./ syntax +does not seem suitable for this, as + +> \[[!map pages="./*"]] + +also lists the current page and all its siblings. -- cgit v1.2.3 From f71abc92aa279fbe0b7578b8c4752d775dd4a259 Mon Sep 17 00:00:00 2001 From: GünterLadwig Date: Sun, 25 Jan 2009 16:37:32 -0500 Subject: --- doc/ikiwiki/pagespec/discussion.mdwn | 9 --------- 1 file changed, 9 deletions(-) diff --git a/doc/ikiwiki/pagespec/discussion.mdwn b/doc/ikiwiki/pagespec/discussion.mdwn index 4eed3722c..5788d4aed 100644 --- a/doc/ikiwiki/pagespec/discussion.mdwn +++ b/doc/ikiwiki/pagespec/discussion.mdwn @@ -83,12 +83,3 @@ locks out all users. >> machines. Both are running the most recent release of ikiwiki in >> pkgsrc - 2.66. Perhaps an update to a newer version would solve the issue. ----- - -Is there a way to refer to all subpages of the current page, if the name of the -current page is not known (i.e. the pagespec is used in a template)? The ./ syntax -does not seem suitable for this, as - -> \[[!map pages="./*"]] - -also lists the current page and all its siblings. -- cgit v1.2.3 From d5cd8312189039e61a38192db7d95e06f4c06bce Mon Sep 17 00:00:00 2001 From: GuenterLadwig Date: Sun, 25 Jan 2009 16:40:29 -0500 Subject: --- doc/ikiwiki/pagespec/discussion.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/ikiwiki/pagespec/discussion.mdwn b/doc/ikiwiki/pagespec/discussion.mdwn index 5788d4aed..4eed3722c 100644 --- a/doc/ikiwiki/pagespec/discussion.mdwn +++ b/doc/ikiwiki/pagespec/discussion.mdwn @@ -83,3 +83,12 @@ locks out all users. >> machines. Both are running the most recent release of ikiwiki in >> pkgsrc - 2.66. Perhaps an update to a newer version would solve the issue. +---- + +Is there a way to refer to all subpages of the current page, if the name of the +current page is not known (i.e. the pagespec is used in a template)? The ./ syntax +does not seem suitable for this, as + +> \[[!map pages="./*"]] + +also lists the current page and all its siblings. -- cgit v1.2.3 From 4f098cfd05654b106e52015f0b302c56cafe3b62 Mon Sep 17 00:00:00 2001 From: GuenterLadwig Date: Sun, 25 Jan 2009 16:41:24 -0500 Subject: --- doc/sandbox.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sandbox.mdwn b/doc/sandbox.mdwn index 3fff2f0c5..a39264e18 100644 --- a/doc/sandbox.mdwn +++ b/doc/sandbox.mdwn @@ -1,7 +1,7 @@ This is the [[SandBox]], a page anyone can edit to try out ikiwiki (version [[!version ]]). ---- - +test [[中文显示]] Here's a paragraph. -- cgit v1.2.3 From 8129266dadac7f5e15a7d166f0e52897c915cabb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 25 Jan 2009 17:51:00 -0500 Subject: add alt tag --- doc/news/code_swarm.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/news/code_swarm.mdwn b/doc/news/code_swarm.mdwn index bdc373432..09b68523e 100644 --- a/doc/news/code_swarm.mdwn +++ b/doc/news/code_swarm.mdwn @@ -1,7 +1,7 @@ I've produced a [code_swarm](http://vis.cs.ucdavis.edu/~ogawa/codeswarm/) visualization of the first 2+ years of ikiwiki's commit history. -[[!img screenshot.png size="480x360"]] +[[!img screenshot.png size="480x360" alt="screenshot"]] * [15 mb avi](http://kitenet.net/~joey/screencasts/ikiwiki_swarm.avi) * [stream on vimeo](http://vimeo.com/1324348) -- cgit v1.2.3 From 2ecb9e8e797d14dbb65c8ad71afb485d89bb6757 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 25 Jan 2009 18:35:18 -0500 Subject: remove hr under comment actions The horizontal line was only meant to be displayed under the actions at the top of a page. --- doc/style.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/style.css b/doc/style.css index c61015890..a6e6734e3 100644 --- a/doc/style.css +++ b/doc/style.css @@ -23,6 +23,8 @@ margin: 0; padding: 6px; list-style-type: none; +} +.pageheader .actions ul { border-bottom: 1px solid #000; } -- cgit v1.2.3 From 731fc9e7a2ce818f0b7069cf0353931ec2dc8b43 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 25 Jan 2009 18:49:57 -0500 Subject: comments: Add a moderation web interface. --- IkiWiki/Plugin/comments.pm | 196 +++++++++++++++++++++++++++++++++------ debian/changelog | 1 + templates/commentmoderation.tmpl | 23 +++++ 3 files changed, 193 insertions(+), 27 deletions(-) create mode 100644 templates/commentmoderation.tmpl diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 4d225b90a..388a983f7 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -134,8 +134,8 @@ sub preprocess { } # no need to bother with htmlize if it's just HTML - $content = IkiWiki::htmlize($page, $params{destpage}, $format, - $content) if defined $format; + $content = IkiWiki::htmlize($page, $params{destpage}, $format, $content) + if defined $format; IkiWiki::run_hooks(sanitize => sub { $content = shift->( @@ -263,13 +263,23 @@ sub linkcgi ($) { } } -# Mostly cargo-culted from IkiWiki::plugin::editpage sub sessioncgi ($$) { my $cgi=shift; my $session=shift; my $do = $cgi->param('do'); - return unless $do eq 'comment'; + if ($do eq 'comment') { + editcomment($cgi, $session); + } + elsif ($do eq 'commentmoderation') { + commentmoderation($cgi, $session); + } +} + +# Mostly cargo-culted from IkiWiki::plugin::editpage +sub editcomment ($$) { + my $cgi=shift; + my $session=shift; IkiWiki::decode_cgi_utf8($cgi); @@ -431,29 +441,8 @@ sub sessioncgi ($$) { # - this means that if they do, rocks fall and everyone dies if ($form->submitted eq PREVIEW) { - my $preview = IkiWiki::htmlize($location, $page, '_comment', - IkiWiki::linkify($location, $page, - IkiWiki::preprocess($location, $page, - IkiWiki::filter($location, - $page, $content), - 0, 1))); - IkiWiki::run_hooks(format => sub { - $preview = shift->(page => $page, - content => $preview); - }); - - my $template = template("comment.tmpl"); - $template->param(content => $preview); - $template->param(title => $form->field('subject')); - $template->param(ctime => displaytime(time)); - - IkiWiki::run_hooks(pagetemplate => sub { - shift->(page => $location, - destpage => $page, - template => $template); - }); - - $form->tmpl_param(page_preview => $template->output); + $form->tmpl_param(page_preview => + previewcomment($content, $location, $page, time)); } else { $form->tmpl_param(page_preview => ""); @@ -480,6 +469,7 @@ sub sessioncgi ($$) { my $penddir=$config{wikistatedir}."/comments_pending"; $location=unique_comment_location($page, $penddir); writefile("$location._comment", $penddir, $content); + IkiWiki::printheader($session); print IkiWiki::misctemplate(gettext(gettext("comment stored for moderation")), "

". gettext("Your comment will be posted after moderator review"), @@ -534,6 +524,158 @@ sub sessioncgi ($$) { exit; } +sub commentmoderation ($$) { + my $cgi=shift; + my $session=shift; + + IkiWiki::needsignin($cgi, $session); + if (! IkiWiki::is_admin($session->param("name"))) { + error(gettext("you are not logged in as an admin")); + } + + IkiWiki::decode_cgi_utf8($cgi); + + if (defined $cgi->param('sid')) { + IkiWiki::checksessionexpiry($cgi, $session); + + my %vars=$cgi->Vars; + my $added=0; + foreach my $id (keys %vars) { + if ($id =~ /(.*)\Q._comment\E$/) { + my $action=$cgi->param($id); + next if $action eq 'Defer'; + + # Make sure that the id is of a legal + # pending comment before untainting. + my ($f)= $id =~ /$config{wiki_file_regexp}/; + if (! defined $f || ! length $f || + IkiWiki::file_pruned($f, $config{srcdir})) { + error("illegal file"); + } + + my $page=IkiWiki::possibly_foolish_untaint(IkiWiki::dirname($1)); + my $file="$config{wikistatedir}/comments_pending/". + IkiWiki::possibly_foolish_untaint($id); + + if ($action eq 'Accept') { + my $content=eval { readfile($file) }; + next if $@; # file vanished since form was displayed + my $dest=unique_comment_location($page, $config{srcdir})."._comment"; + writefile($dest, $config{srcdir}, $content); + if ($config{rcs} and $config{comments_commit}) { + IkiWiki::rcs_add($dest); + } + $added++; + } + + # This removes empty subdirs, so the + # .ikiwiki/comments_pending dir will + # go away when all are moderated. + require IkiWiki::Render; + IkiWiki::prune($file); + } + } + + if ($added) { + my $conflict; + if ($config{rcs} and $config{comments_commit}) { + my $message = gettext("Comment moderation"); + IkiWiki::disable_commit_hook(); + $conflict=IkiWiki::rcs_commit_staged($message, + $session->param('name'), $ENV{REMOTE_ADDR}); + IkiWiki::enable_commit_hook(); + IkiWiki::rcs_update(); + } + + # Now we need a refresh + require IkiWiki::Render; + IkiWiki::refresh(); + IkiWiki::saveindex(); + + error($conflict) if defined $conflict; + } + } + + my @comments=map { + my $id=$_; + my $file="$config{wikistatedir}/comments_pending/$id"; + my $content=readfile($file); + my $ctime=(stat($file))[10]; + { + id => $id, + view => previewcomment($content, $id, + IkiWiki::dirname($_), $ctime), + } + } comments_pending(); + + my $template=template("commentmoderation.tmpl"); + $template->param( + sid => $session->id, + comments => \@comments, + ); + IkiWiki::printheader($session); + print IkiWiki::misctemplate(gettext("comment moderation"), $template->output); + exit; +} + +sub comments_pending () { + my $dir="$config{wikistatedir}/comments_pending/"; + return unless -d $dir; + + my @ret; + eval q{use File::Find}; + error($@) if $@; + find({ + no_chdir => 1, + wanted => sub { + $_=decode_utf8($_); + if (IkiWiki::file_pruned($_, $dir)) { + $File::Find::prune=1; + } + elsif (! -l $_ && ! -d _) { + $File::Find::prune=0; + my ($f)=/$config{wiki_file_regexp}/; # untaint + if (defined $f && $f =~ /\Q._comment\E$/) { + $f=~s/^\Q$dir\E\/?//; + push @ret, $f; + } + } + } + }, $dir); + + return @ret; +} + +sub previewcomment ($$$) { + my $content=shift; + my $location=shift; + my $page=shift; + my $time=shift; + + my $preview = IkiWiki::htmlize($location, $page, '_comment', + IkiWiki::linkify($location, $page, + IkiWiki::preprocess($location, $page, + IkiWiki::filter($location, + $page, $content), + 0, 1))); + IkiWiki::run_hooks(format => sub { + $preview = shift->(page => $page, + content => $preview); + }); + + my $template = template("comment.tmpl"); + $template->param(content => $preview); + $template->param(ctime => displaytime($time)); + + IkiWiki::run_hooks(pagetemplate => sub { + shift->(page => $location, + destpage => $page, + template => $template); + }); + + return $template->output; +} + sub commentsshown ($) { my $page=shift; diff --git a/debian/changelog b/debian/changelog index 002ae12c1..c9ebcd1e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ ikiwiki (3.03) UNRELEASED; urgency=low config settings. * comments: If comment content checks fail, store the comment (in .ikiwiki/comments_pending) for moderator review. + * comments: Add a moderation web interface. -- Joey Hess Sun, 18 Jan 2009 14:50:57 -0500 diff --git a/templates/commentmoderation.tmpl b/templates/commentmoderation.tmpl new file mode 100644 index 000000000..3dadb791b --- /dev/null +++ b/templates/commentmoderation.tmpl @@ -0,0 +1,23 @@ + +
+

+ + + +
+
+ +
+Defer +Accept +Reject +
+
+
+ +
+ +

+No comments need moderation at this time. +

+ -- cgit v1.2.3 From 9a5085e5126d1f76d28a4438b1527659183477b5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 25 Jan 2009 18:56:47 -0500 Subject: clean up comment preview Remove actions from it, and avoid a broken title link. --- IkiWiki/Plugin/comments.pm | 2 ++ templates/comment.tmpl | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 388a983f7..ad5395a82 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -673,6 +673,8 @@ sub previewcomment ($$$) { template => $template); }); + $template->param(have_actions => 0); + return $template->output; } diff --git a/templates/comment.tmpl b/templates/comment.tmpl index 582efccb8..b4f235845 100644 --- a/templates/comment.tmpl +++ b/templates/comment.tmpl @@ -1,6 +1,12 @@
-
+
+ + + + + +
-- 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(-) 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 From 4e21af767175cdf19143b0b0776e111de3253103 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 25 Jan 2009 19:45:56 -0500 Subject: sort comment queue by time, newest first --- IkiWiki/Plugin/comments.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index c95f77a42..f0b67a9eb 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -598,7 +598,7 @@ sub commentmoderation ($$) { } my @comments=map { - my $id=$_; + my ($id, $ctime)=@{$_}; my $file="$config{wikistatedir}/comments_pending/$id"; my $content=readfile($file); my $ctime=(stat($file))[10]; @@ -607,7 +607,7 @@ sub commentmoderation ($$) { view => previewcomment($content, $id, IkiWiki::dirname($_), $ctime), } - } comments_pending(); + } sort { $b->[1] <=> $a->[1] } comments_pending(); my $template=template("commentmoderation.tmpl"); $template->param( @@ -649,8 +649,9 @@ sub comments_pending () { $File::Find::prune=0; my ($f)=/$config{wiki_file_regexp}/; # untaint if (defined $f && $f =~ /\Q._comment\E$/) { + my $ctime=(stat($f))[10]; $f=~s/^\Q$dir\E\/?//; - push @ret, $f; + push @ret, [$f, $ctime]; } } } -- cgit v1.2.3 From 9d4f396b1353d58c6b526818b69ada459b1be24c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 25 Jan 2009 22:25:45 -0500 Subject: add reject all marked defer checkbox --- IkiWiki/Plugin/comments.pm | 17 ++++++++--------- templates/commentmoderation.tmpl | 12 +++++++++--- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index f0b67a9eb..32f3712f2 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -539,12 +539,14 @@ sub commentmoderation ($$) { if (defined $cgi->param('sid')) { IkiWiki::checksessionexpiry($cgi, $session); + my $rejectalldefer=$cgi->param('rejectalldefer'); + my %vars=$cgi->Vars; my $added=0; foreach my $id (keys %vars) { if ($id =~ /(.*)\Q._comment\E$/) { my $action=$cgi->param($id); - next if $action eq 'Defer'; + next if $action eq 'Defer' && ! $rejectalldefer; # Make sure that the id is of a legal # pending comment before untainting. @@ -601,7 +603,6 @@ sub commentmoderation ($$) { my ($id, $ctime)=@{$_}; my $file="$config{wikistatedir}/comments_pending/$id"; my $content=readfile($file); - my $ctime=(stat($file))[10]; { id => $id, view => previewcomment($content, $id, @@ -668,14 +669,12 @@ sub previewcomment ($$$) { my $preview = IkiWiki::htmlize($location, $page, '_comment', IkiWiki::linkify($location, $page, - IkiWiki::preprocess($location, $page, - IkiWiki::filter($location, - $page, $content), - 0, 1))); + IkiWiki::preprocess($location, $page, + IkiWiki::filter($location, $page, $content), 0, 1))); IkiWiki::run_hooks(format => sub { - $preview = shift->(page => $page, - content => $preview); - }); + $preview = shift->(page => $page, + content => $preview); + }); my $template = template("comment.tmpl"); $template->param(content => $preview); diff --git a/templates/commentmoderation.tmpl b/templates/commentmoderation.tmpl index 3dadb791b..e91d3146d 100644 --- a/templates/commentmoderation.tmpl +++ b/templates/commentmoderation.tmpl @@ -3,18 +3,24 @@
+ +Reject +all comments marked Defer +
-Defer -Accept -Reject +Defer +Accept +Reject

+Reject +all comments marked Defer

-- cgit v1.2.3 From 42b3e13739ccf67e3867c8e6864a2afdafa61c4a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 25 Jan 2009 22:30:28 -0500 Subject: format moderation queue only at end, avoid O(N^3) bug It was calling format hooks for each comment on the page. When relativedate is enabled, that made it insert