details: http://www.bx.psu.edu/hg/galaxy/rev/1748118a736b changeset: 3303:1748118a736b user: James Taylor <james@jamestaylor.org> date: Fri Jan 29 14:50:37 2010 -0500 description: Gravatar's on pages, let's see how people react diffstat: lib/galaxy/web/framework/helpers/__init__.py | 10 ++++++++++ templates/display_base.mako | 8 ++++++++ 2 files changed, 18 insertions(+), 0 deletions(-) diffs (43 lines): diff -r e17d80f7e2b6 -r 1748118a736b lib/galaxy/web/framework/helpers/__init__.py --- a/lib/galaxy/web/framework/helpers/__init__.py Fri Jan 29 11:40:23 2010 -0500 +++ b/lib/galaxy/web/framework/helpers/__init__.py Fri Jan 29 14:50:37 2010 -0500 @@ -5,6 +5,7 @@ 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 @@ """ 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() \ No newline at end of file diff -r e17d80f7e2b6 -r 1748118a736b templates/display_base.mako --- a/templates/display_base.mako Fri Jan 29 11:40:23 2010 -0500 +++ b/templates/display_base.mako Fri Jan 29 14:50:37 2010 -0500 @@ -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>