Gravatar's on pages, let's see how people react

This commit is contained in:
James Taylor
2010-01-29 14:50:37 -05:00
parent 94f1f4b9e2
commit 33068ed973
2 changed files with 18 additions and 0 deletions
@@ -5,6 +5,7 @@ from webhelpers import *
from galaxy.util.json import to_json_string
from datetime import datetime, timedelta
import hashlib
# If the date is more than one week ago, then display the actual date instead of in words
def time_ago( x ):
@@ -43,3 +44,12 @@ def js( *args ):
"""
return "\n".join( [ javascript_include_tag( "/static/scripts/" + name + ".js?v=2" ) for name in args ] )
# Hashes
def md5( s ):
"""
Return hex encoded md5 hash of string s
"""
m = hashlib.md5()
m.update( s )
return m.hexdigest()
+8
View File
@@ -152,6 +152,14 @@
%if item.published:
<div style="padding: 10px;">
<h4>Author</h4>
<p>${item.user.username}</p>
<div><img src="http://www.gravatar.com/avatar/${h.md5(item.user.email)}?s=150"></div>
## Page meta.
<h4>Related ${item_plural}</h4>
<p>