Term::ReadLine::Gnu
HTML::Tree
Sort::Naturally
+Gravatar::URL
=head1 AUTHOR
$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;
}
my $url=$params{url};
eval q{use URI::Heuristic};
- if (! $@) {
+ if (! $@) {
$url=URI::Heuristic::uf_uristr($url);
}
}
}
+ 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;
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;
$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}) {
* 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
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,
>> 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]]
"\"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]]
},
# 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]]
* [[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
`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
.comment-subject {
font-weight: bold;
}
+.comment-avatar {
+ float: right;
+}
.comment {
border: 1px solid #aaa;
padding: 3px;
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:
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.
>>>>> 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]]
<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>
<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>