Show gravatars in git logs.
authorEevee <git@veekun.com>
Wed, 18 Aug 2010 04:39:07 +0000 (21:39 -0700)
committerEevee <git@veekun.com>
Wed, 18 Aug 2010 04:39:07 +0000 (21:39 -0700)
splinext/frontpage/sources.py
splinext/frontpage/templates/css/frontpage.mako
splinext/frontpage/templates/front_page/git.mako

index e28dc38..43d8db8 100644 (file)
@@ -240,7 +240,7 @@ class FeedSource(CachedSource):
 
 FrontPageGit = namedtuple('FrontPageGit', ['source', 'time', 'log', 'tag'])
 FrontPageGitCommit = namedtuple('FrontPageGitCommit',
-    ['hash', 'author', 'time', 'subject', 'repo'])
+    ['hash', 'author', 'email', 'time', 'subject', 'repo'])
 
 class GitSource(CachedSource):
     """Represents a git repository.
@@ -333,16 +333,17 @@ class GitSource(CachedSource):
                     'git',
                     '--git-dir=' + repo_path,
                     'log',
-                    '--pretty=%h%x00%an%x00%at%x00%s',
+                    '--pretty=%h%x00%an%x00%aE%x00%at%x00%s',
                     "{0}..{1}".format(since_tag, tag),
                 ]
                 proc = subprocess.Popen(git_log_args, stdout=PIPE)
                 for line in proc.stdout:
-                    hash, author, time, subject = line.strip().split('\x00')
+                    hash, author, email, time, subject = line.strip().split('\x00')
                     commits.append(
                         FrontPageGitCommit(
                             hash = hash,
                             author = author,
+                            email = email,
                             time = datetime.datetime.fromtimestamp(int(time)),
                             subject = subject,
                             repo = repo_name,
index 2374f72..af7928e 100644 (file)
@@ -16,6 +16,7 @@
 
 .frontpage-update table.striped-rows tr:nth-child(2n) { background: #e8e8e8; }
 .frontpage-update table.striped-rows tr:nth-child(2n+1) { background: transparent; }
+.frontpage-update table.striped-rows tr:hover { background: #eae1d5; }
 
 table.frontpage-repository { width: 100%; }
 table.frontpage-repository tr.frontpage-repository-header { background: transparent !important; }
index 119aab3..4b70426 100644 (file)
 
             <tr>
                 <td class="hash"><a href="${update.source.gitweb}?p=${commit.repo}.git;a=commit;h=${commit.hash}">${commit.hash}</a></td>
-                <td class="author">${commit.author}</td>
+                <td class="author">
+                    <%! import hashlib %>\
+                    <img src="http://www.gravatar.com/avatar/${hashlib.md5(commit.email).hexdigest()}?s=16d=identicon" alt="">
+                    ${commit.author}
+                </td>
                 <td class="subject">${commit.subject}</td>
                 <td class="time">${commit.time}</td>
             </tr>