summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Bundle/IkiWiki/Extras.pm1
-rwxr-xr-x[-rw-r--r--]IkiWiki/Plugin/comments.pm39
-rw-r--r--debian/changelog6
-rw-r--r--debian/control3
-rw-r--r--doc/bugs/po:_double_commits_of_po_files.mdwn3
-rw-r--r--doc/bugs/po:_markdown_link_parse_bug.mdwn5
-rw-r--r--doc/bugs/po:_po_files_instead_of_html_files.mdwn6
-rw-r--r--doc/git.mdwn2
-rw-r--r--doc/rcs.mdwn2
-rw-r--r--doc/style.css3
-rw-r--r--doc/todo/avatar.mdwn40
-rw-r--r--doc/todo/mirrorlist_with_per-mirror_usedirs_settings.mdwn11
-rw-r--r--templates/comment.tmpl5
13 files changed, 86 insertions, 40 deletions
diff --git a/Bundle/IkiWiki/Extras.pm b/Bundle/IkiWiki/Extras.pm
index 8b97d893d..30bc8eee4 100644
--- a/Bundle/IkiWiki/Extras.pm
+++ b/Bundle/IkiWiki/Extras.pm
@@ -34,6 +34,7 @@ Text::WikiCreole
Term::ReadLine::Gnu
HTML::Tree
Sort::Naturally
+Gravatar::URL
=head1 AUTHOR
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index 8d46ed579..9fb81d15a 100644..100755
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -200,6 +200,7 @@ sub preprocess {
$commentstate{$page}{commentip} = $commentip;
$commentstate{$page}{commentauthor} = $commentauthor;
$commentstate{$page}{commentauthorurl} = $commentauthorurl;
+ $commentstate{$page}{commentauthoravatar} = $params{avatar};
if (! defined $pagestate{$page}{meta}{author}) {
$pagestate{$page}{meta}{author} = $commentauthor;
}
@@ -216,7 +217,7 @@ sub preprocess {
my $url=$params{url};
eval q{use URI::Heuristic};
- if (! $@) {
+ if (! $@) {
$url=URI::Heuristic::uf_uristr($url);
}
@@ -438,6 +439,12 @@ sub editcomment ($$) {
}
}
+ my $avatar=getavatar($session->param('name'));
+ if (defined $avatar && length $avatar) {
+ $avatar =~ s/"/"/g;
+ $content .= " avatar=\"$avatar\"\n";
+ }
+
my $subject = $form->field('subject');
if (defined $subject && length $subject) {
$subject =~ s/"/"/g;
@@ -561,6 +568,31 @@ sub editcomment ($$) {
exit;
}
+sub getavatar ($) {
+ my $user=shift;
+
+ my $avatar;
+ eval q{use Libravatar::URL};
+ if (! $@) {
+ my $oiduser = eval { IkiWiki::openiduser($user) };
+ my $https=defined $config{url} && $config{url}=~/^https:/;
+
+ if (defined $oiduser) {
+ eval {
+ $avatar = libravatar_url(openid => $user, https => $https);
+ }
+ }
+ if (! defined $avatar &&
+ (my $email = IkiWiki::userinfo_get($user, 'email'))) {
+ eval {
+ $avatar = libravatar_url(email => $email, https => $https);
+ }
+ }
+ }
+ return $avatar;
+}
+
+
sub commentmoderation ($$) {
my $cgi=shift;
my $session=shift;
@@ -874,6 +906,11 @@ sub pagetemplate (@) {
$commentstate{$page}{commentauthorurl});
}
+ if ($template->query(name => 'commentauthoravatar')) {
+ $template->param(commentauthoravatar =>
+ $commentstate{$page}{commentauthoravatar});
+ }
+
if ($template->query(name => 'removeurl') &&
IkiWiki::Plugin::remove->can("check_canremove") &&
length $config{cgiurl}) {
diff --git a/debian/changelog b/debian/changelog
index db6f95f43..dffad9aec 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,12 @@ ikiwiki (3.20110329) UNRELEASED; urgency=low
* meta: Allow adding javascript to pages. Only when htmlscrubber is
disabled, naturally. (Thanks, Giuseppe Bilotta)
+ * comments: Add avatar picture of comment author, using Libravatar::URL
+ when available. The avatar is looked up based on the user's openid,
+ or email address. (Thanks, Francois Marier)
+ * Recommend libgravatar-url-perl, which contains Libravatar::URL.
+ * monotone: Implement rcs_getmtime, and work around a problem with monotone
+ 0.48 that affects rcs_getctime. (Thanks, Richard Levitte)
-- Joey Hess <joeyh@debian.org> Mon, 28 Mar 2011 13:08:23 -0400
diff --git a/debian/control b/debian/control
index b98f0e0c7..4fd554d7d 100644
--- a/debian/control
+++ b/debian/control
@@ -27,7 +27,8 @@ Recommends: gcc | c-compiler,
libxml-simple-perl, libnet-openid-consumer-perl,
liblwpx-paranoidagent-perl, libtimedate-perl,
libcgi-formbuilder-perl (>= 3.05), libcgi-session-perl (>= 4.14-1),
- libmail-sendmail-perl, libauthen-passphrase-perl, libterm-readline-gnu-perl
+ libmail-sendmail-perl, libauthen-passphrase-perl, libterm-readline-gnu-perl,
+ libgravatar-url-perl
Suggests: viewvc | gitweb | viewcvs, libsearch-xapian-perl,
xapian-omega (>= 1.0.5), librpc-xml-perl, libtext-wikiformat-perl,
python, python-docutils, polygen, tidy, libhtml-tree-perl,
diff --git a/doc/bugs/po:_double_commits_of_po_files.mdwn b/doc/bugs/po:_double_commits_of_po_files.mdwn
index a871785be..2f3015e2b 100644
--- a/doc/bugs/po:_double_commits_of_po_files.mdwn
+++ b/doc/bugs/po:_double_commits_of_po_files.mdwn
@@ -17,3 +17,6 @@ update. --[[Joey]]
>> their mailing-list:
>> [post archive](http://lists.alioth.debian.org/pipermail/po4a-devel/2010-July/001897.html).
>> --[[intrigeri]]
+
+>>> Seems to me Debian Squeeze's po4a does not expose this bug anymore
+>>> => [[done]]. --[[intrigeri]]
diff --git a/doc/bugs/po:_markdown_link_parse_bug.mdwn b/doc/bugs/po:_markdown_link_parse_bug.mdwn
index 10715001c..98da7fd24 100644
--- a/doc/bugs/po:_markdown_link_parse_bug.mdwn
+++ b/doc/bugs/po:_markdown_link_parse_bug.mdwn
@@ -12,3 +12,8 @@ file:
"\"Ikiwiki hosting\") when I signed up."
--[[Joey]]
+
+> I cannot reproduce this on my Squeeze system with ikiwiki Git code;
+> both the page in the master language and translation pages perfectly
+> display the link (and tooltip) in my testing environment. Were you
+> using an oldest po4a, such as Lenny's one? --[[intrigeri]]
diff --git a/doc/bugs/po:_po_files_instead_of_html_files.mdwn b/doc/bugs/po:_po_files_instead_of_html_files.mdwn
index 8238f50df..33b8982ba 100644
--- a/doc/bugs/po:_po_files_instead_of_html_files.mdwn
+++ b/doc/bugs/po:_po_files_instead_of_html_files.mdwn
@@ -20,3 +20,9 @@ When i click on "templates.fr", i get the po.file instead of html.
},
# slave languages (PO files)
po_slave_languages => [qw{fr|Français}],
+
+>>> I've never found any `.po` file in the destination directory on
+>>> any of my PO-enabled ikiwiki instances. Without more information,
+>>> there's nothing I can do: the config snippet pasted above is more
+>>> or less the example one and does not allow me to reproduce the
+>>> bug. --[[intrigeri]]
diff --git a/doc/git.mdwn b/doc/git.mdwn
index 2a2d10526..85323e645 100644
--- a/doc/git.mdwn
+++ b/doc/git.mdwn
@@ -68,6 +68,8 @@ think about merging them. This is recommended. :-)
* [[bzed|BerndZeimetz]] `git://git.recluse.de/users/bzed/ikiwiki.git`
* [[wtk]] `git://github.com/wking/ikiwiki.git`
* [[sunny256]] `git://github.com/sunny256/ikiwiki.git`
+* [[fmarier]] `git://gitorious.org/~fmarier/ikiwiki/fmarier-sandbox.git`
+* [[levitte]] `git://github.com/levitte/ikiwiki.git`
## branches
diff --git a/doc/rcs.mdwn b/doc/rcs.mdwn
index 06af9807c..4d75d6325 100644
--- a/doc/rcs.mdwn
+++ b/doc/rcs.mdwn
@@ -22,7 +22,7 @@ auto.setup |yes |yes |incomplete|yes |incomplete |yes
`rcs_remove` |yes |yes |yes |yes |no |yes |no |yes
`rcs_diff` |yes |yes |yes |yes |no |yes |yes |yes
`rcs_getctime` |fast |slow |slow |slow |slow |slow |slow |slow
-`rcs_getmtime` |fast |slow |slow |no |no |no |no |no
+`rcs_getmtime` |fast |slow |slow |slow |no |no |no |no
`rcs_preprevert` |yes |no |no |no |no |no |no |no
`rcs_revert` |yes |no |no |no |no |no |no |no
anonymous push |yes |no |no |no |no |no |no |no
diff --git a/doc/style.css b/doc/style.css
index fa413cf24..fcf39be6a 100644
--- a/doc/style.css
+++ b/doc/style.css
@@ -247,6 +247,9 @@ span.color {
.comment-subject {
font-weight: bold;
}
+.comment-avatar {
+ float: right;
+}
.comment {
border: 1px solid #aaa;
padding: 3px;
diff --git a/doc/todo/avatar.mdwn b/doc/todo/avatar.mdwn
index 91f924fa1..7fa3762da 100644
--- a/doc/todo/avatar.mdwn
+++ b/doc/todo/avatar.mdwn
@@ -3,6 +3,9 @@
It would be nice if ikiwiki, particularly [[plugins/comments]]
(but also, ideally, recentchanges) supported user avatar icons.
+> Update: Done for comments, but not for anything else, and the directive
+> below would be a nice addition. --[[Joey]]
+
Idea is to add a directive that displays a small avatar image for a user.
Pass it a user's the email address, openid, username, or the md5 hash
of their email address:
@@ -26,40 +29,3 @@ not have a gravatar, uses a cute auto-generated "wavatar" avatar.
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".
-
-The avatars are provided by various sites. For email addresses, it uses a
-[gravatar](http://gravatar.com/). 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. Also, when the user changes
-their email address in Preferences, the gravatar won't change until the
-wiki is rebuilt.)
-
-For openid, openavatar sucked and is now dead. So we need to use an email
-address instead, I guess. Problem is that the email address of a given
-openid is only known when that user is logged in and making a change.
-And we don't want to leak an openid user's email into a page either.
-Hmm. Suppose the gravatar hash could be calculated from the email address
-and embedded instead of the openid? That would work for comments,
-but not if the directive were used elsewhere.
-
-Or, for openid, could use <http://paulisageek.com/openidavatar>. Which
-works fine, but users are not likely to figure out what they need to do to
-get an avatar associated with their openid.
-
----
-
-Alternative, not overdesigned approach:
-
-Modify comments plugin to have an option to display avatars.
-
-When posting a comment, fill in the avatarhash field in the template.
-The hash is calculated from the user's email address. If the user's email
-is not known, skip it.
-
-End. :P
-
----
-
-[libravatar](https://launchpad.net/libravatar) is a federated avatar
-system. Young but might be the right way to get avatars eventually.
diff --git a/doc/todo/mirrorlist_with_per-mirror_usedirs_settings.mdwn b/doc/todo/mirrorlist_with_per-mirror_usedirs_settings.mdwn
index c164cf54a..baad063ef 100644
--- a/doc/todo/mirrorlist_with_per-mirror_usedirs_settings.mdwn
+++ b/doc/todo/mirrorlist_with_per-mirror_usedirs_settings.mdwn
@@ -77,9 +77,20 @@ and decided this time it was really needed to implement this feature.
>>>>> rewrite warning) mirrorlist branch. Please review, please pull.
>>>>> --[[intrigeri]]
+>>>>>> Ping? I've merged 3.20110321 in my `mirrorlist` branch and
+>>>>>> checked it still works properly. --[[intrigeri]]
+
>>>>> concerning goto/cgiurl, what about having that as the default in
>>>>> mirrorlist, but keeping ``nousedirs|file:///home/intrigeri/wiki`` and
>>>>> ``usedirs|http://example.com/wiki`` valid for cgi-less cases?
>>>>> that would keep typical installation with a clutter-less configuration,
>>>>> and support more individual setups too.
>>>>> --[[chrysn]]
+
+>>>>>> I would not mind. On the other hand Joey was concerned about
+>>>>>> cluttering the code to support edge cases, which I fully
+>>>>>> understand. The case you (chrysn) are describing being even
+>>>>>> more specific than the one I was initially talking of, I think
+>>>>>> this should not block the merge of the branch I have been
+>>>>>> proposing. Support for the usecase you are suggesting can
+>>>>>> always be added later if needed. --[[intrigeri]]
diff --git a/templates/comment.tmpl b/templates/comment.tmpl
index c2ee5a371..c16ca7c81 100644
--- a/templates/comment.tmpl
+++ b/templates/comment.tmpl
@@ -1,6 +1,10 @@
<TMPL_IF HTML5><article class="comment" id="<TMPL_VAR COMMENTID>">
<TMPL_ELSE><div class="comment" id="<TMPL_VAR COMMENTID>"></TMPL_IF>
+<TMPL_IF COMMENTAUTHORAVATAR><div class="comment-avatar">
+<img src="<TMPL_VAR COMMENTAUTHORAVATAR>" alt="" />
+</div></TMPL_IF>
+
<TMPL_IF HTML5><header class="comment-subject"><TMPL_ELSE><div class="comment-subject"></TMPL_IF>
<TMPL_IF PERMALINK>
<a href="<TMPL_VAR PERMALINK>"><TMPL_VAR TITLE></a>
@@ -58,4 +62,5 @@ Comment by
<TMPL_IF HTML5></nav><TMPL_ELSE></div></TMPL_IF>
</TMPL_IF>
+<div style="clear: both"></div>
<TMPL_IF HTML5></article><TMPL_ELSE></div></TMPL_IF>