From 151eb2c35730c8b38c187846eaaa8c1360a1d47a Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Sun, 5 Dec 2010 22:27:00 -0500 Subject: [PATCH] Show Gravatars for authors in the commit log partial --- chora/app/views/_logMessage.html.php | 3 +++ chora/lib/Chora.php | 20 ++++++++++++++++++++ chora/themes/default/screen.css | 7 ++++++- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/chora/app/views/_logMessage.html.php b/chora/app/views/_logMessage.html.php index a02b2e095..c9be18ce9 100644 --- a/chora/app/views/_logMessage.html.php +++ b/chora/app/views/_logMessage.html.php @@ -33,6 +33,9 @@
queryLog()) ?>
+
+ +
queryAuthor(), true) ?>
queryDate()) ?>
diff --git a/chora/lib/Chora.php b/chora/lib/Chora.php index 045bdd760..e0b84dfc4 100644 --- a/chora/lib/Chora.php +++ b/chora/lib/Chora.php @@ -442,6 +442,26 @@ class Chora return htmlspecialchars($name); } + public function getAuthorEmail($name) + { + try { + $users = $GLOBALS['VC']->getUsers($GLOBALS['conf']['paths']['cvsusers']); + if (isset($users[$name])) { + return $users[$name]['mail']; + } + } catch (Horde_Vcs_Exception $e) {} + + try { + $parser = new Horde_Mail_Rfc822(); + $results = $parser->parseAddressList($name); + if (count($results)) { + return $results[0]->mailbox . '@' . $results[0]->host; + } + } catch (Horde_Mail_Exception $e) {} + + return $name; + } + /** * Return formatted date information. * diff --git a/chora/themes/default/screen.css b/chora/themes/default/screen.css index 23c6cbf3b..39ea79f8d 100644 --- a/chora/themes/default/screen.css +++ b/chora/themes/default/screen.css @@ -179,7 +179,12 @@ h3.file-view-header { list-style: none; margin-bottom: .5em; } -.commit-author { +.commit-author-avatar { + float: left; + margin-right: .5em; + padding: 2px; + background: #fff; + border: 1px solid #ddd; } ul.commit-filelist { -- 2.11.0